{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s011096106", "group_id": "codeNet:p02243", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tMAX_N = 10000\n\tMAX_WEIGHT = 100000\n)\n\ntype Edge struct {\n\tstart int\n\tend int\n\tweight int\n}\n\ntype ShortestInfo struct {\n\tedges []Edge\n\tshortest int\n}\n\nfunc main() {\n\tdoMain(os.Stdin)\n}\n\nfunc doMain(reader io.Reader) {\n\tsc := bufio.NewScanner(reader)\n\tsc.Split(bufio.ScanWords)\n\n\tn, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tshortestList := make([]ShortestInfo, n)\n\tfor i := 1; i < n; i++ {\n\t\tshortestList[i] = ShortestInfo{edges: []Edge{}, shortest: MAX_N*MAX_WEIGHT + 1}\n\t}\n\n\tadjacentMatrix, err := createAdjacentMatrix(n, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsssp([]int{0}, shortestList, adjacentMatrix)\n\tfor _, v := range shortestList {\n\t\tfmt.Println(v.getEnd(), v.shortest)\n\t}\n}\n\nfunc (si ShortestInfo) getEnd() int {\n\tif len(si.edges) == 0 {\n\t\treturn 0\n\t} else {\n\t\treturn si.edges[len(si.edges)-1].end\n\t}\n}\n\nfunc createAdjacentMatrix(n int, sc *bufio.Scanner) ([][]int, error) {\n\tadjacentMatrix := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tid, err := nextInt(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tadjacentMatrix[id] = make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tadjacentMatrix[id][j] = -1\n\t\t}\n\t\tvertexNum, err := nextInt(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor j := 0; j < vertexNum; j++ {\n\t\t\tv, err := nextInt(sc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tc, err := nextInt(sc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tadjacentMatrix[id][v] = c\n\t\t}\n\t}\n\treturn adjacentMatrix, nil\n}\n\nfunc sssp(nodeStack []int, shortestList []ShortestInfo, adjacentMatrix [][]int) {\n\tfor len(nodeStack) > 0 {\n\t\tcurrentNode := nodeStack[0]\n\t\tnodeStack = nodeStack[1:]\n\t\tcurrentShortest := getShortest(currentNode, shortestList)\n\t\tadjacents := findAdjacents(currentNode, adjacentMatrix)\n\t\tfor i := 0; i < len(adjacents); i++ {\n\t\t\tadj := adjacents[i]\n\t\t\tif currentShortest.shortest+adj.weight < getShortest(adj.end, shortestList).shortest {\n\t\t\t\tsetShortest(adj.end, adj, currentShortest, shortestList)\n\t\t\t\tnodeStack = append(nodeStack, adj.end)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getShortest(node int, shortestList []ShortestInfo) ShortestInfo {\n\treturn shortestList[node]\n}\n\nfunc setShortest(node int, edge Edge, currentShortest ShortestInfo, shortestList []ShortestInfo) {\n\tnewEdges := make([]Edge, len(currentShortest.edges)+1)\n\tfor i := 0; i < len(newEdges)-1; i++ {\n\t\tnewEdges[i] = currentShortest.edges[i]\n\t}\n\tnewEdges[len(newEdges)-1] = edge\n\tshortestInfo := ShortestInfo{edges: newEdges, shortest: currentShortest.shortest + edge.weight}\n\tshortestList[node] = shortestInfo\n}\n\nfunc findAdjacents(currentNode int, adjacentMatrix [][]int) []Edge {\n\tadjacents := adjacentMatrix[currentNode]\n\tedges := []Edge{}\n\tfor i, v := range adjacents {\n\t\tif v >= 0 {\n\t\t\tedges = append(edges, Edge{start: currentNode, end: i, weight: v})\n\t\t}\n\t}\n\treturn edges\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\treturn strconv.Atoi(sc.Text())\n}\n\n", "language": "Go", "metadata": {"date": 1529760789, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02243.html", "problem_id": "p02243", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02243/input.txt", "sample_output_relpath": "derived/input_output/data/p02243/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02243/Go/s011096106.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Memory Limit Exceeded", "submission_id": "s011096106", "user_id": "u073049338"}, "prompt_components": {"gold_output": "0 0\n1 2\n2 2\n3 1\n4 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tMAX_N = 10000\n\tMAX_WEIGHT = 100000\n)\n\ntype Edge struct {\n\tstart int\n\tend int\n\tweight int\n}\n\ntype ShortestInfo struct {\n\tedges []Edge\n\tshortest int\n}\n\nfunc main() {\n\tdoMain(os.Stdin)\n}\n\nfunc doMain(reader io.Reader) {\n\tsc := bufio.NewScanner(reader)\n\tsc.Split(bufio.ScanWords)\n\n\tn, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tshortestList := make([]ShortestInfo, n)\n\tfor i := 1; i < n; i++ {\n\t\tshortestList[i] = ShortestInfo{edges: []Edge{}, shortest: MAX_N*MAX_WEIGHT + 1}\n\t}\n\n\tadjacentMatrix, err := createAdjacentMatrix(n, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsssp([]int{0}, shortestList, adjacentMatrix)\n\tfor _, v := range shortestList {\n\t\tfmt.Println(v.getEnd(), v.shortest)\n\t}\n}\n\nfunc (si ShortestInfo) getEnd() int {\n\tif len(si.edges) == 0 {\n\t\treturn 0\n\t} else {\n\t\treturn si.edges[len(si.edges)-1].end\n\t}\n}\n\nfunc createAdjacentMatrix(n int, sc *bufio.Scanner) ([][]int, error) {\n\tadjacentMatrix := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tid, err := nextInt(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tadjacentMatrix[id] = make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tadjacentMatrix[id][j] = -1\n\t\t}\n\t\tvertexNum, err := nextInt(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor j := 0; j < vertexNum; j++ {\n\t\t\tv, err := nextInt(sc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tc, err := nextInt(sc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tadjacentMatrix[id][v] = c\n\t\t}\n\t}\n\treturn adjacentMatrix, nil\n}\n\nfunc sssp(nodeStack []int, shortestList []ShortestInfo, adjacentMatrix [][]int) {\n\tfor len(nodeStack) > 0 {\n\t\tcurrentNode := nodeStack[0]\n\t\tnodeStack = nodeStack[1:]\n\t\tcurrentShortest := getShortest(currentNode, shortestList)\n\t\tadjacents := findAdjacents(currentNode, adjacentMatrix)\n\t\tfor i := 0; i < len(adjacents); i++ {\n\t\t\tadj := adjacents[i]\n\t\t\tif currentShortest.shortest+adj.weight < getShortest(adj.end, shortestList).shortest {\n\t\t\t\tsetShortest(adj.end, adj, currentShortest, shortestList)\n\t\t\t\tnodeStack = append(nodeStack, adj.end)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getShortest(node int, shortestList []ShortestInfo) ShortestInfo {\n\treturn shortestList[node]\n}\n\nfunc setShortest(node int, edge Edge, currentShortest ShortestInfo, shortestList []ShortestInfo) {\n\tnewEdges := make([]Edge, len(currentShortest.edges)+1)\n\tfor i := 0; i < len(newEdges)-1; i++ {\n\t\tnewEdges[i] = currentShortest.edges[i]\n\t}\n\tnewEdges[len(newEdges)-1] = edge\n\tshortestInfo := ShortestInfo{edges: newEdges, shortest: currentShortest.shortest + edge.weight}\n\tshortestList[node] = shortestInfo\n}\n\nfunc findAdjacents(currentNode int, adjacentMatrix [][]int) []Edge {\n\tadjacents := adjacentMatrix[currentNode]\n\tedges := []Edge{}\n\tfor i, v := range adjacents {\n\t\tif v >= 0 {\n\t\t\tedges = append(edges, Edge{start: currentNode, end: i, weight: v})\n\t\t}\n\t}\n\treturn edges\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\treturn strconv.Atoi(sc.Text())\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nSingle Source Shortest Path II\n\nFor a given weighted graph $G = (V, E)$, find the shortest path from a source to each vertex. For each vertex $u$, print the total weight of edges on the shortest path from vertex $0$ to $u$.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices in $G$ is given. In the following $n$ lines, adjacency lists for each vertex $u$ are respectively given in the following format:\n\n$u$ $k$ $v_1$ $c_1$ $v_2$ $c_2$ ... $v_k$ $c_k$\n\nVertices in $G$ are named with IDs $0, 1, ..., n-1$. $u$ is ID of the target vertex and $k$ denotes its degree. $v_i (i = 1, 2, ... k)$ denote IDs of vertices adjacent to $u$ and $c_i$ denotes the weight of a directed edge connecting $u$ and $v_i$ (from $u$ to $v_i$).\n\nOutput\n\nFor each vertex, print its ID and the distance separated by a space character in a line respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 10,000$\n\n$0 \\leq c_i \\leq 100,000$\n\n$|E| < 500,000$\n\nAll vertices are reachable from vertex $0$\n\nSample Input 1\n\n5\n0 3 2 3 3 1 1 2\n1 2 0 2 3 4\n2 3 0 3 3 1 4 1\n3 4 2 1 0 1 1 4 4 3\n4 2 2 1 3 3\n\nSample Output 1\n\n0 0\n1 2\n2 2\n3 1\n4 3\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "5\n0 3 2 3 3 1 1 2\n1 2 0 2 3 4\n2 3 0 3 3 1 4 1\n3 4 2 1 0 1 1 4 4 3\n4 2 2 1 3 3\n"}, "reference_outputs": ["0 0\n1 2\n2 2\n3 1\n4 3\n"], "source_document_id": "p02243", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nSingle Source Shortest Path II\n\nFor a given weighted graph $G = (V, E)$, find the shortest path from a source to each vertex. For each vertex $u$, print the total weight of edges on the shortest path from vertex $0$ to $u$.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices in $G$ is given. In the following $n$ lines, adjacency lists for each vertex $u$ are respectively given in the following format:\n\n$u$ $k$ $v_1$ $c_1$ $v_2$ $c_2$ ... $v_k$ $c_k$\n\nVertices in $G$ are named with IDs $0, 1, ..., n-1$. $u$ is ID of the target vertex and $k$ denotes its degree. $v_i (i = 1, 2, ... k)$ denote IDs of vertices adjacent to $u$ and $c_i$ denotes the weight of a directed edge connecting $u$ and $v_i$ (from $u$ to $v_i$).\n\nOutput\n\nFor each vertex, print its ID and the distance separated by a space character in a line respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 10,000$\n\n$0 \\leq c_i \\leq 100,000$\n\n$|E| < 500,000$\n\nAll vertices are reachable from vertex $0$\n\nSample Input 1\n\n5\n0 3 2 3 3 1 1 2\n1 2 0 2 3 4\n2 3 0 3 3 1 4 1\n3 4 2 1 0 1 1 4 4 3\n4 2 2 1 3 3\n\nSample Output 1\n\n0 0\n1 2\n2 2\n3 1\n4 3\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2950, "cpu_time_ms": 1260, "memory_kb": 896840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s553957296", "group_id": "codeNet:p02246", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc search(in [16]byte) int {\n\tfor i := 0; i < 16; i++ {\n\t\tif in[i] == byte(0) {\n\t\t\treturn i\n\t\t}\n\t}\n\tpanic(\"not found 0\")\n}\n\nfunc up(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\tif pos > 3 {\n\t\tin[pos], in[pos-4] = in[pos-4], in[pos]\n\n\t} else {\n\t\treturn false, in\n\t}\n\treturn true, in\n\n}\n\nfunc down(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\tif pos < 12 {\n\t\tin[pos], in[pos+4] = in[pos+4], in[pos]\n\t} else {\n\t\treturn false, in\n\n\t}\n\treturn true, in\n\n}\n\nfunc left(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\t// mod(pos, 4) == 0\n\tif pos != 0 && pos != 4 && pos != 8 && pos != 12 {\n\t\tin[pos], in[pos-1] = in[pos-1], in[pos]\n\t} else {\n\t\treturn false, in\n\t}\n\treturn true, in\n\n}\nfunc right(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\t// mod(pos, 4) == 3\n\tif pos != 3 && pos != 7 && pos != 11 && pos != 15 {\n\t\tin[pos], in[pos+1] = in[pos+1], in[pos]\n\t} else {\n\t\treturn false, in\n\n\t}\n\treturn true, in\n\n}\n\nfunc next() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n\n}\n\nvar goal = [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0}\n\nfunc pp(s [16]byte) {\n\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Printf(\"%2d %2d %2d %2d\\n\", s[0+4*i], s[1+4*i], s[2+4*i], s[3+4*i])\n\t}\n\tfmt.Println(\"----------------------\")\n\n}\n\nfunc dls(limit int, now int, state [16]byte, parents map[[16]byte]bool) bool {\n\n\tif parents[state] {\n\t\treturn false\n\t}\n\n\tif now == limit+1 {\n\t\treturn false\n\n\t}\n\n\tif state == goal {\n\t\treturn true\n\t}\n\n\tparents[state] = true\n\n\tok, ur := up(state)\n\tif ok {\n\t\tif dls(limit, now+1, ur, parents) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, dr := down(state)\n\tif ok {\n\t\tif dls(limit, now+1, dr, parents) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, lr := left(state)\n\tif ok {\n\t\tif dls(limit, now+1, lr, parents) {\n\t\t\treturn true\n\t\t}\n\t}\n\tok, rr := right(state)\n\tif ok {\n\t\tif dls(limit, now+1, rr, parents) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar state [16]byte\n\tfor i := 0; i < 16; i++ {\n\t\tstate[i] = byte(next())\n\t}\n\tfor i := 0; i < 45; i++ {\n\t\tif dls(i, 0, state, map[[16]byte]bool{}) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1526197792, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02246.html", "problem_id": "p02246", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02246/input.txt", "sample_output_relpath": "derived/input_output/data/p02246/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02246/Go/s553957296.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s553957296", "user_id": "u703343271"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc search(in [16]byte) int {\n\tfor i := 0; i < 16; i++ {\n\t\tif in[i] == byte(0) {\n\t\t\treturn i\n\t\t}\n\t}\n\tpanic(\"not found 0\")\n}\n\nfunc up(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\tif pos > 3 {\n\t\tin[pos], in[pos-4] = in[pos-4], in[pos]\n\n\t} else {\n\t\treturn false, in\n\t}\n\treturn true, in\n\n}\n\nfunc down(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\tif pos < 12 {\n\t\tin[pos], in[pos+4] = in[pos+4], in[pos]\n\t} else {\n\t\treturn false, in\n\n\t}\n\treturn true, in\n\n}\n\nfunc left(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\t// mod(pos, 4) == 0\n\tif pos != 0 && pos != 4 && pos != 8 && pos != 12 {\n\t\tin[pos], in[pos-1] = in[pos-1], in[pos]\n\t} else {\n\t\treturn false, in\n\t}\n\treturn true, in\n\n}\nfunc right(in [16]byte) (bool, [16]byte) {\n\tpos := search(in)\n\t// mod(pos, 4) == 3\n\tif pos != 3 && pos != 7 && pos != 11 && pos != 15 {\n\t\tin[pos], in[pos+1] = in[pos+1], in[pos]\n\t} else {\n\t\treturn false, in\n\n\t}\n\treturn true, in\n\n}\n\nfunc next() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n\n}\n\nvar goal = [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0}\n\nfunc pp(s [16]byte) {\n\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Printf(\"%2d %2d %2d %2d\\n\", s[0+4*i], s[1+4*i], s[2+4*i], s[3+4*i])\n\t}\n\tfmt.Println(\"----------------------\")\n\n}\n\nfunc dls(limit int, now int, state [16]byte, parents map[[16]byte]bool) bool {\n\n\tif parents[state] {\n\t\treturn false\n\t}\n\n\tif now == limit+1 {\n\t\treturn false\n\n\t}\n\n\tif state == goal {\n\t\treturn true\n\t}\n\n\tparents[state] = true\n\n\tok, ur := up(state)\n\tif ok {\n\t\tif dls(limit, now+1, ur, parents) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, dr := down(state)\n\tif ok {\n\t\tif dls(limit, now+1, dr, parents) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, lr := left(state)\n\tif ok {\n\t\tif dls(limit, now+1, lr, parents) {\n\t\t\treturn true\n\t\t}\n\t}\n\tok, rr := right(state)\n\tif ok {\n\t\tif dls(limit, now+1, rr, parents) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar state [16]byte\n\tfor i := 0; i < 16; i++ {\n\t\tstate[i] = byte(next())\n\t}\n\tfor i := 0; i < 45; i++ {\n\t\tif dls(i, 0, state, map[[16]byte]bool{}) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\n15 Puzzle\n\nThe goal of the 15 puzzle problem is to complete pieces on $4 \\times 4$ cells where one of the cells is empty space.\n\nIn this problem, the space is represented by 0 and pieces are represented by integers from 1 to 15 as shown below.\n\n1 2 3 4\n6 7 8 0\n5 10 11 12\n9 13 14 15\n\nYou can move a piece toward the empty space at one step. Your goal is to make the pieces the following configuration in the shortest move (fewest steps).\n\n1 2 3 4\n5 6 7 8\n9 10 11 12\n13 14 15 0\n\nWrite a program which reads an initial state of the puzzle and prints the fewest steps to solve the puzzle.\n\nInput\n\nThe $4 \\times 4$ integers denoting the pieces or space are given.\n\nOutput\n\nPrint the fewest steps in a line.\n\nConstraints\n\nThe given puzzle is solvable in at most 45 steps.\n\nSample Input\n\n1 2 3 4\n6 7 8 0\n5 10 11 12\n9 13 14 15\n\nSample Output\n\n8", "sample_input": "1 2 3 4\n6 7 8 0\n5 10 11 12\n9 13 14 15\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02246", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\n15 Puzzle\n\nThe goal of the 15 puzzle problem is to complete pieces on $4 \\times 4$ cells where one of the cells is empty space.\n\nIn this problem, the space is represented by 0 and pieces are represented by integers from 1 to 15 as shown below.\n\n1 2 3 4\n6 7 8 0\n5 10 11 12\n9 13 14 15\n\nYou can move a piece toward the empty space at one step. Your goal is to make the pieces the following configuration in the shortest move (fewest steps).\n\n1 2 3 4\n5 6 7 8\n9 10 11 12\n13 14 15 0\n\nWrite a program which reads an initial state of the puzzle and prints the fewest steps to solve the puzzle.\n\nInput\n\nThe $4 \\times 4$ integers denoting the pieces or space are given.\n\nOutput\n\nPrint the fewest steps in a line.\n\nConstraints\n\nThe given puzzle is solvable in at most 45 steps.\n\nSample Input\n\n1 2 3 4\n6 7 8 0\n5 10 11 12\n9 13 14 15\n\nSample Output\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2181, "cpu_time_ms": 10, "memory_kb": 4416}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s782975692", "group_id": "codeNet:p02246", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nvar up=[2]int{-1,0}\nvar down=[2]int{1,0}\nvar left=[2]int{0,-1}\nvar right=[2]int{0,1}\n\nconst size int =4\n\nconst UP int =0\nconst DOWN int =2\nconst LEFT int =1\nconst RIGHT int =3\n\nvar targetPoints [size*size][2]int\n\nvar movesHistory [100000]int\nvar ans=0\nvar tState =[][]int {//aim state\n{1 ,2 ,3 ,4 } ,\n{5 ,6 ,7 ,8 } ,\n{9 ,10,11,12} ,\n{13,14,15,0 }}\nvar STEP_SUM=0\nvar sState [][]int //Init state\nvar blank_row,blank_column int\nfunc main(){\n\tvar in = bufio.NewReader(os.Stdin)\n\tvar out = bufio.NewWriter(os.Stdout)\n\tsState=make([][]int,size)\n\tfor i,_ := range sState {\n\t\tsState[i]=make([]int,size)\n\t}\n\tfor i := 0; i < size; i++ {\n\t\tfmt.Fscanf(in, \"%d %d %d %d\\n\", &sState[i][0], &sState[i][1],&sState[i][2],&sState[i][3])\n\t}\n\tgetPoint()\n\tj:=getHeuristic(sState)\n\ti:=-1\n\tfor ans = j; ; ans++ {\n\t\tif solve(sState,blank_row,blank_column,0,i,j) {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor k:=0;k targetPoints[state[blank_row1][blank_column1]][0] {\n\t\t\th1 = h - 1\n\t\t} else if direction == UP && blank_row1< targetPoints[state[blank_row1][blank_column1]][0] {\n\t\t\th1 = h - 1\n\t\t} else if direction == RIGHT && blank_column1> targetPoints[state[blank_row1][blank_column1]][1] {\n\t\t\th1 = h - 1\n\t\t} else if direction == LEFT && blank_column1< targetPoints[state[blank_row1][blank_column1]][1] {\n\t\t\th1 = h - 1\n\t\t} else {\n\t\t\t//bad situation make the step bigger.\n\t\t\th1 = h + 1\n\t\t}\n\t\tif h1+dep+1>ans { //pruning\n\t\t\tcontinue\n\t\t}\n\t\tmovesHistory[dep] = direction\n\n\t\tif solve(state2, blank_row1, blank_column1, dep+1, direction, h1) {\n\t\t\treturn true\n\t\t}\n\t\t}\n\treturn false\n}\nfunc move(state [][]int,direction int) {\n\trow := 0\n\tcolumn := 0\n\tfor i:=0;i targetPoints[state[blank_row1][blank_column1]][0] {\n\t\t\th1 = h - 1\n\t\t} else if direction == UP && blank_row1< targetPoints[state[blank_row1][blank_column1]][0] {\n\t\t\th1 = h - 1\n\t\t} else if direction == RIGHT && blank_column1> targetPoints[state[blank_row1][blank_column1]][1] {\n\t\t\th1 = h - 1\n\t\t} else if direction == LEFT && blank_column1< targetPoints[state[blank_row1][blank_column1]][1] {\n\t\t\th1 = h - 1\n\t\t} else {\n\t\t\t//bad situation make the step bigger.\n\t\t\th1 = h + 1\n\t\t}\n\t\tif h1+dep+1>ans { //pruning\n\t\t\tcontinue\n\t\t}\n\t\tmovesHistory[dep] = direction\n\n\t\tif solve(state2, blank_row1, blank_column1, dep+1, direction, h1) {\n\t\t\treturn true\n\t\t}\n\t\t}\n\treturn false\n}\nfunc move(state [][]int,direction int) {\n\trow := 0\n\tcolumn := 0\n\tfor i:=0;i 0 {\n\t\tp := queue.deq()\n\t\tif p.time > q {\n\t\t\ttotal = total + q\n\t\t\tp.time = p.time - q\n\t\t\tqueue.enq(p)\n\t\t} else {\n\t\t\ttotal = total + p.time\n\t\t\tfmt.Printf(\"%s %d\\n\", p.name, total)\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1594047499, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02264.html", "problem_id": "p02264", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02264/input.txt", "sample_output_relpath": "derived/input_output/data/p02264/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02264/Go/s222382959.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s222382959", "user_id": "u382730661"}, "prompt_components": {"gold_output": "p2 180\np5 400\np1 450\np3 550\np4 800\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc toInt(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\ntype Process struct {\n\tname string\n\ttime int\n}\n\ntype Queue struct {\n\tps []*Process\n\tstart int\n\tend int\n\tlen int\n}\n\nfunc (q *Queue) enq(p *Process) {\n\tif q.len == len(q.ps) {\n\t\tpanic(\"\")\n\t}\n\tif q.end == len(q.ps) {\n\t\tq.ps[0] = p\n\t\tq.end = 0\n\t} else {\n\t\tq.ps[q.end] = p\n\t}\n\tq.end++\n\tq.len++\n}\n\nfunc (q *Queue) deq() *Process {\n\tif q.len == 0 {\n\t\tpanic(\"\")\n\t}\n\tresult := q.ps[q.start]\n\tif q.start == len(q.ps)-1 {\n\t\tq.start = 0\n\t} else {\n\t\tq.start++\n\t}\n\tq.len--\n\treturn result\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanLines)\n\tsc.Scan()\n\tin := strings.Split(sc.Text(), \" \")\n\tn := toInt(in[0])\n\tq := toInt(in[1])\n\n\tl := make([]*Process, n)\n\tqueue := Queue{ps: l}\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\tp := strings.Split(sc.Text(), \" \")\n\t\tqueue.enq(&Process{name: p[0], time: toInt(p[1])})\n\t}\n\n\ttotal := 0\n\tfor queue.len > 0 {\n\t\tp := queue.deq()\n\t\tif p.time > q {\n\t\t\ttotal = total + q\n\t\t\tp.time = p.time - q\n\t\t\tqueue.enq(p)\n\t\t} else {\n\t\t\ttotal = total + p.time\n\t\t\tfmt.Printf(\"%s %d\\n\", p.name, total)\n\t\t}\n\t}\n}\n\n", "problem_context": "There are n processes in a queue. Each process has namei and timei. The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by then. The process is resumed and moved to the end of the queue, then the scheduler handles the next process in the queue.\n\nFor example, we have the following queue with the quantum of 100ms.\n\nA(150) - B(80) - C(200) - D(200)\n\nFirst, process A is handled for 100ms, then the process is moved to the end of the queue with the remaining time (50ms).\n\nB(80) - C(200) - D(200) - A(50)\n\nNext, process B is handled for 80ms. The process is completed with the time stamp of 180ms and removed from the queue.\n\nC(200) - D(200) - A(50)\n\nYour task is to write a program which simulates the round-robin scheduling.\n\nInput\n\nn q\n\nname1 time1\n\nname2 time2\n\n...\n\nnamen timen\n\nIn the first line the number of processes n and the quantum q are given separated by a single space.\n\nIn the following n lines, names and times for the n processes are given. namei and timei are separated by a single space.\n\nOutput\n\nFor each process, prints its name and the time the process finished in order.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n1 ≤ q ≤ 1000\n\n1 ≤ timei ≤ 50000\n\n1 ≤ length of namei ≤ 10\n\n1 ≤ Sum of timei ≤ 1000000\n\nSample Input 1\n\n5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n\nSample Output 1\n\np2 180\np5 400\np1 450\np3 550\np4 800\n\nNotes\n\nTemplate in C", "sample_input": "5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n"}, "reference_outputs": ["p2 180\np5 400\np1 450\np3 550\np4 800\n"], "source_document_id": "p02264", "source_text": "There are n processes in a queue. Each process has namei and timei. The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by then. The process is resumed and moved to the end of the queue, then the scheduler handles the next process in the queue.\n\nFor example, we have the following queue with the quantum of 100ms.\n\nA(150) - B(80) - C(200) - D(200)\n\nFirst, process A is handled for 100ms, then the process is moved to the end of the queue with the remaining time (50ms).\n\nB(80) - C(200) - D(200) - A(50)\n\nNext, process B is handled for 80ms. The process is completed with the time stamp of 180ms and removed from the queue.\n\nC(200) - D(200) - A(50)\n\nYour task is to write a program which simulates the round-robin scheduling.\n\nInput\n\nn q\n\nname1 time1\n\nname2 time2\n\n...\n\nnamen timen\n\nIn the first line the number of processes n and the quantum q are given separated by a single space.\n\nIn the following n lines, names and times for the n processes are given. namei and timei are separated by a single space.\n\nOutput\n\nFor each process, prints its name and the time the process finished in order.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n1 ≤ q ≤ 1000\n\n1 ≤ timei ≤ 50000\n\n1 ≤ length of namei ≤ 10\n\n1 ≤ Sum of timei ≤ 1000000\n\nSample Input 1\n\n5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n\nSample Output 1\n\np2 180\np5 400\np1 450\np3 550\np4 800\n\nNotes\n\nTemplate in C", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1214, "cpu_time_ms": 100, "memory_kb": 6604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s983330927", "group_id": "codeNet:p02267", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, Q int\n\tfmt.Scan(&N)\n\tS := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&S[i])\n\t}\n\tfmt.Scan(&Q)\n\tT := make([]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tfmt.Scan(&T[i])\n\t}\n\tvar count int\n\tfor _, t := range T {\n\t\tfor _, s := range S {\n\t\t\tif t == s {\n\t\t\t\tcount++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\n", "language": "Go", "metadata": {"date": 1572879024, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02267.html", "problem_id": "p02267", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02267/input.txt", "sample_output_relpath": "derived/input_output/data/p02267/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02267/Go/s983330927.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s983330927", "user_id": "u525205447"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, Q int\n\tfmt.Scan(&N)\n\tS := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&S[i])\n\t}\n\tfmt.Scan(&Q)\n\tT := make([]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tfmt.Scan(&T[i])\n\t}\n\tvar count int\n\tfor _, t := range T {\n\t\tfor _, s := range S {\n\t\t\tif t == s {\n\t\t\t\tcount++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\n", "problem_context": "Search I\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nn ≤ 10000\n\nq ≤ 500\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n3 1 2\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "sample_input": "5\n1 2 3 4 5\n3\n3 4 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02267", "source_text": "Search I\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nn ≤ 10000\n\nq ≤ 500\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n3 1 2\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 354, "cpu_time_ms": 10, "memory_kb": 1688}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s783077622", "group_id": "codeNet:p02276", "input_text": "package main\n\n/*\nパーティション\n*/\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc partitionString(a []int, base int) string {\n\tvar buf bytes.Buffer\n\tsep := \"\"\n\tfor i, v := range a {\n\t\tif i == base {\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%s[%d]\", sep, v))\n\t\t} else {\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%s%d\", sep, v))\n\t\t}\n\t\tsep = \" \"\n\t}\n\treturn buf.String()\n}\n\nfunc partition(a []int) ([]int, int) {\n\tx := a[len(a)-1]\n\ti := -1\n\tfor j := 0; j < len(a)-1; j++ {\n\t\tif a[j] <= x {\n\t\t\ti++\n\t\t\ta[i], a[j] = a[j], a[i]\n\t\t}\n\t}\n\ta[len(a)-1], a[i+1] = a[i+1], a[len(a)-1]\n\treturn a, i + 1\n}\n\nfunc main() {\n\tscanner := makeScanner(100000 * 100000)\n\teGetInt(scanner)\n\ts := eGetInts(scanner)\n\ts, idx := partition(s)\n\tfmt.Println(partitionString(s, idx))\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nfunc makeScanner(max int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), max)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tvar ints []int\n\tfor _, f := range fields {\n\t\tints = append(ints, eAtoi(f))\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\n\ntype ints []int\n\nfunc (s ints) String() string {\n\tvar buf bytes.Buffer\n\tsep := \"\"\n\tfor _, v := range s {\n\t\tbuf.WriteString(fmt.Sprintf(\"%s%d\", sep, v))\n\t\tsep = \" \"\n\t}\n\treturn buf.String()\n}\n\nfunc reverse(a ints) ints {\n\tr := make(ints, len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\tr[i] = a[len(a)-1-i]\n\t}\n\treturn r\n}\nfunc max(a ints) (int, bool) {\n\tif len(a) == 0 {\n\t\treturn 0, false\n\t}\n\tm := a[0]\n\tfor _, e := range a {\n\t\tif e > m {\n\t\t\tm = e\n\t\t}\n\t}\n\treturn m, true\n}\nfunc sum(a ints) int {\n\tif len(a) == 0 {\n\t\treturn 0\n\t}\n\tsum := 0\n\tfor _, e := range a {\n\t\tsum += e\n\t}\n\treturn sum\n}\n\n", "language": "Go", "metadata": {"date": 1554155014, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02276.html", "problem_id": "p02276", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02276/input.txt", "sample_output_relpath": "derived/input_output/data/p02276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02276/Go/s783077622.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s783077622", "user_id": "u524757998"}, "prompt_components": {"gold_output": "9 5 8 7 4 2 6 [11] 21 13 19 12\n", "input_to_evaluate": "package main\n\n/*\nパーティション\n*/\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc partitionString(a []int, base int) string {\n\tvar buf bytes.Buffer\n\tsep := \"\"\n\tfor i, v := range a {\n\t\tif i == base {\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%s[%d]\", sep, v))\n\t\t} else {\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%s%d\", sep, v))\n\t\t}\n\t\tsep = \" \"\n\t}\n\treturn buf.String()\n}\n\nfunc partition(a []int) ([]int, int) {\n\tx := a[len(a)-1]\n\ti := -1\n\tfor j := 0; j < len(a)-1; j++ {\n\t\tif a[j] <= x {\n\t\t\ti++\n\t\t\ta[i], a[j] = a[j], a[i]\n\t\t}\n\t}\n\ta[len(a)-1], a[i+1] = a[i+1], a[len(a)-1]\n\treturn a, i + 1\n}\n\nfunc main() {\n\tscanner := makeScanner(100000 * 100000)\n\teGetInt(scanner)\n\ts := eGetInts(scanner)\n\ts, idx := partition(s)\n\tfmt.Println(partitionString(s, idx))\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nfunc makeScanner(max int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), max)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tvar ints []int\n\tfor _, f := range fields {\n\t\tints = append(ints, eAtoi(f))\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\n\ntype ints []int\n\nfunc (s ints) String() string {\n\tvar buf bytes.Buffer\n\tsep := \"\"\n\tfor _, v := range s {\n\t\tbuf.WriteString(fmt.Sprintf(\"%s%d\", sep, v))\n\t\tsep = \" \"\n\t}\n\treturn buf.String()\n}\n\nfunc reverse(a ints) ints {\n\tr := make(ints, len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\tr[i] = a[len(a)-1-i]\n\t}\n\treturn r\n}\nfunc max(a ints) (int, bool) {\n\tif len(a) == 0 {\n\t\treturn 0, false\n\t}\n\tm := a[0]\n\tfor _, e := range a {\n\t\tif e > m {\n\t\t\tm = e\n\t\t}\n\t}\n\treturn m, true\n}\nfunc sum(a ints) int {\n\tif len(a) == 0 {\n\t\treturn 0\n\t}\n\tsum := 0\n\tfor _, e := range a {\n\t\tsum += e\n\t}\n\treturn sum\n}\n\n", "problem_context": "Partition\n\nQuick sort is based on the Divide-and-conquer approach. In QuickSort(A, p, r), first, a procedure Partition(A, p, r) divides an array A[p..r] into two subarrays A[p..q-1] and A[q+1..r] such that each element of A[p..q-1] is less than or equal to A[q], which is, inturn, less than or equal to each element of A[q+1..r]. It also computes the index q.\n\nIn the conquer processes, the two subarrays A[p..q-1] and A[q+1..r] are sorted by recursive calls of QuickSort(A, p, q-1) and QuickSort(A, q+1, r).\n\nYour task is to read a sequence A and perform the Partition based on the following pseudocode:\n\nPartition(A, p, r)\n1 x = A[r]\n2 i = p-1\n3 for j = p to r-1\n4 do if A[j] <= x\n5 then i = i+1\n6 exchange A[i] and A[j]\n7 exchange A[i+1] and A[r]\n8 return i+1\n\nNote that, in this algorithm, Partition always selects an element A[r] as a pivot element around which to partition the array A[p..r].\n\nInput\n\nThe first line of the input includes an integer n, the number of elements in the sequence A.\n\nIn the second line, Ai (i = 1,2,...,n), elements of the sequence are given separated by space characters.\n\nOutput\n\nPrint the sorted sequence. Two contiguous elements of the sequence should be separated by a space character. The element which is selected as the pivot of the partition should be indicated by [  ].\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n0 ≤ Ai ≤ 100,000\n\nSample Input 1\n\n12\n13 19 9 5 12 8 7 4 21 2 6 11\n\nSample Output 1\n\n9 5 8 7 4 2 6 [11] 21 13 19 12", "sample_input": "12\n13 19 9 5 12 8 7 4 21 2 6 11\n"}, "reference_outputs": ["9 5 8 7 4 2 6 [11] 21 13 19 12\n"], "source_document_id": "p02276", "source_text": "Partition\n\nQuick sort is based on the Divide-and-conquer approach. In QuickSort(A, p, r), first, a procedure Partition(A, p, r) divides an array A[p..r] into two subarrays A[p..q-1] and A[q+1..r] such that each element of A[p..q-1] is less than or equal to A[q], which is, inturn, less than or equal to each element of A[q+1..r]. It also computes the index q.\n\nIn the conquer processes, the two subarrays A[p..q-1] and A[q+1..r] are sorted by recursive calls of QuickSort(A, p, q-1) and QuickSort(A, q+1, r).\n\nYour task is to read a sequence A and perform the Partition based on the following pseudocode:\n\nPartition(A, p, r)\n1 x = A[r]\n2 i = p-1\n3 for j = p to r-1\n4 do if A[j] <= x\n5 then i = i+1\n6 exchange A[i] and A[j]\n7 exchange A[i+1] and A[r]\n8 return i+1\n\nNote that, in this algorithm, Partition always selects an element A[r] as a pivot element around which to partition the array A[p..r].\n\nInput\n\nThe first line of the input includes an integer n, the number of elements in the sequence A.\n\nIn the second line, Ai (i = 1,2,...,n), elements of the sequence are given separated by space characters.\n\nOutput\n\nPrint the sorted sequence. Two contiguous elements of the sequence should be separated by a space character. The element which is selected as the pivot of the partition should be indicated by [  ].\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n0 ≤ Ai ≤ 100,000\n\nSample Input 1\n\n12\n13 19 9 5 12 8 7 4 21 2 6 11\n\nSample Output 1\n\n9 5 8 7 4 2 6 [11] 21 13 19 12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2368, "cpu_time_ms": 30, "memory_kb": 8796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s110321665", "group_id": "codeNet:p02288", "input_text": "// AOJ ALDS1_9_B: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_9_B\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype maxHeap struct {\n\theap []int\n\tsize int\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc (mh maxHeap) buildMaxHeap() {\n\tfor i := mh.size / 2; i >= 1; i-- {\n\t\tmh.maxHeapify(i)\n\t}\n}\n\nfunc (mh maxHeap) maxHeapify(i int) {\n\tl := mh.left(i)\n\tr := mh.right(i)\n\n\t// 自分、左の子、右の子で値が最大のnodeを選ぶ\n\tlargest := i\n\tif l <= mh.size && mh.heap[l] > mh.heap[i] {\n\t\tlargest = l\n\t}\n\n\tif r <= mh.size && mh.heap[r] > mh.heap[largest] {\n\t\tlargest = r\n\t}\n\n\t// iの子のほうが値が大きい場合\n\tif i != largest {\n\t\tmh.heap[i], mh.heap[largest] = mh.heap[largest], mh.heap[i]\n\t\tmh.maxHeapify(largest) // 再帰的に呼び出し\n\t}\n}\n\nfunc (mh maxHeap) left(i int) int {\n\treturn 2 * i\n}\n\nfunc (mh maxHeap) right(i int) int {\n\treturn 2*i + 1\n}\n\nfunc (mh maxHeap) printHeap() {\n\tbuf := bufio.NewWriter(os.Stdout)\n\tfor i := 1; i < mh.size+1; i++ {\n\t\tbuf.Write([]byte(fmt.Sprintf(\" %d\", mh.heap[i])))\n\t}\n\tbuf.Write([]byte(\"\\n\"))\n\tbuf.Flush()\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th := nextInt(sc)\n\n\tmh := maxHeap{make([]int, h+1), h}\n\n\tfor i := 1; i < h+1; i++ {\n\t\tmh.heap[i] = nextInt(sc)\n\t}\n\n\tmh.buildMaxHeap()\n\tmh.printHeap()\n}\n\n", "language": "Go", "metadata": {"date": 1565614358, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02288.html", "problem_id": "p02288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02288/input.txt", "sample_output_relpath": "derived/input_output/data/p02288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02288/Go/s110321665.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s110321665", "user_id": "u243094114"}, "prompt_components": {"gold_output": " 16 14 10 8 7 9 3 2 4 1\n", "input_to_evaluate": "// AOJ ALDS1_9_B: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_9_B\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype maxHeap struct {\n\theap []int\n\tsize int\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc (mh maxHeap) buildMaxHeap() {\n\tfor i := mh.size / 2; i >= 1; i-- {\n\t\tmh.maxHeapify(i)\n\t}\n}\n\nfunc (mh maxHeap) maxHeapify(i int) {\n\tl := mh.left(i)\n\tr := mh.right(i)\n\n\t// 自分、左の子、右の子で値が最大のnodeを選ぶ\n\tlargest := i\n\tif l <= mh.size && mh.heap[l] > mh.heap[i] {\n\t\tlargest = l\n\t}\n\n\tif r <= mh.size && mh.heap[r] > mh.heap[largest] {\n\t\tlargest = r\n\t}\n\n\t// iの子のほうが値が大きい場合\n\tif i != largest {\n\t\tmh.heap[i], mh.heap[largest] = mh.heap[largest], mh.heap[i]\n\t\tmh.maxHeapify(largest) // 再帰的に呼び出し\n\t}\n}\n\nfunc (mh maxHeap) left(i int) int {\n\treturn 2 * i\n}\n\nfunc (mh maxHeap) right(i int) int {\n\treturn 2*i + 1\n}\n\nfunc (mh maxHeap) printHeap() {\n\tbuf := bufio.NewWriter(os.Stdout)\n\tfor i := 1; i < mh.size+1; i++ {\n\t\tbuf.Write([]byte(fmt.Sprintf(\" %d\", mh.heap[i])))\n\t}\n\tbuf.Write([]byte(\"\\n\"))\n\tbuf.Flush()\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th := nextInt(sc)\n\n\tmh := maxHeap{make([]int, h+1), h}\n\n\tfor i := 1; i < h+1; i++ {\n\t\tmh.heap[i] = nextInt(sc)\n\t}\n\n\tmh.buildMaxHeap()\n\tmh.printHeap()\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\n4 1 3 2 16 9 10 14 8 7\n"}, "reference_outputs": [" 16 14 10 8 7 9 3 2 4 1\n"], "source_document_id": "p02288", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1391, "cpu_time_ms": 260, "memory_kb": 10168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s097554686", "group_id": "codeNet:p02359", "input_text": "package main\n\nimport \"fmt\"\n\nconst size = 100001\n\nfunc main() {\n var n, t int\n var l, r int\n var mem [size]int\n fmt.Scan(&n)\n fmt.Scan(&t)\n for i := 0; i < n; i++ {\n fmt.Scan(&l)\n fmt.Scan(&r)\n mem[l] += 1\n mem[r] -= 1\n }\n ans := mem[0]\n for i := 1; i < t + 1; i++ {\n mem[i] += mem[i - 1]\n if ans < mem[i] {\n ans = mem[i]\n }\n }\n fmt.Println(ans)\n}\n\n", "language": "Go", "metadata": {"date": 1548222024, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02359.html", "problem_id": "p02359", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02359/input.txt", "sample_output_relpath": "derived/input_output/data/p02359/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02359/Go/s097554686.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s097554686", "user_id": "u352394527"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nconst size = 100001\n\nfunc main() {\n var n, t int\n var l, r int\n var mem [size]int\n fmt.Scan(&n)\n fmt.Scan(&t)\n for i := 0; i < n; i++ {\n fmt.Scan(&l)\n fmt.Scan(&r)\n mem[l] += 1\n mem[r] -= 1\n }\n ans := mem[0]\n for i := 1; i < t + 1; i++ {\n mem[i] += mem[i - 1]\n if ans < mem[i] {\n ans = mem[i]\n }\n }\n fmt.Println(ans)\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nThe Maximum Number of Customers\n\n$N$ persons visited a restaurant. The restaurant is open from 0 to $T$. The $i$-th person entered the restaurant at $l_i$ and left at $r_i$. Find the maximum number of persons during the business hours.\n\nConstraints\n\n$ 1 \\leq N \\leq 10^5 $\n\n$ 1 \\leq T \\leq 10^5 $\n\n$ 0 \\leq l_i < r_i \\leq T $\n\nInput\n\nThe input is given in the following format.\n\n$N$ $T$\n\n$l_1$ $r_1$\n\n$l_2$ $r_2$\n\n:\n\n$l_N$ $r_N$\n\nOutput\n\nPrint the maximum number of persons in a line.\n\nSample Input 1\n\n6 10\n0 2\n1 3\n2 6\n3 8\n4 10\n5 10\n\nSample Output 1\n\n4\n\nSample Input 2\n\n2 2\n0 1\n1 2\n\nSample Output 2\n\n1", "sample_input": "6 10\n0 2\n1 3\n2 6\n3 8\n4 10\n5 10\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02359", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nThe Maximum Number of Customers\n\n$N$ persons visited a restaurant. The restaurant is open from 0 to $T$. The $i$-th person entered the restaurant at $l_i$ and left at $r_i$. Find the maximum number of persons during the business hours.\n\nConstraints\n\n$ 1 \\leq N \\leq 10^5 $\n\n$ 1 \\leq T \\leq 10^5 $\n\n$ 0 \\leq l_i < r_i \\leq T $\n\nInput\n\nThe input is given in the following format.\n\n$N$ $T$\n\n$l_1$ $r_1$\n\n$l_2$ $r_2$\n\n:\n\n$l_N$ $r_N$\n\nOutput\n\nPrint the maximum number of persons in a line.\n\nSample Input 1\n\n6 10\n0 2\n1 3\n2 6\n3 8\n4 10\n5 10\n\nSample Output 1\n\n4\n\nSample Input 2\n\n2 2\n0 1\n1 2\n\nSample Output 2\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 441, "cpu_time_ms": 770, "memory_kb": 6760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s533452457", "group_id": "codeNet:p02371", "input_text": "package main\n\n// http://www.prefield.com/algorithm/graph/tree_diameter.html\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar infty = 1000000000\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\ntype DirectedGraphNodeID int\n\nfunc newDirectedGraph(nNodes int) *DirectedGraph {\n\tgraph := DirectedGraph{}\n\n\tgraph.nodes = make([]*DirectedGraphNode, nNodes)\n\tfor iNode := 0; iNode < nNodes; iNode++ {\n\t\tgraph.nodes[iNode] = &DirectedGraphNode{\n\t\t\tkey: DirectedGraphNodeID(iNode),\n\t\t\tadjacents: map[DirectedGraphNodeID]*DirectedGraphNode{},\n\t\t\tcosts: map[DirectedGraphNodeID]int{},\n\t\t\td: infty,\n\t\t}\n\t}\n\n\treturn &graph\n}\n\ntype DirectedGraph struct {\n\tnodes []*DirectedGraphNode\n\ttime int\n}\n\nfunc (graph *DirectedGraph) sedAdjacent(leftID, rightID DirectedGraphNodeID, weight int) {\n\tgraph.nodes[leftID].adjacents[rightID] = graph.nodes[rightID]\n\tgraph.nodes[leftID].costs[rightID] = weight\n}\n\ntype DirectedGraphNode struct {\n\tkey DirectedGraphNodeID\n\tadjacents map[DirectedGraphNodeID]*DirectedGraphNode\n\tcosts map[DirectedGraphNodeID]int\n\n\tparent *DirectedGraphNode\n\td, f int\n\tvisitied bool\n\tdistance int\n}\n\nfunc dfsVisit(graph *DirectedGraph, startNode *DirectedGraphNode) {\n\tgraph.time++\n\tstartNode.d = graph.time\n\tstartNode.visitied = true\n\n\tfor adjacentID, adjacent := range startNode.adjacents {\n\t\tif !adjacent.visitied {\n\t\t\tadjacent.parent = startNode\n\t\t\tadjacent.distance = startNode.distance + startNode.costs[adjacentID]\n\t\t\tdfsVisit(graph, adjacent)\n\t\t}\n\t}\n\tgraph.time++\n\tstartNode.f = graph.time\n}\n\nfunc fillDistances(graph *DirectedGraph, startNode *DirectedGraphNode) {\n\tfor _, node := range graph.nodes {\n\t\tnode.visitied = false\n\t\tnode.parent = nil\n\t\tnode.distance = infty\n\t}\n\tgraph.time = 0\n\tstartNode.distance = 0\n\tdfsVisit(graph, startNode)\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(nextString())\n\tif err != nil {\n\t\tfmt.Printf(\"strconv.Atoi failed: %v\\n\", err)\n\t}\n\treturn n\n}\n\nfunc getFarthestNode(graph *DirectedGraph) *DirectedGraphNode {\n\tmaxDistance := 0\n\tvar nodeMaxDistance *DirectedGraphNode\n\tfor _, node := range graph.nodes {\n\t\tif node.distance >= maxDistance {\n\t\t\tmaxDistance = node.distance\n\t\t\tnodeMaxDistance = node\n\t\t}\n\t}\n\treturn nodeMaxDistance\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tnNodes := nextInt()\n\tgraph := newDirectedGraph(nNodes)\n\tfor iNode := 0; iNode < nNodes-1; iNode++ {\n\t\tparent := DirectedGraphNodeID(nextInt())\n\t\tchild := DirectedGraphNodeID(nextInt())\n\t\tweight := nextInt()\n\t\tgraph.sedAdjacent(parent, child, weight)\n\t\tgraph.sedAdjacent(child, parent, weight)\n\t}\n\n\tfillDistances(graph, graph.nodes[0])\n\tnodeMaxDistance := getFarthestNode(graph)\n\t// fmt.Println(nodeMaxDistance)\n\n\tfillDistances(graph, nodeMaxDistance)\n\tnodeMaxDistance = getFarthestNode(graph)\n\tfmt.Println(nodeMaxDistance.distance)\n}\n\n", "language": "Go", "metadata": {"date": 1588159628, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02371.html", "problem_id": "p02371", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02371/input.txt", "sample_output_relpath": "derived/input_output/data/p02371/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02371/Go/s533452457.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s533452457", "user_id": "u676220309"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\n// http://www.prefield.com/algorithm/graph/tree_diameter.html\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar infty = 1000000000\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\ntype DirectedGraphNodeID int\n\nfunc newDirectedGraph(nNodes int) *DirectedGraph {\n\tgraph := DirectedGraph{}\n\n\tgraph.nodes = make([]*DirectedGraphNode, nNodes)\n\tfor iNode := 0; iNode < nNodes; iNode++ {\n\t\tgraph.nodes[iNode] = &DirectedGraphNode{\n\t\t\tkey: DirectedGraphNodeID(iNode),\n\t\t\tadjacents: map[DirectedGraphNodeID]*DirectedGraphNode{},\n\t\t\tcosts: map[DirectedGraphNodeID]int{},\n\t\t\td: infty,\n\t\t}\n\t}\n\n\treturn &graph\n}\n\ntype DirectedGraph struct {\n\tnodes []*DirectedGraphNode\n\ttime int\n}\n\nfunc (graph *DirectedGraph) sedAdjacent(leftID, rightID DirectedGraphNodeID, weight int) {\n\tgraph.nodes[leftID].adjacents[rightID] = graph.nodes[rightID]\n\tgraph.nodes[leftID].costs[rightID] = weight\n}\n\ntype DirectedGraphNode struct {\n\tkey DirectedGraphNodeID\n\tadjacents map[DirectedGraphNodeID]*DirectedGraphNode\n\tcosts map[DirectedGraphNodeID]int\n\n\tparent *DirectedGraphNode\n\td, f int\n\tvisitied bool\n\tdistance int\n}\n\nfunc dfsVisit(graph *DirectedGraph, startNode *DirectedGraphNode) {\n\tgraph.time++\n\tstartNode.d = graph.time\n\tstartNode.visitied = true\n\n\tfor adjacentID, adjacent := range startNode.adjacents {\n\t\tif !adjacent.visitied {\n\t\t\tadjacent.parent = startNode\n\t\t\tadjacent.distance = startNode.distance + startNode.costs[adjacentID]\n\t\t\tdfsVisit(graph, adjacent)\n\t\t}\n\t}\n\tgraph.time++\n\tstartNode.f = graph.time\n}\n\nfunc fillDistances(graph *DirectedGraph, startNode *DirectedGraphNode) {\n\tfor _, node := range graph.nodes {\n\t\tnode.visitied = false\n\t\tnode.parent = nil\n\t\tnode.distance = infty\n\t}\n\tgraph.time = 0\n\tstartNode.distance = 0\n\tdfsVisit(graph, startNode)\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(nextString())\n\tif err != nil {\n\t\tfmt.Printf(\"strconv.Atoi failed: %v\\n\", err)\n\t}\n\treturn n\n}\n\nfunc getFarthestNode(graph *DirectedGraph) *DirectedGraphNode {\n\tmaxDistance := 0\n\tvar nodeMaxDistance *DirectedGraphNode\n\tfor _, node := range graph.nodes {\n\t\tif node.distance >= maxDistance {\n\t\t\tmaxDistance = node.distance\n\t\t\tnodeMaxDistance = node\n\t\t}\n\t}\n\treturn nodeMaxDistance\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tnNodes := nextInt()\n\tgraph := newDirectedGraph(nNodes)\n\tfor iNode := 0; iNode < nNodes-1; iNode++ {\n\t\tparent := DirectedGraphNodeID(nextInt())\n\t\tchild := DirectedGraphNodeID(nextInt())\n\t\tweight := nextInt()\n\t\tgraph.sedAdjacent(parent, child, weight)\n\t\tgraph.sedAdjacent(child, parent, weight)\n\t}\n\n\tfillDistances(graph, graph.nodes[0])\n\tnodeMaxDistance := getFarthestNode(graph)\n\t// fmt.Println(nodeMaxDistance)\n\n\tfillDistances(graph, nodeMaxDistance)\n\tnodeMaxDistance = getFarthestNode(graph)\n\tfmt.Println(nodeMaxDistance.distance)\n}\n\n", "problem_context": "Diameter of a Tree\n\nGiven a tree T with non-negative weight, find the diameter of the tree.\n\nThe diameter of a tree is the maximum distance between two nodes in a tree.\n\nInput\n\nn\ns1 t1 w1\ns2 t2 w2\n:\nsn-1 tn-1 wn-1\n\nThe first line consists of an integer n which represents the number of nodes in the tree. Every node has a unique ID from 0 to n-1 respectively.\n\nIn the following n-1 lines, edges of the tree are given.\n\nsi and ti represent end-points of the i-th edge (undirected) and wi represents the weight (distance) of the i-th edge.\n\nOutput\n\nPrint the diameter of the tree in a line.\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n0 ≤ wi ≤ 1,000\n\nSample Input 1\n\n4\n0 1 2\n1 2 1\n1 3 3\n\nSample Output 1\n\n5\n\nSample Input 2\n\n4\n0 1 1\n1 2 2\n2 3 4\n\nSample Output 2\n\n7", "sample_input": "4\n0 1 2\n1 2 1\n1 3 3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02371", "source_text": "Diameter of a Tree\n\nGiven a tree T with non-negative weight, find the diameter of the tree.\n\nThe diameter of a tree is the maximum distance between two nodes in a tree.\n\nInput\n\nn\ns1 t1 w1\ns2 t2 w2\n:\nsn-1 tn-1 wn-1\n\nThe first line consists of an integer n which represents the number of nodes in the tree. Every node has a unique ID from 0 to n-1 respectively.\n\nIn the following n-1 lines, edges of the tree are given.\n\nsi and ti represent end-points of the i-th edge (undirected) and wi represents the weight (distance) of the i-th edge.\n\nOutput\n\nPrint the diameter of the tree in a line.\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n0 ≤ wi ≤ 1,000\n\nSample Input 1\n\n4\n0 1 2\n1 2 1\n1 3 3\n\nSample Output 1\n\n5\n\nSample Input 2\n\n4\n0 1 1\n1 2 2\n2 3 4\n\nSample Output 2\n\n7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2858, "cpu_time_ms": 330, "memory_kb": 101512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s461502619", "group_id": "codeNet:p02402", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar min float64 = 9999999999\n\tvar max float64 = -9999999999\n\tvar total float64 = 0\n\tfor i := 0; i < n; i++ {\n\t\tvar a float64\n\t\tfmt.Scan(&a)\n\t\tmax = math.Max(max, a)\n\t\tmin = math.Min(min, a)\n\t\ttotal += a\n\t}\n\n\tfmt.Println(int(min), int(max), int(total))\n\n}\n\n", "language": "Go", "metadata": {"date": 1524215986, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02402.html", "problem_id": "p02402", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02402/input.txt", "sample_output_relpath": "derived/input_output/data/p02402/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02402/Go/s461502619.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s461502619", "user_id": "u119127920"}, "prompt_components": {"gold_output": "1 17 37\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar min float64 = 9999999999\n\tvar max float64 = -9999999999\n\tvar total float64 = 0\n\tfor i := 0; i < n; i++ {\n\t\tvar a float64\n\t\tfmt.Scan(&a)\n\t\tmax = math.Max(max, a)\n\t\tmin = math.Min(min, a)\n\t\ttotal += a\n\t}\n\n\tfmt.Println(int(min), int(max), int(total))\n\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMin, Max and Sum\n\nWrite a program which reads a sequence of $n$ integers $a_i (i = 1, 2, ... n)$, and prints the minimum value, maximum value and sum of the sequence.\n\nInput\n\nIn the first line, an integer $n$ is given. In the next line, $n$ integers $a_i$ are given in a line.\n\nOutput\n\nPrint the minimum value, maximum value and sum in a line. Put a single space between the values.\n\nConstraints\n\n$0 < n \\leq 10000$\n\n$-1000000 \\leq a_i \\leq 1000000$\n\nSample Input\n\n5\n10 1 5 4 17\n\nSample Output\n\n1 17 37", "sample_input": "5\n10 1 5 4 17\n"}, "reference_outputs": ["1 17 37\n"], "source_document_id": "p02402", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMin, Max and Sum\n\nWrite a program which reads a sequence of $n$ integers $a_i (i = 1, 2, ... n)$, and prints the minimum value, maximum value and sum of the sequence.\n\nInput\n\nIn the first line, an integer $n$ is given. In the next line, $n$ integers $a_i$ are given in a line.\n\nOutput\n\nPrint the minimum value, maximum value and sum in a line. Put a single space between the values.\n\nConstraints\n\n$0 < n \\leq 10000$\n\n$-1000000 \\leq a_i \\leq 1000000$\n\nSample Input\n\n5\n10 1 5 4 17\n\nSample Output\n\n1 17 37", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 338, "cpu_time_ms": 40, "memory_kb": 1784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s841718240", "group_id": "codeNet:p02403", "input_text": "package main\n\nimport(\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n //fmt.Print(\"Input :\")\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n var h int\n var w int\n\n for {\n if sc.Scan() { h, _ = strconv.Atoi(sc.Text()) }\n if sc.Scan() { w, _ = strconv.Atoi(sc.Text()) }\n\n if h == 0 && w == 0 { break }\n for i := 0; i < h; i++ {\n for j := 0; j < w; j++ {\n fmt.Print(\"#\")\n }\n fmt.Println()\n }\n fmt.Println()\n }\n}\n\n", "language": "Go", "metadata": {"date": 1588715498, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02403.html", "problem_id": "p02403", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02403/input.txt", "sample_output_relpath": "derived/input_output/data/p02403/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02403/Go/s841718240.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s841718240", "user_id": "u951435175"}, "prompt_components": {"gold_output": "####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n //fmt.Print(\"Input :\")\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n var h int\n var w int\n\n for {\n if sc.Scan() { h, _ = strconv.Atoi(sc.Text()) }\n if sc.Scan() { w, _ = strconv.Atoi(sc.Text()) }\n\n if h == 0 && w == 0 { break }\n for i := 0; i < h; i++ {\n for j := 0; j < w; j++ {\n fmt.Print(\"#\")\n }\n fmt.Println()\n }\n fmt.Println()\n }\n}\n\n", "problem_context": "Print a Rectangle\n\nDraw a rectangle which has a height of H cm and a width of W cm. Draw a 1-cm square by single '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the rectangle made of H × W '#'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n2 2\n0 0\n\nSample Output\n\n####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##", "sample_input": "3 4\n5 6\n2 2\n0 0\n"}, "reference_outputs": ["####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##\n"], "source_document_id": "p02403", "source_text": "Print a Rectangle\n\nDraw a rectangle which has a height of H cm and a width of W cm. Draw a 1-cm square by single '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the rectangle made of H × W '#'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n2 2\n0 0\n\nSample Output\n\n####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 479, "cpu_time_ms": 100, "memory_kb": 1096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s391524821", "group_id": "codeNet:p02405", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w, h int\n\n\tfor {\n\t\tfmt.Scan(&h, &w)\n\n\t\tif w == 0 && h == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor i := 0; i < h; i++ {\n\t\t\tfor j := 0; j < w; j++ {\n\t\t\t\tif (i+j)%2 == 0 {\n\t\t\t\t\tfmt.Print(\"#\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(\".\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1557144038, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02405.html", "problem_id": "p02405", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02405/input.txt", "sample_output_relpath": "derived/input_output/data/p02405/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02405/Go/s391524821.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s391524821", "user_id": "u990117429"}, "prompt_components": {"gold_output": "#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w, h int\n\n\tfor {\n\t\tfmt.Scan(&h, &w)\n\n\t\tif w == 0 && h == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor i := 0; i < h; i++ {\n\t\t\tfor j := 0; j < w; j++ {\n\t\t\t\tif (i+j)%2 == 0 {\n\t\t\t\t\tfmt.Print(\"#\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(\".\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n\n", "problem_context": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "sample_input": "3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n"}, "reference_outputs": ["#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n"], "source_document_id": "p02405", "source_text": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 311, "cpu_time_ms": 90, "memory_kb": 1156}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s254779866", "group_id": "codeNet:p02414", "input_text": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n m := nextInt()\n l := nextInt()\n vector1 := make([][]int, n)\n for i := 0; i < n; i++ {\n vector1[i] = make([]int, m)\n for j := 0; j < m; j++ {\n vector1[i][j] = nextInt()\n\t}\n }\n\n vector2 := make([][]int, m)\n for i := 0; i < m; i++ {\n vector2[i] = make([]int, l)\n for j := 0; j < l; j++ {\n vector2[i][j] = nextInt()\n\t}\n }\n\n for i := 0; i < n; i++ {\n for r := 0; r < l; r++ {\n\t\tsum := 0\n for q := 0; q < m; q++ {\n\t\t\t sum = sum +vector1[i][q] * vector2[q][r]\n }\n fmt.Print(sum)\n\t\tif r != l - 1{\n fmt.Print(\" \")\n\t }\n }\n fmt.Println()\n }\n\n}\n\nfunc getStdin() (string) {\n\tsc.Scan()\n\tv := sc.Text()\n\treturn v\n}\n\nfunc nextInt() (int) {\n\tsc.Scan()\n\tv, e := strconv.Atoi(sc.Text())\n if e != nil { panic(e) }\n return v\n}\n\nfunc nextFloat() (float64) {\n\tsc.Scan()\n\tv, e := strconv.ParseFloat(sc.Text(), 64)\n if e != nil { panic(e) }\n return v\n}\n\n", "language": "Go", "metadata": {"date": 1584276196, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02414.html", "problem_id": "p02414", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02414/input.txt", "sample_output_relpath": "derived/input_output/data/p02414/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02414/Go/s254779866.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s254779866", "user_id": "u300068986"}, "prompt_components": {"gold_output": "1 8 5\n0 9 6\n4 23 14\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n m := nextInt()\n l := nextInt()\n vector1 := make([][]int, n)\n for i := 0; i < n; i++ {\n vector1[i] = make([]int, m)\n for j := 0; j < m; j++ {\n vector1[i][j] = nextInt()\n\t}\n }\n\n vector2 := make([][]int, m)\n for i := 0; i < m; i++ {\n vector2[i] = make([]int, l)\n for j := 0; j < l; j++ {\n vector2[i][j] = nextInt()\n\t}\n }\n\n for i := 0; i < n; i++ {\n for r := 0; r < l; r++ {\n\t\tsum := 0\n for q := 0; q < m; q++ {\n\t\t\t sum = sum +vector1[i][q] * vector2[q][r]\n }\n fmt.Print(sum)\n\t\tif r != l - 1{\n fmt.Print(\" \")\n\t }\n }\n fmt.Println()\n }\n\n}\n\nfunc getStdin() (string) {\n\tsc.Scan()\n\tv := sc.Text()\n\treturn v\n}\n\nfunc nextInt() (int) {\n\tsc.Scan()\n\tv, e := strconv.Atoi(sc.Text())\n if e != nil { panic(e) }\n return v\n}\n\nfunc nextFloat() (float64) {\n\tsc.Scan()\n\tv, e := strconv.ParseFloat(sc.Text(), 64)\n if e != nil { panic(e) }\n return v\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMatrix Multiplication\n\nWrite a program which reads a $n \\times m$ matrix $A$ and a $m \\times l$ matrix $B$, and prints their product, a $n \\times l$ matrix $C$. An element of matrix $C$ is obtained by the following formula:\n\n\\[\nc_{ij} = \\sum_{k=1}^m a_{ik}b_{kj}\n\\]\n\nwhere $a_{ij}$, $b_{ij}$ and $c_{ij}$ are elements of $A$, $B$ and $C$ respectively.\n\nInput\n\nIn the first line, three integers $n$, $m$ and $l$ are given separated by space characters\n\nIn the following lines, the $n \\times m$ matrix $A$ and the $m \\times l$ matrix $B$ are given.\n\nOutput\n\nPrint elements of the $n \\times l$ matrix $C$ ($c_{ij}$). Print a single space character between adjacent elements.\n\nConstraints\n\n$1 \\leq n, m, l \\leq 100$\n\n$0 \\leq a_{ij}, b_{ij} \\leq 10000$\n\nSample Input\n\n3 2 3\n1 2\n0 3\n4 5\n1 2 1\n0 3 2\n\nSample Output\n\n1 8 5\n0 9 6\n4 23 14\n\nNote\n\n      解説", "sample_input": "3 2 3\n1 2\n0 3\n4 5\n1 2 1\n0 3 2\n"}, "reference_outputs": ["1 8 5\n0 9 6\n4 23 14\n"], "source_document_id": "p02414", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMatrix Multiplication\n\nWrite a program which reads a $n \\times m$ matrix $A$ and a $m \\times l$ matrix $B$, and prints their product, a $n \\times l$ matrix $C$. An element of matrix $C$ is obtained by the following formula:\n\n\\[\nc_{ij} = \\sum_{k=1}^m a_{ik}b_{kj}\n\\]\n\nwhere $a_{ij}$, $b_{ij}$ and $c_{ij}$ are elements of $A$, $B$ and $C$ respectively.\n\nInput\n\nIn the first line, three integers $n$, $m$ and $l$ are given separated by space characters\n\nIn the following lines, the $n \\times m$ matrix $A$ and the $m \\times l$ matrix $B$ are given.\n\nOutput\n\nPrint elements of the $n \\times l$ matrix $C$ ($c_{ij}$). Print a single space character between adjacent elements.\n\nConstraints\n\n$1 \\leq n, m, l \\leq 100$\n\n$0 \\leq a_{ij}, b_{ij} \\leq 10000$\n\nSample Input\n\n3 2 3\n1 2\n0 3\n4 5\n1 2 1\n0 3 2\n\nSample Output\n\n1 8 5\n0 9 6\n4 23 14\n\nNote\n\n      解説", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1084, "cpu_time_ms": 50, "memory_kb": 1492}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s024304358", "group_id": "codeNet:p02432", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"container/list\"\n\t\"fmt\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tscanner.Scan()\n\ti, e := strconv.Atoi(scanner.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tpointer_list := make([]*list.Element, 0)\n\tdequeue := list.New()\n\tq := nextInt()\n\n\tfor i := 0; i < q; i++ {\n\t\tswitch nextInt() {\n\t\tcase 0:\n\t\t\tswitch nextInt() {\n\t\t\tcase 0:\n\t\t\t\t// 先頭に挿入\n\t\t\t\tx := nextInt()\n\t\t\t\tif len(pointer_list) == 0 {\n\t\t\t\t\tpointer_list = append(pointer_list, dequeue.PushFront(x))\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tpointer_list = append(pointer_list[:1], pointer_list[0:]...)\n\t\t\t\tpointer_list[0] = dequeue.PushFront(x)\n\t\t\t\t// for tmp := dequeue.Front(); tmp != nil; tmp = tmp.Next() {\n\t\t\t\t// \tfmt.Printf(\"%+v\\n\", tmp.Value)\n\t\t\t\t// }\n\t\t\tcase 1:\n\t\t\t\t// 末尾に挿入\n\t\t\t\tx := nextInt()\n\t\t\t\tpointer_list = append(pointer_list, dequeue.PushBack(x))\n\t\t\t\t// for tmp := dequeue.Front(); tmp != nil; tmp = tmp.Next() {\n\t\t\t\t// \tfmt.Printf(\"%+v\\n\", tmp.Value)\n\t\t\t\t// }\n\t\t\t}\n\t\tcase 1:\n\t\t\tp := nextInt()\n\t\t\tfmt.Println(pointer_list[p].Value)\n\t\tcase 2:\n\t\t\tswitch nextInt() {\n\t\t\tcase 0:\n\t\t\t\t// 先頭を削除\n\t\t\t\tdequeue.Remove(dequeue.Front())\n\t\t\t\tpointer_list = pointer_list[1:]\n\t\t\tcase 1:\n\t\t\t\t// 末尾を削除\n\t\t\t\tdequeue.Remove(dequeue.Back())\n\t\t\t\tpointer_list = pointer_list[:len(pointer_list)-1]\n\t\t\t}\n\t\tdefault:\n\t\t\tprintln(\"no such operation!\")\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1529309734, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02432.html", "problem_id": "p02432", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02432/input.txt", "sample_output_relpath": "derived/input_output/data/p02432/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02432/Go/s024304358.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s024304358", "user_id": "u495592458"}, "prompt_components": {"gold_output": "2\n1\n3\n4\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"container/list\"\n\t\"fmt\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tscanner.Scan()\n\ti, e := strconv.Atoi(scanner.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tpointer_list := make([]*list.Element, 0)\n\tdequeue := list.New()\n\tq := nextInt()\n\n\tfor i := 0; i < q; i++ {\n\t\tswitch nextInt() {\n\t\tcase 0:\n\t\t\tswitch nextInt() {\n\t\t\tcase 0:\n\t\t\t\t// 先頭に挿入\n\t\t\t\tx := nextInt()\n\t\t\t\tif len(pointer_list) == 0 {\n\t\t\t\t\tpointer_list = append(pointer_list, dequeue.PushFront(x))\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tpointer_list = append(pointer_list[:1], pointer_list[0:]...)\n\t\t\t\tpointer_list[0] = dequeue.PushFront(x)\n\t\t\t\t// for tmp := dequeue.Front(); tmp != nil; tmp = tmp.Next() {\n\t\t\t\t// \tfmt.Printf(\"%+v\\n\", tmp.Value)\n\t\t\t\t// }\n\t\t\tcase 1:\n\t\t\t\t// 末尾に挿入\n\t\t\t\tx := nextInt()\n\t\t\t\tpointer_list = append(pointer_list, dequeue.PushBack(x))\n\t\t\t\t// for tmp := dequeue.Front(); tmp != nil; tmp = tmp.Next() {\n\t\t\t\t// \tfmt.Printf(\"%+v\\n\", tmp.Value)\n\t\t\t\t// }\n\t\t\t}\n\t\tcase 1:\n\t\t\tp := nextInt()\n\t\t\tfmt.Println(pointer_list[p].Value)\n\t\tcase 2:\n\t\t\tswitch nextInt() {\n\t\t\tcase 0:\n\t\t\t\t// 先頭を削除\n\t\t\t\tdequeue.Remove(dequeue.Front())\n\t\t\t\tpointer_list = pointer_list[1:]\n\t\t\tcase 1:\n\t\t\t\t// 末尾を削除\n\t\t\t\tdequeue.Remove(dequeue.Back())\n\t\t\t\tpointer_list = pointer_list[:len(pointer_list)-1]\n\t\t\t}\n\t\tdefault:\n\t\t\tprintln(\"no such operation!\")\n\t\t}\n\t}\n}\n\n", "problem_context": "Deque\n\nFor a dynamic array $A = \\{a_0, a_1, ...\\}$ of integers, perform a sequence of the following operations:\n\npush($d$, $x$): Add element $x$ at the begining of $A$, if $d = 0$. Add element $x$ at the end of $A$, if $d = 1$.\n\nrandomAccess($p$): Print element $a_p$.\n\npop($d$): Delete the first element of $A$, if $d = 0$. Delete the last element of $A$, if $d = 1$.\n\n$A$ is a 0-origin array and it is empty in the initial state.\n\nInput\n\nThe input is given in the following format.\n\n$q$\n$query_1$\n$query_2$\n:\n$query_q$\n\nEach query $query_i$ is given by\n\n0 $d$ $x$\n\nor\n\n1 $p$\n\nor\n\n2 $d$\n\nwhere the first digits 0, 1 and 2 represent push, randomAccess and pop operations respectively.\n\nrandomAccess and pop operations will not be given for an empty array.\n\nOutput\n\nFor each randomAccess, print $a_p$ in a line.\n\nConstraints\n\n$1 \\leq q \\leq 400,000$\n\n$0 \\leq p < $ the size of $A$\n\n$-1,000,000,000 \\leq x \\leq 1,000,000,000$\n\nSample Input 1\n\n11\n0 0 1\n0 0 2\n0 1 3\n1 0\n1 1\n1 2\n2 0\n2 1\n0 0 4\n1 0\n1 1\n\nSample Output 1\n\n2\n1\n3\n4\n1", "sample_input": "11\n0 0 1\n0 0 2\n0 1 3\n1 0\n1 1\n1 2\n2 0\n2 1\n0 0 4\n1 0\n1 1\n"}, "reference_outputs": ["2\n1\n3\n4\n1\n"], "source_document_id": "p02432", "source_text": "Deque\n\nFor a dynamic array $A = \\{a_0, a_1, ...\\}$ of integers, perform a sequence of the following operations:\n\npush($d$, $x$): Add element $x$ at the begining of $A$, if $d = 0$. Add element $x$ at the end of $A$, if $d = 1$.\n\nrandomAccess($p$): Print element $a_p$.\n\npop($d$): Delete the first element of $A$, if $d = 0$. Delete the last element of $A$, if $d = 1$.\n\n$A$ is a 0-origin array and it is empty in the initial state.\n\nInput\n\nThe input is given in the following format.\n\n$q$\n$query_1$\n$query_2$\n:\n$query_q$\n\nEach query $query_i$ is given by\n\n0 $d$ $x$\n\nor\n\n1 $p$\n\nor\n\n2 $d$\n\nwhere the first digits 0, 1 and 2 represent push, randomAccess and pop operations respectively.\n\nrandomAccess and pop operations will not be given for an empty array.\n\nOutput\n\nFor each randomAccess, print $a_p$ in a line.\n\nConstraints\n\n$1 \\leq q \\leq 400,000$\n\n$0 \\leq p < $ the size of $A$\n\n$-1,000,000,000 \\leq x \\leq 1,000,000,000$\n\nSample Input 1\n\n11\n0 0 1\n0 0 2\n0 1 3\n1 0\n1 1\n1 2\n2 0\n2 1\n0 0 4\n1 0\n1 1\n\nSample Output 1\n\n2\n1\n3\n4\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1453, "cpu_time_ms": 2590, "memory_kb": 14276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s106299897", "group_id": "codeNet:p02434", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"os\"\n\t\"io\"\n\t\"bufio\"\n\t\"bytes\"\n\n\t\"strings\"\n\t\"strconv\"\n)\n\n// 長い入力を読む\nfunc ReadLongLines(times int) ([]string, error) {\n\tresult := make([]string, times)\n\treader := bufio.NewReader(os.Stdin)\n\tbuffer := bytes.NewBuffer(make([]byte, 0))\n\treadBytes := int64(2)\n\tfor i := 0; i < times; i++ {\n\t\tfor {\n\t\t\treadBuf, isPrefix, err := reader.ReadLine()\n\t\t\t// fmt.Printf(\"Reader.Read: %d\\n\", len(readBuf))\n\t\t\treadBytes += int64(len(readBuf) + 1)\n\t\t\tif err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tfmt.Println(\"EOF\")\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\treturn result, err\n\t\t\t\t}\n\t\t\t}\n\t\t\t_, err = buffer.Write(readBuf)\n\t\t\tif err != nil {\n\t\t\t\treturn result, err\n\t\t\t}\n\t\t\t// end of line\n\t\t\tif !isPrefix {\n\t\t\t\tresult[i] = buffer.String()\n\t\t\t\tbuffer.Reset()\n\t\t\t\t// reader = bufio.NewReader(os.Stdin)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t// 先読みしてしまうようなので、戻しておく\n\tos.Stdin.Seek(-int64(reader.Buffered()), os.SEEK_CUR)\n\treturn result, nil\n}\n\n\n// go だと固定長配列とか辛いので無理だった\ntype Vector struct {\n\tarr [] int\n\tback int\n}\nfunc NewVector() Vector {\n\treturn Vector{make([]int, 0, 10000), 0}\n}\nfunc (this *Vector)PushBack(i int) {\n\tif len(this.arr) - 1 < this.back {\n\t\tthis.arr = append(this.arr, i)\n\t\tthis.back++\n\t} else {\n\t\tthis.arr[this.back] = i\n\t\tthis.back++\n\t}\n}\nfunc (this *Vector)Dump() {\n\tfor i := 0; i < this.back; i++ {\n\t\tif i == 0 {\n\t\t\tfmt.Printf(\"%d\", this.arr[i])\n\t\t} else {\n\t\t\tfmt.Printf(\" %d\", this.arr[i])\n\t\t}\n\t}\n\tfmt.Println()\n}\nfunc (this *Vector) Clear() {\n\tthis.back = 0\n}\n\n\n\n\nfunc main() {\n\tvar n int\n\tvar q int\n\n\tfmt.Scanf(\"%d %d\", &n, &q)\n\t// 構造体の初期化が走るの嫌だな\n\tvectors := make([]Vector, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvectors[i] = NewVector()\n\t}\n\tlines, _ := ReadLongLines(q)\n\tfor _, line := range lines {\n\t\targs := strings.Split(line, \" \")\n\t\tcmd := args[0]\n\t\tswitch cmd {\n\t\tcase \"0\":\n\t\t\tt, _ := strconv.Atoi(args[1])\n\t\t\tx, _ := strconv.Atoi(args[2])\n\t\t\tvectors[t].PushBack(x)\n\t\tcase \"1\":\n\t\t\tt, _ := strconv.Atoi(args[1])\n\t\t\tvectors[t].Dump()\n\t\tcase \"2\":\n\t\t\tt, _ := strconv.Atoi(args[1])\n\t\t\tvectors[t].Clear()\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1580695432, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02434.html", "problem_id": "p02434", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02434/input.txt", "sample_output_relpath": "derived/input_output/data/p02434/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02434/Go/s106299897.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s106299897", "user_id": "u296792720"}, "prompt_components": {"gold_output": "1 2 3\n-1\n4 5\n1 2 3\n\n4 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"os\"\n\t\"io\"\n\t\"bufio\"\n\t\"bytes\"\n\n\t\"strings\"\n\t\"strconv\"\n)\n\n// 長い入力を読む\nfunc ReadLongLines(times int) ([]string, error) {\n\tresult := make([]string, times)\n\treader := bufio.NewReader(os.Stdin)\n\tbuffer := bytes.NewBuffer(make([]byte, 0))\n\treadBytes := int64(2)\n\tfor i := 0; i < times; i++ {\n\t\tfor {\n\t\t\treadBuf, isPrefix, err := reader.ReadLine()\n\t\t\t// fmt.Printf(\"Reader.Read: %d\\n\", len(readBuf))\n\t\t\treadBytes += int64(len(readBuf) + 1)\n\t\t\tif err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tfmt.Println(\"EOF\")\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\treturn result, err\n\t\t\t\t}\n\t\t\t}\n\t\t\t_, err = buffer.Write(readBuf)\n\t\t\tif err != nil {\n\t\t\t\treturn result, err\n\t\t\t}\n\t\t\t// end of line\n\t\t\tif !isPrefix {\n\t\t\t\tresult[i] = buffer.String()\n\t\t\t\tbuffer.Reset()\n\t\t\t\t// reader = bufio.NewReader(os.Stdin)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t// 先読みしてしまうようなので、戻しておく\n\tos.Stdin.Seek(-int64(reader.Buffered()), os.SEEK_CUR)\n\treturn result, nil\n}\n\n\n// go だと固定長配列とか辛いので無理だった\ntype Vector struct {\n\tarr [] int\n\tback int\n}\nfunc NewVector() Vector {\n\treturn Vector{make([]int, 0, 10000), 0}\n}\nfunc (this *Vector)PushBack(i int) {\n\tif len(this.arr) - 1 < this.back {\n\t\tthis.arr = append(this.arr, i)\n\t\tthis.back++\n\t} else {\n\t\tthis.arr[this.back] = i\n\t\tthis.back++\n\t}\n}\nfunc (this *Vector)Dump() {\n\tfor i := 0; i < this.back; i++ {\n\t\tif i == 0 {\n\t\t\tfmt.Printf(\"%d\", this.arr[i])\n\t\t} else {\n\t\t\tfmt.Printf(\" %d\", this.arr[i])\n\t\t}\n\t}\n\tfmt.Println()\n}\nfunc (this *Vector) Clear() {\n\tthis.back = 0\n}\n\n\n\n\nfunc main() {\n\tvar n int\n\tvar q int\n\n\tfmt.Scanf(\"%d %d\", &n, &q)\n\t// 構造体の初期化が走るの嫌だな\n\tvectors := make([]Vector, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvectors[i] = NewVector()\n\t}\n\tlines, _ := ReadLongLines(q)\n\tfor _, line := range lines {\n\t\targs := strings.Split(line, \" \")\n\t\tcmd := args[0]\n\t\tswitch cmd {\n\t\tcase \"0\":\n\t\t\tt, _ := strconv.Atoi(args[1])\n\t\t\tx, _ := strconv.Atoi(args[2])\n\t\t\tvectors[t].PushBack(x)\n\t\tcase \"1\":\n\t\t\tt, _ := strconv.Atoi(args[1])\n\t\t\tvectors[t].Dump()\n\t\tcase \"2\":\n\t\t\tt, _ := strconv.Atoi(args[1])\n\t\t\tvectors[t].Clear()\n\t\t}\n\t}\n}\n", "problem_context": "Vector II\n\nFor $n$ dynamic arrays $A_i$ ($i = 0, 1, ..., n-1$), perform a sequence of the following operations:\n\npushBack($t$, $x$): Add element $x$ at the end of $A_t$.\n\ndump($t$): Print all elements in $A_t$.\n\nclear($t$): Clear $A_t$. If $A_t$ is empty, do nothing.\n\n$A_i$ is a 0-origin array and it is empty in the initial state.\n\nInput\n\nThe input is given in the following format.\n\n$n$ $q$\n$query_1$\n$query_2$\n:\n$query_q$\n\nEach query $query_i$ is given by\n\n0 $t$ $x$\n\nor\n\n1 $t$\n\nor\n\n2 $t$\n\nwhere the first digits 0, 1 and 2 represent pushBack, dump and clear operations respectively.\n\nOutput\n\nFor each dump operation, print elements of $A_t$ a line. Separete adjacency elements by a space character (do not print the space after the last element). Note that, if the array is empty, an empty line should be printed.\n\nConstraints\n\n$1 \\leq n \\leq 1,000$\n\n$1 \\leq q \\leq 500,000$\n\n$-1,000,000,000 \\leq x \\leq 1,000,000,000$\n\nThe total number of elements printed by dump operations do not exceed 500,000\n\nSample Input 1\n\n3 13\n0 0 1\n0 0 2\n0 0 3\n0 1 -1\n0 2 4\n0 2 5\n1 0\n1 1\n1 2\n2 1\n1 0\n1 1\n1 2\n\nSample Output 1\n\n1 2 3\n-1\n4 5\n1 2 3\n\n4 5", "sample_input": "3 13\n0 0 1\n0 0 2\n0 0 3\n0 1 -1\n0 2 4\n0 2 5\n1 0\n1 1\n1 2\n2 1\n1 0\n1 1\n1 2\n"}, "reference_outputs": ["1 2 3\n-1\n4 5\n1 2 3\n\n4 5\n"], "source_document_id": "p02434", "source_text": "Vector II\n\nFor $n$ dynamic arrays $A_i$ ($i = 0, 1, ..., n-1$), perform a sequence of the following operations:\n\npushBack($t$, $x$): Add element $x$ at the end of $A_t$.\n\ndump($t$): Print all elements in $A_t$.\n\nclear($t$): Clear $A_t$. If $A_t$ is empty, do nothing.\n\n$A_i$ is a 0-origin array and it is empty in the initial state.\n\nInput\n\nThe input is given in the following format.\n\n$n$ $q$\n$query_1$\n$query_2$\n:\n$query_q$\n\nEach query $query_i$ is given by\n\n0 $t$ $x$\n\nor\n\n1 $t$\n\nor\n\n2 $t$\n\nwhere the first digits 0, 1 and 2 represent pushBack, dump and clear operations respectively.\n\nOutput\n\nFor each dump operation, print elements of $A_t$ a line. Separete adjacency elements by a space character (do not print the space after the last element). Note that, if the array is empty, an empty line should be printed.\n\nConstraints\n\n$1 \\leq n \\leq 1,000$\n\n$1 \\leq q \\leq 500,000$\n\n$-1,000,000,000 \\leq x \\leq 1,000,000,000$\n\nThe total number of elements printed by dump operations do not exceed 500,000\n\nSample Input 1\n\n3 13\n0 0 1\n0 0 2\n0 0 3\n0 1 -1\n0 2 4\n0 2 5\n1 0\n1 1\n1 2\n2 1\n1 0\n1 1\n1 2\n\nSample Output 1\n\n1 2 3\n-1\n4 5\n1 2 3\n\n4 5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2126, "cpu_time_ms": 1090, "memory_kb": 145780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s362132698", "group_id": "codeNet:p02465", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\tset := make(map[int]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tset[nextInt(sc)]++\n\t}\n\tm := nextInt(sc)\n\tvar v int\n\tfor i := 0; i < m; i++ {\n\t\tv = nextInt(sc)\n\t\tif _, ok := set[v]; ok {\n\t\t\tset[v]++\n\t\t}\n\t}\n\tans := make([]int, 0, max(n, m))\n\tfor k, v := range set {\n\t\tif v == 1 {\n\t\t\tans = append(ans, k)\n\t\t}\n\t}\n\tsort.Ints(ans)\n\twtr := bufio.NewWriter(os.Stdout)\n\tfor _, v := range ans {\n\t\tfmt.Fprintln(wtr, v)\n\t}\n\twtr.Flush()\n}\n\n", "language": "Go", "metadata": {"date": 1584532922, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02465.html", "problem_id": "p02465", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02465/input.txt", "sample_output_relpath": "derived/input_output/data/p02465/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02465/Go/s362132698.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s362132698", "user_id": "u225669905"}, "prompt_components": {"gold_output": "1\n3\n8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\tset := make(map[int]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tset[nextInt(sc)]++\n\t}\n\tm := nextInt(sc)\n\tvar v int\n\tfor i := 0; i < m; i++ {\n\t\tv = nextInt(sc)\n\t\tif _, ok := set[v]; ok {\n\t\t\tset[v]++\n\t\t}\n\t}\n\tans := make([]int, 0, max(n, m))\n\tfor k, v := range set {\n\t\tif v == 1 {\n\t\t\tans = append(ans, k)\n\t\t}\n\t}\n\tsort.Ints(ans)\n\twtr := bufio.NewWriter(os.Stdout)\n\tfor _, v := range ans {\n\t\tfmt.Fprintln(wtr, v)\n\t}\n\twtr.Flush()\n}\n\n", "problem_context": "Set Difference\n\nFind the difference of two sets $A = \\{a_0, a_1, ..., a_{n-1}\\}$ and $B = \\{b_0, b_1, ..., b_{m-1}\\}$, $A - B$.\n\nInput\n\nThe input is given in the following format.\n\n$n$\n$a_0 \\; a_1 \\; ... \\; a_{n-1}$\n$m$\n$b_0 \\; b_1 \\; ... \\; b_{m-1}$\n\nElements in $A$ and $B$ are given in ascending order. There are no duplicate elements in each set.\n\nOutput\n\nPrint elements in the difference in ascending order. Print an element in a line.\n\nConstraints\n\n$1 \\leq n, m \\leq 200,000$\n\n$0 \\leq a_0 < a_1 < ... < a_{n-1} \\leq 10^9$\n\n$0 \\leq b_0 < b_1 < ... < b_{m-1} \\leq 10^9$\n\nSample Input 1\n\n5\n1 2 3 5 8\n2\n2 5\n\nSample Output 1\n\n1\n3\n8", "sample_input": "5\n1 2 3 5 8\n2\n2 5\n"}, "reference_outputs": ["1\n3\n8\n"], "source_document_id": "p02465", "source_text": "Set Difference\n\nFind the difference of two sets $A = \\{a_0, a_1, ..., a_{n-1}\\}$ and $B = \\{b_0, b_1, ..., b_{m-1}\\}$, $A - B$.\n\nInput\n\nThe input is given in the following format.\n\n$n$\n$a_0 \\; a_1 \\; ... \\; a_{n-1}$\n$m$\n$b_0 \\; b_1 \\; ... \\; b_{m-1}$\n\nElements in $A$ and $B$ are given in ascending order. There are no duplicate elements in each set.\n\nOutput\n\nPrint elements in the difference in ascending order. Print an element in a line.\n\nConstraints\n\n$1 \\leq n, m \\leq 200,000$\n\n$0 \\leq a_0 < a_1 < ... < a_{n-1} \\leq 10^9$\n\n$0 \\leq b_0 < b_1 < ... < b_{m-1} \\leq 10^9$\n\nSample Input 1\n\n5\n1 2 3 5 8\n2\n2 5\n\nSample Output 1\n\n1\n3\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 739, "cpu_time_ms": 240, "memory_kb": 12680}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s956628951", "group_id": "codeNet:p02540", "input_text": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main(){\n var n,tmp_x, tmp_y int\n var town_x []int\n var town_y []int\n fmt.Scanf(\"%d\", &n)\n for i:= 0 ; i < n ; i++{\n fmt.Scanf(\"%d %d\", &tmp_x, &tmp_y)\n town_x = append(town_x, tmp_x)\n town_y = append(town_y, tmp_y)\n }\n \n //初期化\n var group []int\n var cnt []int\n for m:=0; m town_x[j] && town_y[k] > town_y[j]) ||\n (town_x[k] < town_x[j] && town_y[k] < town_y[j]) )){\n group[k] = group[j] //kとjがつながってる場合にJを同じグループにする\n cnt[group[k]]++ //group j の個数を増やす\n }\n }\n }\n \n //fmt.Println(\"Group:\", group)\n //fmt.Println(\"Cnt:\", cnt)\n for l:=0 ; l< n; l++{\n \tfmt.Println(cnt[group[l]])\n }\n}", "language": "Go", "metadata": {"date": 1600670385, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02540.html", "problem_id": "p02540", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02540/input.txt", "sample_output_relpath": "derived/input_output/data/p02540/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02540/Go/s956628951.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s956628951", "user_id": "u880135584"}, "prompt_components": {"gold_output": "1\n1\n2\n2\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main(){\n var n,tmp_x, tmp_y int\n var town_x []int\n var town_y []int\n fmt.Scanf(\"%d\", &n)\n for i:= 0 ; i < n ; i++{\n fmt.Scanf(\"%d %d\", &tmp_x, &tmp_y)\n town_x = append(town_x, tmp_x)\n town_y = append(town_y, tmp_y)\n }\n \n //初期化\n var group []int\n var cnt []int\n for m:=0; m town_x[j] && town_y[k] > town_y[j]) ||\n (town_x[k] < town_x[j] && town_y[k] < town_y[j]) )){\n group[k] = group[j] //kとjがつながってる場合にJを同じグループにする\n cnt[group[k]]++ //group j の個数を増やす\n }\n }\n }\n \n //fmt.Println(\"Group:\", group)\n //fmt.Println(\"Cnt:\", cnt)\n for l:=0 ; l< n; l++{\n \tfmt.Println(cnt[group[l]])\n }\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a 2D plane. The coordinate of the i-th city is (x_i, y_i). Here (x_1, x_2, \\dots, x_N) and (y_1, y_2, \\dots, y_N) are both permuations of (1, 2, \\dots, N).\n\nFor each k = 1,2,\\dots,N, find the answer to the following question:\n\nRng is in City k.\nRng can perform the following move arbitrarily many times:\n\nmove to another city that has a smaller x-coordinate and a smaller y-coordinate, or a larger x-coordinate and a larger y-coordinate, than the city he is currently in.\n\nHow many cities (including City k) are reachable from City k?\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n(x_1, x_2, \\dots, x_N) is a permutation of (1, 2, \\dots, N).\n\n(y_1, y_2, \\dots, y_N) is a permutation of (1, 2, \\dots, N).\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n:\nx_N y_N\n\nOutput\n\nPrint N lines. In i-th line print the answer to the question when k = i.\n\nSample Input 1\n\n4\n1 4\n2 3\n3 1\n4 2\n\nSample Output 1\n\n1\n1\n2\n2\n\nRng can reach City 4 from City 3, or conversely City 3 from City 4.\n\nSample Input 2\n\n7\n6 4\n4 3\n3 5\n7 1\n2 7\n5 2\n1 6\n\nSample Output 2\n\n3\n3\n1\n1\n2\n3\n2", "sample_input": "4\n1 4\n2 3\n3 1\n4 2\n"}, "reference_outputs": ["1\n1\n2\n2\n"], "source_document_id": "p02540", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a 2D plane. The coordinate of the i-th city is (x_i, y_i). Here (x_1, x_2, \\dots, x_N) and (y_1, y_2, \\dots, y_N) are both permuations of (1, 2, \\dots, N).\n\nFor each k = 1,2,\\dots,N, find the answer to the following question:\n\nRng is in City k.\nRng can perform the following move arbitrarily many times:\n\nmove to another city that has a smaller x-coordinate and a smaller y-coordinate, or a larger x-coordinate and a larger y-coordinate, than the city he is currently in.\n\nHow many cities (including City k) are reachable from City k?\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n(x_1, x_2, \\dots, x_N) is a permutation of (1, 2, \\dots, N).\n\n(y_1, y_2, \\dots, y_N) is a permutation of (1, 2, \\dots, N).\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n:\nx_N y_N\n\nOutput\n\nPrint N lines. In i-th line print the answer to the question when k = i.\n\nSample Input 1\n\n4\n1 4\n2 3\n3 1\n4 2\n\nSample Output 1\n\n1\n1\n2\n2\n\nRng can reach City 4 from City 3, or conversely City 3 from City 4.\n\nSample Input 2\n\n7\n6 4\n4 3\n3 5\n7 1\n2 7\n5 2\n1 6\n\nSample Output 2\n\n3\n3\n1\n1\n2\n3\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1257, "cpu_time_ms": 2206, "memory_kb": 18844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s136045256", "group_id": "codeNet:p02540", "input_text": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main(){\n var n,tmp_x, tmp_y int\n var tmp_cnt int\n var town_x []int\n var town_y []int\n var cnt []int\n fmt.Scanf(\"%d\", &n)\n for i:= 0 ; i < n ; i++{\n fmt.Scanf(\"%d %d\", &tmp_x, &tmp_y)\n town_x = append(town_x, tmp_x)\n town_y = append(town_y, tmp_y)\n }\n \n can := make([][]bool, n)\n for m:=0; m town_x[j] && town_y[k] > town_y[j]) ||\n (town_x[k] < town_x[j] && town_y[k] < town_y[j]) )){\n can[j][k] = true\n }else{\n can[j][k] = false\n }\n \n }\n \n }\n \n //fmt.Println(canReach(0,2,can, path))\n \n for l:=0 ; l< n; l++{\n tmp_cnt = 1\n var path []int\n for o:= 0; o town_x[j] && town_y[k] > town_y[j]) ||\n (town_x[k] < town_x[j] && town_y[k] < town_y[j]) )){\n can[j][k] = true\n }else{\n can[j][k] = false\n }\n \n }\n \n }\n \n //fmt.Println(canReach(0,2,can, path))\n \n for l:=0 ; l< n; l++{\n tmp_cnt = 1\n var path []int\n for o:= 0; o b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := -int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc bPrint(f bool, x string, y string) {\n\tif f {\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(y)\n\t}\n}\nfunc iSSPrint(x []int) {\n\tfmt.Println(strings.Trim(fmt.Sprint(x), \"[]\"))\n}\n\nvar lp1 int = 1000000007\nvar lp2 int = 998244353\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, lp1)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\tm := iScan()\n\ts := SScan(n)\n\tmcf := newMinCostFlow(n*m + 2)\n\tst, g := n*m, n*m+1\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tmcf.AddEdge(i*m+j, g, 1, 0)\n\t\t\tif s[i][j] == 'o' {\n\t\t\t\tmcf.AddEdge(st, i*m+j, 1, 0)\n\t\t\t\td := make([][]int, n)\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\td[k] = make([]int, m)\n\t\t\t\t\tfor l := 0; l < m; l++ {\n\t\t\t\t\t\td[k][l] = -lp1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\td[i][j] = 0\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tfor l := 0; l < m; l++ {\n\t\t\t\t\t\tif s[k][l] != '#' {\n\t\t\t\t\t\t\tif k > 0 {\n\t\t\t\t\t\t\t\td[k][l] = larger(d[k][l], d[k-1][l]+1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif l > 0 {\n\t\t\t\t\t\t\t\td[k][l] = larger(d[k][l], d[k][l-1]+1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tfor l := 0; l < m; l++ {\n\t\t\t\t\t\tmcf.AddEdge(m*i+j, m*k+l, 1, -d[k][l])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-mcf.Flow(st, g)[1])\n}\n\ntype MinCostFlow struct {\n\tn int\n\tpos [][2]int\n\tg [][]_Edge\n}\ntype _Edge struct {\n\tto int\n\trev int\n\tcapa int\n\tcost int\n}\ntype Edge struct {\n\tfrom int\n\tto int\n\tcapa int\n\tflow int\n\tcost int\n}\n\nfunc newMinCostFlow(n int) *MinCostFlow {\n\treturn &MinCostFlow{n: n, g: make([][]_Edge, n)}\n}\nfunc (mcf *MinCostFlow) AddEdge(from, to, capa, cost int) int {\n\tm := len(mcf.pos)\n\tmcf.pos = append(mcf.pos, [2]int{from, len(mcf.g[from])})\n\tmcf.g[from] = append(mcf.g[from], _Edge{to, len(mcf.g[to]), capa, cost})\n\tmcf.g[to] = append(mcf.g[to], _Edge{from, len(mcf.g[from]) - 1, 0, -cost})\n\treturn m\n}\nfunc (mcf *MinCostFlow) GetEdge(i int) Edge {\n\te := mcf.g[mcf.pos[i][0]][mcf.pos[i][1]]\n\tre := mcf.g[e.to][e.rev]\n\treturn Edge{mcf.pos[i][0], e.to, e.capa + re.capa, re.capa, e.cost}\n}\nfunc (mcf *MinCostFlow) Edges() []Edge {\n\tm := len(mcf.pos)\n\tres := make([]Edge, m)\n\tfor i := 0; i < m; i++ {\n\t\tres[i] = mcf.GetEdge(i)\n\t}\n\treturn res\n}\nfunc (mcf *MinCostFlow) Flow(s, t int) [2]int {\n\tres := mcf.Slope(s, t)\n\treturn res[len(res)-1]\n}\nfunc (mcf *MinCostFlow) FlowL(s, t, flowLim int) [2]int {\n\tres := mcf.SlopeL(s, t, flowLim)\n\treturn res[len(res)-1]\n}\nfunc (mcf *MinCostFlow) Slope(s, t int) [][2]int {\n\treturn mcf.SlopeL(s, t, int(1e+18))\n}\nfunc (mcf *MinCostFlow) SlopeL(s, t, flowLim int) [][2]int {\n\tdual, dist := make([]int, mcf.n), make([]int, mcf.n)\n\tpv, pe := make([]int, mcf.n), make([]int, mcf.n)\n\tvis := make([]bool, mcf.n)\n\tdualRef := func() bool {\n\t\tfor i := 0; i < mcf.n; i++ {\n\t\t\tdist[i], pv[i], pe[i] = int(1e+18), -1, -1\n\t\t\tvis[i] = false\n\t\t}\n\t\tpq := make(PriorityQueue, 0)\n\t\theap.Init(&pq)\n\t\titem := &Item{value: s, priority: 0}\n\t\tdist[s] = 0\n\t\theap.Push(&pq, item)\n\t\tfor pq.Len() != 0 {\n\t\t\tv := heap.Pop(&pq).(*Item).value\n\t\t\tif vis[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvis[v] = true\n\t\t\tif v == t {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor i := 0; i < len(mcf.g[v]); i++ {\n\t\t\t\te := mcf.g[v][i]\n\t\t\t\tif vis[e.to] || e.capa == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcost := e.cost - dual[e.to] + dual[v]\n\t\t\t\tif dist[e.to]-dist[v] > cost {\n\t\t\t\t\tdist[e.to] = dist[v] + cost\n\t\t\t\t\tpv[e.to] = v\n\t\t\t\t\tpe[e.to] = i\n\t\t\t\t\titem := &Item{value: e.to, priority: dist[e.to]}\n\t\t\t\t\theap.Push(&pq, item)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !vis[t] {\n\t\t\treturn false\n\t\t}\n\t\tfor v := 0; v < mcf.n; v++ {\n\t\t\tif !vis[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdual[v] -= dist[t] - dist[v]\n\t\t}\n\t\treturn true\n\t}\n\tflow, cost, prevCost := 0, 0, -1\n\tres := make([][2]int, 0, mcf.n)\n\tres = append(res, [2]int{flow, cost})\n\tfor flow < flowLim {\n\t\tif !dualRef() {\n\t\t\tbreak\n\t\t}\n\t\tc := flowLim - flow\n\t\tfor v := t; v != s; v = pv[v] {\n\t\t\tc = mcf.Min(c, mcf.g[pv[v]][pe[v]].capa)\n\t\t}\n\t\tfor v := t; v != s; v = pv[v] {\n\t\t\tmcf.g[pv[v]][pe[v]].capa -= c\n\t\t\tmcf.g[v][mcf.g[pv[v]][pe[v]].rev].capa += c\n\t\t}\n\t\td := -dual[s]\n\t\tflow += c\n\t\tcost += c * d\n\t\tif prevCost == d {\n\t\t\tres = res[:len(res)-1]\n\t\t}\n\t\tres = append(res, [2]int{flow, cost})\n\t\tprevCost = cost\n\t}\n\treturn res\n}\nfunc (mcf *MinCostFlow) Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\ntype Item struct {\n\tvalue int\n\tpriority int\n\tindex int\n}\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\treturn pq[i].priority < pq[j].priority\n}\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil\n\titem.index = -1\n\t*pq = old[0 : n-1]\n\treturn item\n}\nfunc (pq *PriorityQueue) update(item *Item, value int, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "language": "Go", "metadata": {"date": 1600653686, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02542.html", "problem_id": "p02542", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02542/input.txt", "sample_output_relpath": "derived/input_output/data/p02542/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02542/Go/s396915754.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s396915754", "user_id": "u843722521"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc rScan() []rune {\n\treturn []rune(Scan())\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc mod(x, d int) int {\n\tx %= d\n\tif x < 0 {\n\t\tx += d\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := -int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc bPrint(f bool, x string, y string) {\n\tif f {\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(y)\n\t}\n}\nfunc iSSPrint(x []int) {\n\tfmt.Println(strings.Trim(fmt.Sprint(x), \"[]\"))\n}\n\nvar lp1 int = 1000000007\nvar lp2 int = 998244353\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, lp1)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\tm := iScan()\n\ts := SScan(n)\n\tmcf := newMinCostFlow(n*m + 2)\n\tst, g := n*m, n*m+1\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tmcf.AddEdge(i*m+j, g, 1, 0)\n\t\t\tif s[i][j] == 'o' {\n\t\t\t\tmcf.AddEdge(st, i*m+j, 1, 0)\n\t\t\t\td := make([][]int, n)\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\td[k] = make([]int, m)\n\t\t\t\t\tfor l := 0; l < m; l++ {\n\t\t\t\t\t\td[k][l] = -lp1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\td[i][j] = 0\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tfor l := 0; l < m; l++ {\n\t\t\t\t\t\tif s[k][l] != '#' {\n\t\t\t\t\t\t\tif k > 0 {\n\t\t\t\t\t\t\t\td[k][l] = larger(d[k][l], d[k-1][l]+1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif l > 0 {\n\t\t\t\t\t\t\t\td[k][l] = larger(d[k][l], d[k][l-1]+1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tfor l := 0; l < m; l++ {\n\t\t\t\t\t\tmcf.AddEdge(m*i+j, m*k+l, 1, -d[k][l])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-mcf.Flow(st, g)[1])\n}\n\ntype MinCostFlow struct {\n\tn int\n\tpos [][2]int\n\tg [][]_Edge\n}\ntype _Edge struct {\n\tto int\n\trev int\n\tcapa int\n\tcost int\n}\ntype Edge struct {\n\tfrom int\n\tto int\n\tcapa int\n\tflow int\n\tcost int\n}\n\nfunc newMinCostFlow(n int) *MinCostFlow {\n\treturn &MinCostFlow{n: n, g: make([][]_Edge, n)}\n}\nfunc (mcf *MinCostFlow) AddEdge(from, to, capa, cost int) int {\n\tm := len(mcf.pos)\n\tmcf.pos = append(mcf.pos, [2]int{from, len(mcf.g[from])})\n\tmcf.g[from] = append(mcf.g[from], _Edge{to, len(mcf.g[to]), capa, cost})\n\tmcf.g[to] = append(mcf.g[to], _Edge{from, len(mcf.g[from]) - 1, 0, -cost})\n\treturn m\n}\nfunc (mcf *MinCostFlow) GetEdge(i int) Edge {\n\te := mcf.g[mcf.pos[i][0]][mcf.pos[i][1]]\n\tre := mcf.g[e.to][e.rev]\n\treturn Edge{mcf.pos[i][0], e.to, e.capa + re.capa, re.capa, e.cost}\n}\nfunc (mcf *MinCostFlow) Edges() []Edge {\n\tm := len(mcf.pos)\n\tres := make([]Edge, m)\n\tfor i := 0; i < m; i++ {\n\t\tres[i] = mcf.GetEdge(i)\n\t}\n\treturn res\n}\nfunc (mcf *MinCostFlow) Flow(s, t int) [2]int {\n\tres := mcf.Slope(s, t)\n\treturn res[len(res)-1]\n}\nfunc (mcf *MinCostFlow) FlowL(s, t, flowLim int) [2]int {\n\tres := mcf.SlopeL(s, t, flowLim)\n\treturn res[len(res)-1]\n}\nfunc (mcf *MinCostFlow) Slope(s, t int) [][2]int {\n\treturn mcf.SlopeL(s, t, int(1e+18))\n}\nfunc (mcf *MinCostFlow) SlopeL(s, t, flowLim int) [][2]int {\n\tdual, dist := make([]int, mcf.n), make([]int, mcf.n)\n\tpv, pe := make([]int, mcf.n), make([]int, mcf.n)\n\tvis := make([]bool, mcf.n)\n\tdualRef := func() bool {\n\t\tfor i := 0; i < mcf.n; i++ {\n\t\t\tdist[i], pv[i], pe[i] = int(1e+18), -1, -1\n\t\t\tvis[i] = false\n\t\t}\n\t\tpq := make(PriorityQueue, 0)\n\t\theap.Init(&pq)\n\t\titem := &Item{value: s, priority: 0}\n\t\tdist[s] = 0\n\t\theap.Push(&pq, item)\n\t\tfor pq.Len() != 0 {\n\t\t\tv := heap.Pop(&pq).(*Item).value\n\t\t\tif vis[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvis[v] = true\n\t\t\tif v == t {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor i := 0; i < len(mcf.g[v]); i++ {\n\t\t\t\te := mcf.g[v][i]\n\t\t\t\tif vis[e.to] || e.capa == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcost := e.cost - dual[e.to] + dual[v]\n\t\t\t\tif dist[e.to]-dist[v] > cost {\n\t\t\t\t\tdist[e.to] = dist[v] + cost\n\t\t\t\t\tpv[e.to] = v\n\t\t\t\t\tpe[e.to] = i\n\t\t\t\t\titem := &Item{value: e.to, priority: dist[e.to]}\n\t\t\t\t\theap.Push(&pq, item)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !vis[t] {\n\t\t\treturn false\n\t\t}\n\t\tfor v := 0; v < mcf.n; v++ {\n\t\t\tif !vis[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdual[v] -= dist[t] - dist[v]\n\t\t}\n\t\treturn true\n\t}\n\tflow, cost, prevCost := 0, 0, -1\n\tres := make([][2]int, 0, mcf.n)\n\tres = append(res, [2]int{flow, cost})\n\tfor flow < flowLim {\n\t\tif !dualRef() {\n\t\t\tbreak\n\t\t}\n\t\tc := flowLim - flow\n\t\tfor v := t; v != s; v = pv[v] {\n\t\t\tc = mcf.Min(c, mcf.g[pv[v]][pe[v]].capa)\n\t\t}\n\t\tfor v := t; v != s; v = pv[v] {\n\t\t\tmcf.g[pv[v]][pe[v]].capa -= c\n\t\t\tmcf.g[v][mcf.g[pv[v]][pe[v]].rev].capa += c\n\t\t}\n\t\td := -dual[s]\n\t\tflow += c\n\t\tcost += c * d\n\t\tif prevCost == d {\n\t\t\tres = res[:len(res)-1]\n\t\t}\n\t\tres = append(res, [2]int{flow, cost})\n\t\tprevCost = cost\n\t}\n\treturn res\n}\nfunc (mcf *MinCostFlow) Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\ntype Item struct {\n\tvalue int\n\tpriority int\n\tindex int\n}\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\treturn pq[i].priority < pq[j].priority\n}\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil\n\titem.index = -1\n\t*pq = old[0 : n-1]\n\treturn item\n}\nfunc (pq *PriorityQueue) update(item *Item, value int, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a board with N rows and M columns.\nThe information of this board is represented by N strings S_1,S_2,\\ldots,S_N.\nSpecifically, the state of the square at the i-th row from the top and the j-th column from the left is represented as follows:\n\nS_{i,j}=. : the square is empty.\n\nS_{i,j}=# : an obstacle is placed on the square.\n\nS_{i,j}=o : a piece is placed on the square.\n\nYosupo repeats the following operation:\n\nChoose a piece and move it to its right adjecent square or its down adjacent square.\nMoving a piece to squares with another piece or an obstacle is prohibited.\nMoving a piece out of the board is also prohibited.\n\nYosupo wants to perform the operation as many times as possible.\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq M \\leq 50\n\nS_i is a string of length M consisting of ., # and o.\n\n1 \\leq ( the number of pieces )\\leq 100.\nIn other words, the number of pairs (i, j) that satisfy S_{i,j}=o is between 1 and 100, both inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS_1\nS_2\n\\vdots\nS_N\n\nOutput\n\nPrint the maximum possible number of operations in a line.\n\nSample Input 1\n\n3 3\no..\n...\no.#\n\nSample Output 1\n\n4\n\nYosupo can perform operations 4 times as follows:\n\no.. .o. ..o ... ...\n... -> ... -> ... -> ..o -> ..o\no.# o.# o.# o.# .o#\n\nSample Input 2\n\n9 10\n.#....o#..\n.#..#..##o\n.....#o.##\n.###.#o..o\n#.#...##.#\n..#..#.###\n#o.....#..\n....###..o\no.......o#\n\nSample Output 2\n\n24", "sample_input": "3 3\no..\n...\no.#\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02542", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a board with N rows and M columns.\nThe information of this board is represented by N strings S_1,S_2,\\ldots,S_N.\nSpecifically, the state of the square at the i-th row from the top and the j-th column from the left is represented as follows:\n\nS_{i,j}=. : the square is empty.\n\nS_{i,j}=# : an obstacle is placed on the square.\n\nS_{i,j}=o : a piece is placed on the square.\n\nYosupo repeats the following operation:\n\nChoose a piece and move it to its right adjecent square or its down adjacent square.\nMoving a piece to squares with another piece or an obstacle is prohibited.\nMoving a piece out of the board is also prohibited.\n\nYosupo wants to perform the operation as many times as possible.\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq M \\leq 50\n\nS_i is a string of length M consisting of ., # and o.\n\n1 \\leq ( the number of pieces )\\leq 100.\nIn other words, the number of pairs (i, j) that satisfy S_{i,j}=o is between 1 and 100, both inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS_1\nS_2\n\\vdots\nS_N\n\nOutput\n\nPrint the maximum possible number of operations in a line.\n\nSample Input 1\n\n3 3\no..\n...\no.#\n\nSample Output 1\n\n4\n\nYosupo can perform operations 4 times as follows:\n\no.. .o. ..o ... ...\n... -> ... -> ... -> ..o -> ..o\no.# o.# o.# o.# .o#\n\nSample Input 2\n\n9 10\n.#....o#..\n.#..#..##o\n.....#o.##\n.###.#o..o\n#.#...##.#\n..#..#.###\n#o.....#..\n....###..o\no.......o#\n\nSample Output 2\n\n24", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6194, "cpu_time_ms": 167, "memory_kb": 59640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s430002549", "group_id": "codeNet:p02547", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar num int\n\tans := false\n\td1 := make([]int, n)\n\td2 := make([]int, n)\n\tfor i := range d1 {\n\t\tfmt.Scan(&d1[i], &d2[i])\n\t\tif d1[i] == d2[i] {\n\t\t\tnum++\n\t\t}else{\n\t\t\tnum = 0\n\t\t}\n\t\tif num >= 3 {\n\t\t\tans = true\n\t\t}\n\t}\n\tif ans == true {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1600542955, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02547.html", "problem_id": "p02547", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02547/input.txt", "sample_output_relpath": "derived/input_output/data/p02547/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02547/Go/s430002549.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s430002549", "user_id": "u950611195"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar num int\n\tans := false\n\td1 := make([]int, n)\n\td2 := make([]int, n)\n\tfor i := range d1 {\n\t\tfmt.Scan(&d1[i], &d2[i])\n\t\tif d1[i] == d2[i] {\n\t\t\tnum++\n\t\t}else{\n\t\t\tnum = 0\n\t\t}\n\t\tif num >= 3 {\n\t\t\tans = true\n\t\t}\n\t}\n\tif ans == true {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTak performed the following action N times: rolling two dice.\nThe result of the i-th roll is D_{i,1} and D_{i,2}.\n\nCheck if doublets occurred at least three times in a row.\nSpecifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1\\leq D_{i,j} \\leq 6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_{1,1} D_{1,2}\n\\vdots\nD_{N,1} D_{N,2}\n\nOutput\n\nPrint Yes if doublets occurred at least three times in a row. Print No otherwise.\n\nSample Input 1\n\n5\n1 2\n6 6\n4 4\n3 3\n3 2\n\nSample Output 1\n\nYes\n\nFrom the second roll to the fourth roll, three doublets occurred in a row.\n\nSample Input 2\n\n5\n1 1\n2 2\n3 4\n5 5\n6 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n1 1\n2 2\n3 3\n4 4\n5 5\n6 6\n\nSample Output 3\n\nYes", "sample_input": "5\n1 2\n6 6\n4 4\n3 3\n3 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02547", "source_text": "Score : 200 points\n\nProblem Statement\n\nTak performed the following action N times: rolling two dice.\nThe result of the i-th roll is D_{i,1} and D_{i,2}.\n\nCheck if doublets occurred at least three times in a row.\nSpecifically, check if there exists at lease one i such that D_{i,1}=D_{i,2}, D_{i+1,1}=D_{i+1,2} and D_{i+2,1}=D_{i+2,2} hold.\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1\\leq D_{i,j} \\leq 6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nD_{1,1} D_{1,2}\n\\vdots\nD_{N,1} D_{N,2}\n\nOutput\n\nPrint Yes if doublets occurred at least three times in a row. Print No otherwise.\n\nSample Input 1\n\n5\n1 2\n6 6\n4 4\n3 3\n3 2\n\nSample Output 1\n\nYes\n\nFrom the second roll to the fourth roll, three doublets occurred in a row.\n\nSample Input 2\n\n5\n1 1\n2 2\n3 4\n5 5\n6 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n1 1\n2 2\n3 3\n4 4\n5 5\n6 6\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 351, "cpu_time_ms": 8, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s535053206", "group_id": "codeNet:p02550", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc small(N, X, M int) {\n\ta := X\n\tans := X\n\tfor i := 2; i <= N; i++ {\n\t\ta *= a\n\t\ta %= M\n\t\tans += a\n\t}\n\tout(ans)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, X, M := getInt(), getInt(), getInt()\n\n\t// if N < 1000000000 {\n\t// \tsmall(N, X, M)\n\t// \treturn\n\t// }\n\tm := make([]int, M)\n\tb := make([]int, 0)\n\n\tlast := -1\n\ta := X % M\n\tb = append(b, a)\n\ttot := a\n\tm[a]++\n\tfor i := 1; i <= N; i++ {\n\t\ta *= a\n\t\ta %= M\n\t\tif m[a] != 0 {\n\t\t\tlast = a\n\t\t\tbreak\n\t\t}\n\t\tif a == 0 {\n\t\t\tout(tot)\n\t\t\treturn\n\t\t}\n\t\ttot += a\n\t\tm[a]++\n\t\tb = append(b, a)\n\t}\n\t// out(b, last, tot)\n\tif last == -1 {\n\t\tout(tot)\n\t\treturn\n\t}\n\tstart := 0\n\tans := 0\n\tfor i := 0; i < len(b); i++ {\n\t\tif b[i] == last {\n\t\t\tstart = i\n\t\t\tbreak\n\t\t}\n\t\tans += b[i]\n\t\ttot -= b[i]\n\t}\n\tN -= start\n\tloop := len(b) - start\n\t// out(N, loop, tot)\n\tn := N / loop\n\tans += n * tot\n\trest := N % loop\n\tfor i := 0; i < rest; i++ {\n\t\tans += b[start+i]\n\t}\n\t// out(n*loop + rest)\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1600550754, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02550.html", "problem_id": "p02550", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02550/input.txt", "sample_output_relpath": "derived/input_output/data/p02550/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02550/Go/s535053206.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s535053206", "user_id": "u814575783"}, "prompt_components": {"gold_output": "1369\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc small(N, X, M int) {\n\ta := X\n\tans := X\n\tfor i := 2; i <= N; i++ {\n\t\ta *= a\n\t\ta %= M\n\t\tans += a\n\t}\n\tout(ans)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, X, M := getInt(), getInt(), getInt()\n\n\t// if N < 1000000000 {\n\t// \tsmall(N, X, M)\n\t// \treturn\n\t// }\n\tm := make([]int, M)\n\tb := make([]int, 0)\n\n\tlast := -1\n\ta := X % M\n\tb = append(b, a)\n\ttot := a\n\tm[a]++\n\tfor i := 1; i <= N; i++ {\n\t\ta *= a\n\t\ta %= M\n\t\tif m[a] != 0 {\n\t\t\tlast = a\n\t\t\tbreak\n\t\t}\n\t\tif a == 0 {\n\t\t\tout(tot)\n\t\t\treturn\n\t\t}\n\t\ttot += a\n\t\tm[a]++\n\t\tb = append(b, a)\n\t}\n\t// out(b, last, tot)\n\tif last == -1 {\n\t\tout(tot)\n\t\treturn\n\t}\n\tstart := 0\n\tans := 0\n\tfor i := 0; i < len(b); i++ {\n\t\tif b[i] == last {\n\t\t\tstart = i\n\t\t\tbreak\n\t\t}\n\t\tans += b[i]\n\t\ttot -= b[i]\n\t}\n\tN -= start\n\tloop := len(b) - start\n\t// out(N, loop, tot)\n\tn := N / loop\n\tans += n * tot\n\trest := N % loop\n\tfor i := 0; i < rest; i++ {\n\t\tans += b[start+i]\n\t}\n\t// out(n*loop + rest)\n\tout(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nLet us denote by f(x, m) the remainder of the Euclidean division of x by m.\n\nLet A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M).\nFind \\displaystyle{\\sum_{i=1}^N A_i}.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\n0 \\leq X < M \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X M\n\nOutput\n\nPrint \\displaystyle{\\sum_{i=1}^N A_i}.\n\nSample Input 1\n\n6 2 1001\n\nSample Output 1\n\n1369\n\nThe sequence A begins 2,4,16,256,471,620,\\ldots Therefore, the answer is 2+4+16+256+471+620=1369.\n\nSample Input 2\n\n1000 2 16\n\nSample Output 2\n\n6\n\nThe sequence A begins 2,4,0,0,\\ldots Therefore, the answer is 6.\n\nSample Input 3\n\n10000000000 10 99959\n\nSample Output 3\n\n492443256176507", "sample_input": "6 2 1001\n"}, "reference_outputs": ["1369\n"], "source_document_id": "p02550", "source_text": "Score : 500 points\n\nProblem Statement\n\nLet us denote by f(x, m) the remainder of the Euclidean division of x by m.\n\nLet A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M).\nFind \\displaystyle{\\sum_{i=1}^N A_i}.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\n0 \\leq X < M \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X M\n\nOutput\n\nPrint \\displaystyle{\\sum_{i=1}^N A_i}.\n\nSample Input 1\n\n6 2 1001\n\nSample Output 1\n\n1369\n\nThe sequence A begins 2,4,16,256,471,620,\\ldots Therefore, the answer is 2+4+16+256+471+620=1369.\n\nSample Input 2\n\n1000 2 16\n\nSample Output 2\n\n6\n\nThe sequence A begins 2,4,0,0,\\ldots Therefore, the answer is 6.\n\nSample Input 3\n\n10000000000 10 99959\n\nSample Output 3\n\n492443256176507", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1934, "cpu_time_ms": 7, "memory_kb": 4944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s113971609", "group_id": "codeNet:p02552", "input_text": "package main \n\nimport \"fmt\"\n\nfunc main(){\n var i int\n fmt.Scan(&i)\n switch{\n case i == 0:\n fmt.Println(\"1\")\n case i == 1:\n fmt.Print(\"0\")\n } \n\n}", "language": "Go", "metadata": {"date": 1600180869, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02552.html", "problem_id": "p02552", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02552/input.txt", "sample_output_relpath": "derived/input_output/data/p02552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02552/Go/s113971609.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s113971609", "user_id": "u808262291"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main \n\nimport \"fmt\"\n\nfunc main(){\n var i int\n fmt.Scan(&i)\n switch{\n case i == 0:\n fmt.Println(\"1\")\n case i == 1:\n fmt.Print(\"0\")\n } \n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "sample_input": "1\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02552", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 161, "cpu_time_ms": 6, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s820705574", "group_id": "codeNet:p02552", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar num int\n\tfmt.Scanf(\"%d\", &num)\n\tif num == 0 {\n\t\tfmt.Println(1)\n\t} else if num == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(\"hoge\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1600023930, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02552.html", "problem_id": "p02552", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02552/input.txt", "sample_output_relpath": "derived/input_output/data/p02552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02552/Go/s820705574.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s820705574", "user_id": "u527979509"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar num int\n\tfmt.Scanf(\"%d\", &num)\n\tif num == 0 {\n\t\tfmt.Println(1)\n\t} else if num == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(\"hoge\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "sample_input": "1\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02552", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 186, "cpu_time_ms": 6, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s703387210", "group_id": "codeNet:p02554", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst div = 1000000007\n\nfunc Powmod(x, n int) int {\n\tres := 1\n\tfor i := 0; i < n; i++ {\n\t\tres = (res * x) % div\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tans := Powmod(10, n) - 2*Powmod(9, n) + Powmod(8, n)\n\tans %= div\n\tans = (ans + div) % div\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1600508484, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02554.html", "problem_id": "p02554", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02554/input.txt", "sample_output_relpath": "derived/input_output/data/p02554/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02554/Go/s703387210.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s703387210", "user_id": "u713492631"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst div = 1000000007\n\nfunc Powmod(x, n int) int {\n\tres := 1\n\tfor i := 0; i < n; i++ {\n\t\tres = (res * x) % div\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tans := Powmod(10, n) - 2*Powmod(9, n) + Powmod(8, n)\n\tans %= div\n\tans = (ans + div) % div\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHow many integer sequences A_1,A_2,\\ldots,A_N of length N satisfy all of the following conditions?\n\n0 \\leq A_i \\leq 9\n\nThere exists some i such that A_i=0 holds.\n\nThere exists some i such that A_i=9 holds.\n\nThe answer can be very large, so output it modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer modulo 10^9 + 7.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n2\n\nTwo sequences \\{0,9\\} and \\{9,0\\} satisfy all conditions.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n869121\n\nSample Output 3\n\n2511445", "sample_input": "2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02554", "source_text": "Score : 300 points\n\nProblem Statement\n\nHow many integer sequences A_1,A_2,\\ldots,A_N of length N satisfy all of the following conditions?\n\n0 \\leq A_i \\leq 9\n\nThere exists some i such that A_i=0 holds.\n\nThere exists some i such that A_i=9 holds.\n\nThe answer can be very large, so output it modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer modulo 10^9 + 7.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n2\n\nTwo sequences \\{0,9\\} and \\{9,0\\} satisfy all conditions.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n869121\n\nSample Output 3\n\n2511445", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 313, "cpu_time_ms": 22, "memory_kb": 1788}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s739448104", "group_id": "codeNet:p02560", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) {\n\tif os.Getenv(\"ONLINE_JUDGE\") == \"false\" {\n\t\tfmt.Fprintln(os.Stderr, a...)\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\ttests := scanInt()\n\tfor test := 0; test < tests; test++ {\n\t\tn, m, a, b := scanInt(), scanInt(), scanInt(), scanInt()\n\t\tfmt.Fprintln(wr, floorSum(n, m, a, b))\n\t}\n}\n\nfunc floorSum(n, m, a, b int) int {\n\tans := 0\n\tif a >= m {\n\t\tans += (n - 1) * n * (a / m) / 2\n\t\ta %= m\n\t}\n\tif b >= m {\n\t\tans += n * (b / m)\n\t\tb %= m\n\t}\n\n\tyma := (a*n + b) / m\n\tif yma == 0 {\n\t\treturn ans\n\t}\n\txma := yma*m - b\n\tans += (n - (xma+a-1)/a) * yma\n\tans += floorSum(yma, a, m, (a-xma%a)%a)\n\treturn ans\n}\n", "language": "Go", "metadata": {"date": 1600496044, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02560.html", "problem_id": "p02560", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02560/input.txt", "sample_output_relpath": "derived/input_output/data/p02560/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02560/Go/s739448104.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s739448104", "user_id": "u548992197"}, "prompt_components": {"gold_output": "3\n13\n0\n314095480\n499999999500000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) {\n\tif os.Getenv(\"ONLINE_JUDGE\") == \"false\" {\n\t\tfmt.Fprintln(os.Stderr, a...)\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\ttests := scanInt()\n\tfor test := 0; test < tests; test++ {\n\t\tn, m, a, b := scanInt(), scanInt(), scanInt(), scanInt()\n\t\tfmt.Fprintln(wr, floorSum(n, m, a, b))\n\t}\n}\n\nfunc floorSum(n, m, a, b int) int {\n\tans := 0\n\tif a >= m {\n\t\tans += (n - 1) * n * (a / m) / 2\n\t\ta %= m\n\t}\n\tif b >= m {\n\t\tans += n * (b / m)\n\t\tb %= m\n\t}\n\n\tyma := (a*n + b) / m\n\tif yma == 0 {\n\t\treturn ans\n\t}\n\txma := yma*m - b\n\tans += (n - (xma+a-1)/a) * yma\n\tans += floorSum(yma, a, m, (a-xma%a)%a)\n\treturn ans\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn this problem, you should process T testcases.\n\nFor each testcase, you are given four integers N, M, A, B.\n\nCalculate \\sum_{i = 0}^{N - 1} floor((A \\times i + B) / M).\n\nConstraints\n\n1 \\leq T \\leq 100,000\n\n1 \\leq N, M \\leq 10^9\n\n0 \\leq A, B < M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\nN_0 M_0 A_0 B_0\nN_1 M_1 A_1 B_1\n:\nN_{T - 1} M_{T - 1} A_{T - 1} B_{T - 1}\n\nOutput\n\nPrint the answer for each testcase.\n\nSample Input 1\n\n5\n4 10 6 3\n6 5 4 3\n1 1 0 0\n31415 92653 58979 32384\n1000000000 1000000000 999999999 999999999\n\nSample Output 1\n\n3\n13\n0\n314095480\n499999999500000000", "sample_input": "5\n4 10 6 3\n6 5 4 3\n1 1 0 0\n31415 92653 58979 32384\n1000000000 1000000000 999999999 999999999\n"}, "reference_outputs": ["3\n13\n0\n314095480\n499999999500000000\n"], "source_document_id": "p02560", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn this problem, you should process T testcases.\n\nFor each testcase, you are given four integers N, M, A, B.\n\nCalculate \\sum_{i = 0}^{N - 1} floor((A \\times i + B) / M).\n\nConstraints\n\n1 \\leq T \\leq 100,000\n\n1 \\leq N, M \\leq 10^9\n\n0 \\leq A, B < M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\nN_0 M_0 A_0 B_0\nN_1 M_1 A_1 B_1\n:\nN_{T - 1} M_{T - 1} A_{T - 1} B_{T - 1}\n\nOutput\n\nPrint the answer for each testcase.\n\nSample Input 1\n\n5\n4 10 6 3\n6 5 4 3\n1 1 0 0\n31415 92653 58979 32384\n1000000000 1000000000 999999999 999999999\n\nSample Output 1\n\n3\n13\n0\n314095480\n499999999500000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1562, "cpu_time_ms": 117, "memory_kb": 6012}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s914917516", "group_id": "codeNet:p02570", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar D, T, S float64\n\tfmt.Scan(&D, &T, &S)\n\n var dis = (T * S)\n\n if T <= dis {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}", "language": "Go", "metadata": {"date": 1599229629, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02570.html", "problem_id": "p02570", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02570/input.txt", "sample_output_relpath": "derived/input_output/data/p02570/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02570/Go/s914917516.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s914917516", "user_id": "u528964776"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar D, T, S float64\n\tfmt.Scan(&D, &T, &S)\n\n var dis = (T * S)\n\n if T <= dis {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "sample_input": "1000 15 80\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02570", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 182, "cpu_time_ms": 5, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s116628276", "group_id": "codeNet:p02571", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc intmin() func(int) int {\n\tisFirst := true\n\tmin := 0\n\treturn func(a int) int {\n\t\tif isFirst {\n\t\t\tisFirst = false\n\t\t\tmin = a\n\t\t\treturn a\n\t\t}\n\t\tif min > a {\n\n\t\t\treturn a\n\t\t}\n\t\treturn min\n\t}\n}\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\n\ts := strings.Split(S, \"\")\n\tt := strings.Split(T, \"\")\n\n\tcount := 0\n\tmin := 0\n\tisFirst := true\n\n\tfor offset := 0; offset < len(S)-len(T); offset++ {\n\n\t\tfor i := 0; i < len(T); i++ {\n\n\t\t\tif s[offset+i] != t[i] {\n\t\t\t\tcount++\n\t\t\t}\n\n\t\t}\n\n\t\tmin = func(a int) int {\n\t\t\tif isFirst {\n\t\t\t\tisFirst = false\n\t\t\t\treturn a\n\t\t\t}\n\t\t\tif min > a {\n\t\t\t\treturn a\n\t\t\t}\n\t\t\treturn min\n\t\t}(count)\n\n\t\tcount = 0\n\n\t}\n\tfmt.Println(min)\n\n}\n", "language": "Go", "metadata": {"date": 1599430739, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02571.html", "problem_id": "p02571", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02571/input.txt", "sample_output_relpath": "derived/input_output/data/p02571/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02571/Go/s116628276.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s116628276", "user_id": "u343774545"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc intmin() func(int) int {\n\tisFirst := true\n\tmin := 0\n\treturn func(a int) int {\n\t\tif isFirst {\n\t\t\tisFirst = false\n\t\t\tmin = a\n\t\t\treturn a\n\t\t}\n\t\tif min > a {\n\n\t\t\treturn a\n\t\t}\n\t\treturn min\n\t}\n}\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\n\ts := strings.Split(S, \"\")\n\tt := strings.Split(T, \"\")\n\n\tcount := 0\n\tmin := 0\n\tisFirst := true\n\n\tfor offset := 0; offset < len(S)-len(T); offset++ {\n\n\t\tfor i := 0; i < len(T); i++ {\n\n\t\t\tif s[offset+i] != t[i] {\n\t\t\t\tcount++\n\t\t\t}\n\n\t\t}\n\n\t\tmin = func(a int) int {\n\t\t\tif isFirst {\n\t\t\t\tisFirst = false\n\t\t\t\treturn a\n\t\t\t}\n\t\t\tif min > a {\n\t\t\t\treturn a\n\t\t\t}\n\t\t\treturn min\n\t\t}(count)\n\n\t\tcount = 0\n\n\t}\n\tfmt.Println(min)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "sample_input": "cabacc\nabc\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02571", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 698, "cpu_time_ms": 9, "memory_kb": 1888}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s107117956", "group_id": "codeNet:p02571", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\n\tresult := 0\n\tfor i := 0; i <= len(S)-len(T); i++ {\n\t\tcount := 0\n\t\tfor j := 0; j < len(T); j++ {\n\t\t\tif S[i+j] == T[j] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif count > result {\n\t\t\tresult = count\n\t\t}\n\t}\n\tfmt.Println(len(T) - result)\n}\n", "language": "Go", "metadata": {"date": 1599339985, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02571.html", "problem_id": "p02571", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02571/input.txt", "sample_output_relpath": "derived/input_output/data/p02571/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02571/Go/s107117956.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s107117956", "user_id": "u416650504"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\n\tresult := 0\n\tfor i := 0; i <= len(S)-len(T); i++ {\n\t\tcount := 0\n\t\tfor j := 0; j < len(T); j++ {\n\t\t\tif S[i+j] == T[j] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif count > result {\n\t\t\tresult = count\n\t\t}\n\t}\n\tfmt.Println(len(T) - result)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "sample_input": "cabacc\nabc\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02571", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 298, "cpu_time_ms": 6, "memory_kb": 1788}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s932163260", "group_id": "codeNet:p02571", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tvar s, t string\n\tfmt.Fscan(r, &s)\n\tfmt.Fscan(r, &t)\n\n\tmin := len(t)\n\n\tfor i := 0; i < len(s)-len(t)+1; i++ {\n\t\tdiff := 0\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif s[i+j] != t[j] {\n\t\t\t\tdiff++\n\t\t\t}\n\t\t}\n\n\t\tif diff < min {\n\t\t\tmin = diff\n\t\t}\n\t}\n\n\tfmt.Fprintln(w, min)\n}\n", "language": "Go", "metadata": {"date": 1598732744, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02571.html", "problem_id": "p02571", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02571/input.txt", "sample_output_relpath": "derived/input_output/data/p02571/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02571/Go/s932163260.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s932163260", "user_id": "u329377137"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tvar s, t string\n\tfmt.Fscan(r, &s)\n\tfmt.Fscan(r, &t)\n\n\tmin := len(t)\n\n\tfor i := 0; i < len(s)-len(t)+1; i++ {\n\t\tdiff := 0\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif s[i+j] != t[j] {\n\t\t\t\tdiff++\n\t\t\t}\n\t\t}\n\n\t\tif diff < min {\n\t\t\tmin = diff\n\t\t}\n\t}\n\n\tfmt.Fprintln(w, min)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "sample_input": "cabacc\nabc\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02571", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 407, "cpu_time_ms": 7, "memory_kb": 1860}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s871890096", "group_id": "codeNet:p02571", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tss := split(s)\n\ttt := split(t)\n\tmin := 1000\n\tfor i := 0; i < len(ss);i++ {\n\t\tcnt := len(tt)\n\t\tfor j := 0; j < len(tt); j++ {\n\n\t\t\tif ss[i+j] == tt[j] {\n\t\t\t\tcnt--\n\t\t\t}\n\t\t\tif i+j == len(ss)-1 {\n\t\t\t// if i+j >= len(ss)-1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif cnt < min {\n\t\t\tmin = cnt\n\t\t}\n\t}\n\n\tfmt.Println(min)\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1598729972, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02571.html", "problem_id": "p02571", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02571/input.txt", "sample_output_relpath": "derived/input_output/data/p02571/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02571/Go/s871890096.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s871890096", "user_id": "u769765274"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tss := split(s)\n\ttt := split(t)\n\tmin := 1000\n\tfor i := 0; i < len(ss);i++ {\n\t\tcnt := len(tt)\n\t\tfor j := 0; j < len(tt); j++ {\n\n\t\t\tif ss[i+j] == tt[j] {\n\t\t\t\tcnt--\n\t\t\t}\n\t\t\tif i+j == len(ss)-1 {\n\t\t\t// if i+j >= len(ss)-1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif cnt < min {\n\t\t\tmin = cnt\n\t\t}\n\t}\n\n\tfmt.Println(min)\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "sample_input": "cabacc\nabc\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02571", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 517, "cpu_time_ms": 17, "memory_kb": 1892}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s613078258", "group_id": "codeNet:p02571", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tvar t string\n\tfmt.Scan(&t)\n\n\ts1 := strings.Split(s, \"\")\n\ts2 := strings.Split(t, \"\")\n\n\tlength1 := len(s1)\n\tlength2 := len(s2)\n\n\tlength := length1 - length2\n\tvar count int\n\tmax := 0\n\tfor i := 0; i < length; i++ {\n\t\tcount = 0\n\t\tfor j := 0; j < length2; j++ {\n\t\t\tif s1[j+i] == s2[j]{\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif max < count{\n\t\t\tmax = count\n\t\t}\n\t}\n\n\tans := length2 - max\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1598729364, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02571.html", "problem_id": "p02571", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02571/input.txt", "sample_output_relpath": "derived/input_output/data/p02571/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02571/Go/s613078258.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s613078258", "user_id": "u950611195"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tvar t string\n\tfmt.Scan(&t)\n\n\ts1 := strings.Split(s, \"\")\n\ts2 := strings.Split(t, \"\")\n\n\tlength1 := len(s1)\n\tlength2 := len(s2)\n\n\tlength := length1 - length2\n\tvar count int\n\tmax := 0\n\tfor i := 0; i < length; i++ {\n\t\tcount = 0\n\t\tfor j := 0; j < length2; j++ {\n\t\t\tif s1[j+i] == s2[j]{\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif max < count{\n\t\t\tmax = count\n\t\t}\n\t}\n\n\tans := length2 - max\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "sample_input": "cabacc\nabc\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02571", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 472, "cpu_time_ms": 12, "memory_kb": 1888}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s960626710", "group_id": "codeNet:p02571", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t/*/TODO:!!!!!!!テスト用!!!!!!!!!\n\tsc = bufio.NewScanner(strings.NewReader(`\n\t\t\t\t\t\t\t\t\t\t`))\n\t//TODO:!!!!!!!テスト用!!!!!!!!!*/\n\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\t//fmt.Fprintln(out, \"[DEBUG]\", time.Now())\n\n\ts := next()\n\tt := next()\n\n\tans := len(t)\n\tfor i := 0; i < len(s)-len(t); i++ {\n\t\tw := 0\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif s[i+j] != t[j] {\n\t\t\t\tw++\n\t\t\t}\n\t\t}\n\t\tans = minInt(ans, w)\n\t}\n\n\t//fmt.Fprintln(out, \"[DEBUG]\", a)\n\tfmt.Fprintln(out, ans)\n\n}\n\n// 挿入ソート配列\ntype slist struct {\n\tl []int\n}\n\nfunc makeSlist() slist {\n\treturn slist{[]int{}}\n}\n\nfunc (s *slist) add(a int) {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\tif pos < len(s.l) {\n\t\ts.l = append(s.l[:pos+1], s.l[pos:]...)\n\t\ts.l[pos] = a\n\t} else {\n\t\ts.l = append(s.l, a)\n\t}\n}\nfunc (s slist) contains(a int) bool {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\treturn pos < len(s.l) && s.l[pos] == a\n}\n\n//------------------------------------------------------------------------------\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc printArray(a []int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i >= 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t}\n\t\tfmt.Fprint(out, a[i])\n\t}\n\tfmt.Fprintln(out)\n}\n\nfunc absInt(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc minInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc sign(x int) int {\n\tif x == 0 {\n\t\treturn 0\n\t}\n\tif x > 0 {\n\t\treturn 1\n\t}\n\treturn -1\n}\nfunc log10(x int) float64 {\n\treturn math.Log10(float64(x))\n}\nfunc divCeil(shi, bo int) int {\n\tans := shi / bo\n\tif shi%bo != 0 {\n\t\tans++\n\t}\n\treturn ans\n}\n", "language": "Go", "metadata": {"date": 1598727908, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02571.html", "problem_id": "p02571", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02571/input.txt", "sample_output_relpath": "derived/input_output/data/p02571/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02571/Go/s960626710.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s960626710", "user_id": "u805846052"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t/*/TODO:!!!!!!!テスト用!!!!!!!!!\n\tsc = bufio.NewScanner(strings.NewReader(`\n\t\t\t\t\t\t\t\t\t\t`))\n\t//TODO:!!!!!!!テスト用!!!!!!!!!*/\n\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\t//fmt.Fprintln(out, \"[DEBUG]\", time.Now())\n\n\ts := next()\n\tt := next()\n\n\tans := len(t)\n\tfor i := 0; i < len(s)-len(t); i++ {\n\t\tw := 0\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif s[i+j] != t[j] {\n\t\t\t\tw++\n\t\t\t}\n\t\t}\n\t\tans = minInt(ans, w)\n\t}\n\n\t//fmt.Fprintln(out, \"[DEBUG]\", a)\n\tfmt.Fprintln(out, ans)\n\n}\n\n// 挿入ソート配列\ntype slist struct {\n\tl []int\n}\n\nfunc makeSlist() slist {\n\treturn slist{[]int{}}\n}\n\nfunc (s *slist) add(a int) {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\tif pos < len(s.l) {\n\t\ts.l = append(s.l[:pos+1], s.l[pos:]...)\n\t\ts.l[pos] = a\n\t} else {\n\t\ts.l = append(s.l, a)\n\t}\n}\nfunc (s slist) contains(a int) bool {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\treturn pos < len(s.l) && s.l[pos] == a\n}\n\n//------------------------------------------------------------------------------\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc printArray(a []int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i >= 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t}\n\t\tfmt.Fprint(out, a[i])\n\t}\n\tfmt.Fprintln(out)\n}\n\nfunc absInt(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc minInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc sign(x int) int {\n\tif x == 0 {\n\t\treturn 0\n\t}\n\tif x > 0 {\n\t\treturn 1\n\t}\n\treturn -1\n}\nfunc log10(x int) float64 {\n\treturn math.Log10(float64(x))\n}\nfunc divCeil(shi, bo int) int {\n\tans := shi / bo\n\tif shi%bo != 0 {\n\t\tans++\n\t}\n\treturn ans\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "sample_input": "cabacc\nabc\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02571", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are two strings S and T.\n\nLet us change some of the characters in S so that T will be a substring of S.\n\nAt least how many characters do we need to change?\n\nHere, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.\n\nConstraints\n\nThe lengths of S and T are each at least 1 and at most 1000.\n\nThe length of T is at most that of S.\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the minimum number of characters in S that need to be changed.\n\nSample Input 1\n\ncabacc\nabc\n\nSample Output 1\n\n1\n\nFor example, changing the fourth character a in S to c will match the second through fourth characters in S to T.\n\nSince S itself does not have T as its substring, this number of changes - one - is the minimum needed.\n\nSample Input 2\n\ncodeforces\natcoder\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2705, "cpu_time_ms": 4, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s558415586", "group_id": "codeNet:p02573", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\tuf := newUF(N)\n\tvar x, y int\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tuf.unite(x-1, y-1)\n\t}\n\tchecked := make([]int, uf.n)\n\tfor i := range checked {\n\t\tr := uf.root(i)\n\t\tchecked[r]++\n\t}\n\tfmt.Println(max(checked))\n\n}\n\ntype unionFind struct {\n\tpair []int\n\tn int\n}\n\nfunc newUF(N int) *unionFind {\n\tuf := new(unionFind)\n\tuf.n = N\n\tpair := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tpair[i] = i\n\t}\n\tuf.pair = pair\n\treturn uf\n}\nfunc (uf unionFind) unite(x int, y int) {\n\trx := uf.root(x)\n\try := uf.root(y)\n\tif rx != ry {\n\t\tuf.pair[rx] = ry\n\t}\n}\nfunc (uf unionFind) root(x int) int {\n\tr := x\n\tfor {\n\t\tif uf.pair[r] == r {\n\t\t\tbreak\n\t\t}\n\t\tr = uf.pair[r]\n\t}\n\treturn r\n}\nfunc (uf unionFind) same(x int, y int) bool {\n\trx := uf.root(x)\n\try := uf.root(y)\n\treturn rx == ry\n}\nfunc (uf unionFind) countTree() int {\n\tans := 0\n\tchecked := make([]bool, uf.n)\n\tfor i := range checked {\n\t\tr := uf.root(i)\n\t\tif checked[r] {\n\t\t\tchecked[r] = true\n\t\t\tans++\n\t\t}\n\t}\n\treturn ans\n}\nfunc max(a []int) int {\n\tmax := a[0]\n\tfor _, i := range a {\n\t\tif i > max {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n", "language": "Go", "metadata": {"date": 1599954123, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02573.html", "problem_id": "p02573", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02573/input.txt", "sample_output_relpath": "derived/input_output/data/p02573/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02573/Go/s558415586.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s558415586", "user_id": "u756195685"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\tuf := newUF(N)\n\tvar x, y int\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tuf.unite(x-1, y-1)\n\t}\n\tchecked := make([]int, uf.n)\n\tfor i := range checked {\n\t\tr := uf.root(i)\n\t\tchecked[r]++\n\t}\n\tfmt.Println(max(checked))\n\n}\n\ntype unionFind struct {\n\tpair []int\n\tn int\n}\n\nfunc newUF(N int) *unionFind {\n\tuf := new(unionFind)\n\tuf.n = N\n\tpair := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tpair[i] = i\n\t}\n\tuf.pair = pair\n\treturn uf\n}\nfunc (uf unionFind) unite(x int, y int) {\n\trx := uf.root(x)\n\try := uf.root(y)\n\tif rx != ry {\n\t\tuf.pair[rx] = ry\n\t}\n}\nfunc (uf unionFind) root(x int) int {\n\tr := x\n\tfor {\n\t\tif uf.pair[r] == r {\n\t\t\tbreak\n\t\t}\n\t\tr = uf.pair[r]\n\t}\n\treturn r\n}\nfunc (uf unionFind) same(x int, y int) bool {\n\trx := uf.root(x)\n\try := uf.root(y)\n\treturn rx == ry\n}\nfunc (uf unionFind) countTree() int {\n\tans := 0\n\tchecked := make([]bool, uf.n)\n\tfor i := range checked {\n\t\tr := uf.root(i)\n\t\tif checked[r] {\n\t\t\tchecked[r] = true\n\t\t\tans++\n\t\t}\n\t}\n\treturn ans\n}\nfunc max(a []int) int {\n\tmax := a[0]\n\tfor _, i := range a {\n\t\tif i > max {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "sample_input": "5 3\n1 2\n3 4\n5 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02573", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1147, "cpu_time_ms": 2206, "memory_kb": 8004}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s909842623", "group_id": "codeNet:p02576", "input_text": "// Takoyaki\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc takoyaki(n, x, t int) int {\n\treturn int(math.Ceil(float64(n)/float64(x))) * t\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\tt := sc.Text()\n\treturn strconv.Atoi(t)\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tn, _ := nextInt(sc)\n\tx, _ := nextInt(sc)\n\tt, _ := nextInt(sc)\n\n\tr := takoyaki(n, x, t)\n\tfmt.Println(r)\n}", "language": "Go", "metadata": {"date": 1598714865, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02576.html", "problem_id": "p02576", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02576/input.txt", "sample_output_relpath": "derived/input_output/data/p02576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02576/Go/s909842623.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909842623", "user_id": "u301059551"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "// Takoyaki\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc takoyaki(n, x, t int) int {\n\treturn int(math.Ceil(float64(n)/float64(x))) * t\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\tt := sc.Text()\n\treturn strconv.Atoi(t)\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tn, _ := nextInt(sc)\n\tx, _ := nextInt(sc)\n\tt, _ := nextInt(sc)\n\n\tr := takoyaki(n, x, t)\n\tfmt.Println(r)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "sample_input": "20 12 6\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02576", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 448, "cpu_time_ms": 7, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s943265047", "group_id": "codeNet:p02576", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\tX := nextInt()\n\tT := nextInt()\n\n\tfmt.Println((N + X - 1) / X * T)\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n\nfunc debug(args ...interface{}) {\n\tfmt.Fprintln(os.Stderr, args)\n}\n", "language": "Go", "metadata": {"date": 1598122907, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02576.html", "problem_id": "p02576", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02576/input.txt", "sample_output_relpath": "derived/input_output/data/p02576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02576/Go/s943265047.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s943265047", "user_id": "u578274732"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\tX := nextInt()\n\tT := nextInt()\n\n\tfmt.Println((N + X - 1) / X * T)\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n\nfunc debug(args ...interface{}) {\n\tfmt.Fprintln(os.Stderr, args)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "sample_input": "20 12 6\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02576", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 740, "cpu_time_ms": 7, "memory_kb": 1804}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s200875956", "group_id": "codeNet:p02577", "input_text": "//go:generate echo \"https://atcoder.jp/contests/abc176/tasks/abc176_b\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) StringSlice(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc solve(n string) bool {\n\tsum := 0\n\tfor _, c := range n {\n\t\tn, _ := strconv.Atoi(string(c))\n\t\tsum += n\n\t}\n\treturn sum%9 == 0\n}\n\nfunc main() {\n\tscan := newScanner(os.Stdin)\n\tn := scan.String()\n\tif solve(n) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1599660529, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02577.html", "problem_id": "p02577", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02577/input.txt", "sample_output_relpath": "derived/input_output/data/p02577/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02577/Go/s200875956.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s200875956", "user_id": "u890085018"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/abc176/tasks/abc176_b\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) StringSlice(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc solve(n string) bool {\n\tsum := 0\n\tfor _, c := range n {\n\t\tn, _ := strconv.Atoi(string(c))\n\t\tsum += n\n\t}\n\treturn sum%9 == 0\n}\n\nfunc main() {\n\tscan := newScanner(os.Stdin)\n\tn := scan.String()\n\tif solve(n) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "sample_input": "123456789\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02577", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 819, "cpu_time_ms": 14, "memory_kb": 2452}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s387128728", "group_id": "codeNet:p02579", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst inf = 1000000000\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\ntype PriorityQueueItem struct {\n\tvalue int\n\tpriority int\n}\n\ntype PrioirtyQueue struct {\n\titems []PriorityQueueItem\n\tvalue2Index map[int]int\n}\n\nfunc newPriorityQueue() *PrioirtyQueue {\n\tq := new(PrioirtyQueue)\n\tq.value2Index = make(map[int]int, 0)\n\treturn q\n}\n\nfunc (q *PrioirtyQueue) Len() int {\n\treturn len(q.items)\n}\nfunc (q *PrioirtyQueue) Less(i, j int) bool {\n\treturn q.items[i].priority < q.items[j].priority\n}\nfunc (q *PrioirtyQueue) Swap(i, j int) {\n\tq.items[i], q.items[j] = q.items[j], q.items[i]\n\tq.value2Index[q.items[i].value] = i\n\tq.value2Index[q.items[j].value] = j\n}\nfunc (q *PrioirtyQueue) Push(x interface{}) {\n\tq.items = append(q.items, x.(PriorityQueueItem))\n\tq.value2Index[x.(PriorityQueueItem).value] = len(q.items) - 1\n}\nfunc (q *PrioirtyQueue) Pop() interface{} {\n\tx := q.items[len(q.items)-1]\n\tq.items = q.items[0 : len(q.items)-1]\n\tdelete(q.value2Index, x.value)\n\treturn x\n}\nfunc (q *PrioirtyQueue) update(x PriorityQueueItem) {\n\tq.items[q.value2Index[x.value]] = x\n\theap.Fix(q, q.value2Index[x.value])\n}\n\ntype AdjacencyList struct {\n\tnode int\n\tcost int\n\tnext *AdjacencyList\n}\n\nfunc dijkstra(als []*AdjacencyList, s int) []int {\n\tds := make([]int, len(als))\n\tq := newPriorityQueue()\n\tfor v := 0; v < len(als); v++ {\n\t\tif v == s {\n\t\t\tds[v] = 0\n\t\t} else {\n\t\t\tds[v] = inf\n\t\t}\n\t\tq.Push(PriorityQueueItem{v, ds[v]})\n\t}\n\theap.Init(q)\n\tfor q.Len() != 0 {\n\t\tu := heap.Pop(q).(PriorityQueueItem).value\n\t\tfor al := als[u]; al != nil; al = al.next {\n\t\t\tif ds[u]+al.cost < ds[al.node] {\n\t\t\t\tds[al.node] = ds[u] + al.cost\n\t\t\t\tq.update(PriorityQueueItem{al.node, ds[al.node]})\n\t\t\t}\n\t\t}\n\t}\n\treturn ds\n}\n\nfunc main() {\n\tvar H, W int\n\tfmt.Scanf(\"%d%d\", &H, &W)\n\tvar Ch, Cw int\n\tfmt.Scanf(\"%d%d\", &Ch, &Cw)\n\tCh--\n\tCw--\n\tvar Dh, Dw int\n\tfmt.Scanf(\"%d%d\", &Dh, &Dw)\n\tDh--\n\tDw--\n\treader := bufio.NewReader(os.Stdin)\n\tbytes, _ := reader.ReadBytes(0)\n\tbytesIndex := 0\n\tS := make([][]byte, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = make([]byte, W)\n\t\tfor j := 0; j < W; j++ {\n\t\t\tS[i][j] = bytes[bytesIndex]\n\t\t\tbytesIndex++\n\t\t}\n\t\tbytesIndex++\n\t}\n\tals := make([]*AdjacencyList, H*W)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif S[i][j] == '#' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := -2; k <= 2; k++ {\n\t\t\t\tfor l := -2; l <= 2; l++ {\n\t\t\t\t\tif i+k < 0 || i+k >= H || j+l < 0 || j+l >= W || (k == 0 && l == 0) || S[i+k][j+l] == '#' {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tal := new(AdjacencyList)\n\t\t\t\t\tal.node = (i+k)*W + j + l\n\t\t\t\t\tif abs(k)+abs(l) == 1 {\n\t\t\t\t\t\tal.cost = 0\n\t\t\t\t\t} else {\n\t\t\t\t\t\tal.cost = 1\n\t\t\t\t\t}\n\t\t\t\t\tal.next = als[i*W+j]\n\t\t\t\t\tals[i*W+j] = al\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\ts := Ch*W + Cw\n\tg := Dh*W + Dw\n\tdsg := dijkstra(als, s)[g]\n\tif dsg == inf {\n\t\tfmt.Printf(\"-1\\n\")\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", dsg)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1598463094, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02579.html", "problem_id": "p02579", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02579/input.txt", "sample_output_relpath": "derived/input_output/data/p02579/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02579/Go/s387128728.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s387128728", "user_id": "u014272610"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst inf = 1000000000\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\ntype PriorityQueueItem struct {\n\tvalue int\n\tpriority int\n}\n\ntype PrioirtyQueue struct {\n\titems []PriorityQueueItem\n\tvalue2Index map[int]int\n}\n\nfunc newPriorityQueue() *PrioirtyQueue {\n\tq := new(PrioirtyQueue)\n\tq.value2Index = make(map[int]int, 0)\n\treturn q\n}\n\nfunc (q *PrioirtyQueue) Len() int {\n\treturn len(q.items)\n}\nfunc (q *PrioirtyQueue) Less(i, j int) bool {\n\treturn q.items[i].priority < q.items[j].priority\n}\nfunc (q *PrioirtyQueue) Swap(i, j int) {\n\tq.items[i], q.items[j] = q.items[j], q.items[i]\n\tq.value2Index[q.items[i].value] = i\n\tq.value2Index[q.items[j].value] = j\n}\nfunc (q *PrioirtyQueue) Push(x interface{}) {\n\tq.items = append(q.items, x.(PriorityQueueItem))\n\tq.value2Index[x.(PriorityQueueItem).value] = len(q.items) - 1\n}\nfunc (q *PrioirtyQueue) Pop() interface{} {\n\tx := q.items[len(q.items)-1]\n\tq.items = q.items[0 : len(q.items)-1]\n\tdelete(q.value2Index, x.value)\n\treturn x\n}\nfunc (q *PrioirtyQueue) update(x PriorityQueueItem) {\n\tq.items[q.value2Index[x.value]] = x\n\theap.Fix(q, q.value2Index[x.value])\n}\n\ntype AdjacencyList struct {\n\tnode int\n\tcost int\n\tnext *AdjacencyList\n}\n\nfunc dijkstra(als []*AdjacencyList, s int) []int {\n\tds := make([]int, len(als))\n\tq := newPriorityQueue()\n\tfor v := 0; v < len(als); v++ {\n\t\tif v == s {\n\t\t\tds[v] = 0\n\t\t} else {\n\t\t\tds[v] = inf\n\t\t}\n\t\tq.Push(PriorityQueueItem{v, ds[v]})\n\t}\n\theap.Init(q)\n\tfor q.Len() != 0 {\n\t\tu := heap.Pop(q).(PriorityQueueItem).value\n\t\tfor al := als[u]; al != nil; al = al.next {\n\t\t\tif ds[u]+al.cost < ds[al.node] {\n\t\t\t\tds[al.node] = ds[u] + al.cost\n\t\t\t\tq.update(PriorityQueueItem{al.node, ds[al.node]})\n\t\t\t}\n\t\t}\n\t}\n\treturn ds\n}\n\nfunc main() {\n\tvar H, W int\n\tfmt.Scanf(\"%d%d\", &H, &W)\n\tvar Ch, Cw int\n\tfmt.Scanf(\"%d%d\", &Ch, &Cw)\n\tCh--\n\tCw--\n\tvar Dh, Dw int\n\tfmt.Scanf(\"%d%d\", &Dh, &Dw)\n\tDh--\n\tDw--\n\treader := bufio.NewReader(os.Stdin)\n\tbytes, _ := reader.ReadBytes(0)\n\tbytesIndex := 0\n\tS := make([][]byte, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = make([]byte, W)\n\t\tfor j := 0; j < W; j++ {\n\t\t\tS[i][j] = bytes[bytesIndex]\n\t\t\tbytesIndex++\n\t\t}\n\t\tbytesIndex++\n\t}\n\tals := make([]*AdjacencyList, H*W)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif S[i][j] == '#' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := -2; k <= 2; k++ {\n\t\t\t\tfor l := -2; l <= 2; l++ {\n\t\t\t\t\tif i+k < 0 || i+k >= H || j+l < 0 || j+l >= W || (k == 0 && l == 0) || S[i+k][j+l] == '#' {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tal := new(AdjacencyList)\n\t\t\t\t\tal.node = (i+k)*W + j + l\n\t\t\t\t\tif abs(k)+abs(l) == 1 {\n\t\t\t\t\t\tal.cost = 0\n\t\t\t\t\t} else {\n\t\t\t\t\t\tal.cost = 1\n\t\t\t\t\t}\n\t\t\t\t\tal.next = als[i*W+j]\n\t\t\t\t\tals[i*W+j] = al\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\ts := Ch*W + Cw\n\tg := Dh*W + Dw\n\tdsg := dijkstra(als, s)[g]\n\tif dsg == inf {\n\t\tfmt.Printf(\"-1\\n\")\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", dsg)\n\t}\n\treturn\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "sample_input": "4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02579", "source_text": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2872, "cpu_time_ms": 2216, "memory_kb": 396760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s222748918", "group_id": "codeNet:p02583", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/bits\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n < 3 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tl := make([]int, n)\n\tfor i := range l {\n\t\tfmt.Scan(&l[i])\n\t}\n\tvar ans int\n\n\tx := Combinations(l, 3)\n\tfor _, v := range x {\n\t\tsort.Ints(v)\n\t\tif !(v[0]+v[1] < v[2]) {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc Combinations(set []int, n int) (subsets [][]int) {\n\tlength := uint(len(set))\n\n\tif n > len(set) {\n\t\tn = len(set)\n\t}\n\n\t// Go through all possible combinations of objects\n\t// from 1 (only first object in subset) to 2^length (all objects in subset)\n\tfor subsetBits := 1; subsetBits < (1 << length); subsetBits++ {\n\t\tif n > 0 && bits.OnesCount(uint(subsetBits)) != n {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar subset []int\n\n\t\tfor object := uint(0); object < length; object++ {\n\t\t\t// checks if object is contained in subset\n\t\t\t// by checking if bit 'object' is set in subsetBits\n\t\t\tif (subsetBits>>object)&1 == 1 {\n\t\t\t\t// add object to subset\n\t\t\t\tsubset = append(subset, set[object])\n\t\t\t}\n\t\t}\n\t\t// add subset to subsets\n\t\tsubsets = append(subsets, subset)\n\t}\n\treturn subsets\n}\n", "language": "Go", "metadata": {"date": 1597519106, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02583.html", "problem_id": "p02583", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02583/input.txt", "sample_output_relpath": "derived/input_output/data/p02583/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02583/Go/s222748918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s222748918", "user_id": "u507027929"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/bits\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n < 3 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tl := make([]int, n)\n\tfor i := range l {\n\t\tfmt.Scan(&l[i])\n\t}\n\tvar ans int\n\n\tx := Combinations(l, 3)\n\tfor _, v := range x {\n\t\tsort.Ints(v)\n\t\tif !(v[0]+v[1] < v[2]) {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc Combinations(set []int, n int) (subsets [][]int) {\n\tlength := uint(len(set))\n\n\tif n > len(set) {\n\t\tn = len(set)\n\t}\n\n\t// Go through all possible combinations of objects\n\t// from 1 (only first object in subset) to 2^length (all objects in subset)\n\tfor subsetBits := 1; subsetBits < (1 << length); subsetBits++ {\n\t\tif n > 0 && bits.OnesCount(uint(subsetBits)) != n {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar subset []int\n\n\t\tfor object := uint(0); object < length; object++ {\n\t\t\t// checks if object is contained in subset\n\t\t\t// by checking if bit 'object' is set in subsetBits\n\t\t\tif (subsetBits>>object)&1 == 1 {\n\t\t\t\t// add object to subset\n\t\t\t\tsubset = append(subset, set[object])\n\t\t\t}\n\t\t}\n\t\t// add subset to subsets\n\t\tsubsets = append(subsets, subset)\n\t}\n\treturn subsets\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "sample_input": "5\n4 4 9 7 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02583", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\n\nThat is, find the number of triples of integers (i, j, k) (1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nL_i, L_j, and L_k are all different.\n\nThere exists a triangle whose sides have lengths L_i, L_j, and L_k.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 \\cdots L_N\n\nOutput\n\nPrint the number of ways to choose three of the sticks with different lengths that can form a triangle.\n\nSample Input 1\n\n5\n4 4 9 7 5\n\nSample Output 1\n\n5\n\nThe following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).\n\nSample Input 2\n\n6\n4 5 4 3 3 5\n\nSample Output 2\n\n8\n\nWe have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.\n\nThere is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.\n\nSample Input 3\n\n10\n9 4 6 1 9 6 10 6 6 8\n\nSample Output 3\n\n39\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\n0\n\nNo triple (i, j, k) satisfies 1 \\leq i < j < k \\leq N, so we should print 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1096, "cpu_time_ms": 2205, "memory_kb": 2448}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s925689324", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInt3() (int, int, int) {\n\treturn nextInt(), nextInt(), nextInt()\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(nums ...int) int {\n\tret := nums[0]\n\tfor _, v := range nums {\n\t\tif v < ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tx, k, d := nextInt3()\n\n\tvar ans int\n\tif abs(x) > d*k {\n\t\tans = min(abs(x-d*k), abs(x+d*k))\n\t\tputs(ans)\n\t\treturn\n\t}\n\n\tx, k = x-(x/d)*d, k-abs(x)/d\n\tif k%2 == 0 {\n\t\tans = x\n\t} else if x > 0 {\n\t\tans = x - d\n\t} else {\n\t\tans = x + d\n\t}\n\tputs(abs(ans))\n}\n", "language": "Go", "metadata": {"date": 1598644926, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02584.html", "problem_id": "p02584", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02584/input.txt", "sample_output_relpath": "derived/input_output/data/p02584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02584/Go/s925689324.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s925689324", "user_id": "u502813058"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInt3() (int, int, int) {\n\treturn nextInt(), nextInt(), nextInt()\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(nums ...int) int {\n\tret := nums[0]\n\tfor _, v := range nums {\n\t\tif v < ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tx, k, d := nextInt3()\n\n\tvar ans int\n\tif abs(x) > d*k {\n\t\tans = min(abs(x-d*k), abs(x+d*k))\n\t\tputs(ans)\n\t\treturn\n\t}\n\n\tx, k = x-(x/d)*d, k-abs(x)/d\n\tif k%2 == 0 {\n\t\tans = x\n\t} else if x > 0 {\n\t\tans = x - d\n\t} else {\n\t\tans = x + d\n\t}\n\tputs(abs(ans))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "sample_input": "6 2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02584", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 991, "cpu_time_ms": 5, "memory_kb": 1784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s905787318", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x, k, d int\n\tfmt.Scan(&x, &k, &d)\n\tx = int(math.Abs(float64(x)))\n\tfor x > 0 {\n\t\tx = x - d\n\t\tk--\n\t\tif k == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tif k >= 2 {\n\t\ts := 0\n\t\tfor k >= 1 {\n\t\t\tif s == 0 {\n\t\t\t\tx += d\n\t\t\t\ts = 1\n\t\t\t} else {\n\t\t\t\tx -= d\n\t\t\t\ts = 0\n\t\t\t}\n\t\t}\n\t}\n\tmin := int(math.Abs(float64(x)))\n\tif int(math.Abs(float64(x+d))) < min {\n\t\tfmt.Println(int(math.Abs(float64(x + d))))\n\t\treturn\n\t}\n\tif int(math.Abs(float64(x-d))) < min {\n\t\tfmt.Println(int(math.Abs(float64(x - d))))\n\t\treturn\n\t}\n\tfmt.Println(min)\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1597523576, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02584.html", "problem_id": "p02584", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02584/input.txt", "sample_output_relpath": "derived/input_output/data/p02584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02584/Go/s905787318.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s905787318", "user_id": "u507027929"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x, k, d int\n\tfmt.Scan(&x, &k, &d)\n\tx = int(math.Abs(float64(x)))\n\tfor x > 0 {\n\t\tx = x - d\n\t\tk--\n\t\tif k == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tif k >= 2 {\n\t\ts := 0\n\t\tfor k >= 1 {\n\t\t\tif s == 0 {\n\t\t\t\tx += d\n\t\t\t\ts = 1\n\t\t\t} else {\n\t\t\t\tx -= d\n\t\t\t\ts = 0\n\t\t\t}\n\t\t}\n\t}\n\tmin := int(math.Abs(float64(x)))\n\tif int(math.Abs(float64(x+d))) < min {\n\t\tfmt.Println(int(math.Abs(float64(x + d))))\n\t\treturn\n\t}\n\tif int(math.Abs(float64(x-d))) < min {\n\t\tfmt.Println(int(math.Abs(float64(x - d))))\n\t\treturn\n\t}\n\tfmt.Println(min)\n\treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "sample_input": "6 2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02584", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 560, "cpu_time_ms": 2205, "memory_kb": 1860}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s390215458", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, k, d int\n\tfmt.Scan(&x, &k, &d)\n\n\tx = abs(x)\n\tc := min(k, max(1, x/d))\n\tx = abs(x - c*d)\n\tk -= c\n\tif k == 0 {\n\t\tfmt.Println(abs(x))\n\t\treturn\n\t}\n\n\tif k%2 == 1 {\n\t\tx = abs(x - d)\n\t}\n\n\tfmt.Println(x)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1597523501, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02584.html", "problem_id": "p02584", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02584/input.txt", "sample_output_relpath": "derived/input_output/data/p02584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02584/Go/s390215458.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390215458", "user_id": "u902409225"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, k, d int\n\tfmt.Scan(&x, &k, &d)\n\n\tx = abs(x)\n\tc := min(k, max(1, x/d))\n\tx = abs(x - c*d)\n\tk -= c\n\tif k == 0 {\n\t\tfmt.Println(abs(x))\n\t\treturn\n\t}\n\n\tif k%2 == 1 {\n\t\tx = abs(x - d)\n\t}\n\n\tfmt.Println(x)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "sample_input": "6 2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02584", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 437, "cpu_time_ms": 8, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s572318739", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tN := nextInt()\n\tK := nextInt()\n\tD := nextInt()\n\tTOTAL := K * D\n\tMIN := N / D\n\tif TOTAL <= N {\n\t\tfmt.Println(N - TOTAL)\n\t} else {\n\t\tif (K-MIN)%2 == 0 {\n\t\t\tfmt.Println(abs(TOTAL - N - D*(K-MIN)))\n\t\t} else {\n\t\t\tfmt.Println(abs(TOTAL-N-D*(K-MIN)) + D)\n\t\t}\n\t}\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\tn = -n\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1597520645, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02584.html", "problem_id": "p02584", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02584/input.txt", "sample_output_relpath": "derived/input_output/data/p02584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02584/Go/s572318739.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s572318739", "user_id": "u467535434"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tN := nextInt()\n\tK := nextInt()\n\tD := nextInt()\n\tTOTAL := K * D\n\tMIN := N / D\n\tif TOTAL <= N {\n\t\tfmt.Println(N - TOTAL)\n\t} else {\n\t\tif (K-MIN)%2 == 0 {\n\t\t\tfmt.Println(abs(TOTAL - N - D*(K-MIN)))\n\t\t} else {\n\t\t\tfmt.Println(abs(TOTAL-N-D*(K-MIN)) + D)\n\t\t}\n\t}\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\tn = -n\n\t}\n\treturn n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "sample_input": "6 2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02584", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 970, "cpu_time_ms": 8, "memory_kb": 1808}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s753453640", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, d, k int64\n\tfmt.Scan(&x)\n\tfmt.Scan(&k)\n\tfmt.Scan(&d)\n\tif x < 0 {\n\t\tx = -x\n\t}\n\tif d * k <= x {\n\t\tfmt.Println(x - d * k)\n\t\treturn\n\t}\n\tb := x/d\n\tm := k - b\n\tif m % 2 == 0 {\n\t\tfmt.Println(x - d * b)\n\t\treturn\n\t}\n\tfmt.Println((b+1) * d - x)\n}", "language": "Go", "metadata": {"date": 1597520048, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02584.html", "problem_id": "p02584", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02584/input.txt", "sample_output_relpath": "derived/input_output/data/p02584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02584/Go/s753453640.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s753453640", "user_id": "u686302771"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, d, k int64\n\tfmt.Scan(&x)\n\tfmt.Scan(&k)\n\tfmt.Scan(&d)\n\tif x < 0 {\n\t\tx = -x\n\t}\n\tif d * k <= x {\n\t\tfmt.Println(x - d * k)\n\t\treturn\n\t}\n\tb := x/d\n\tm := k - b\n\tif m % 2 == 0 {\n\t\tfmt.Println(x - d * b)\n\t\treturn\n\t}\n\tfmt.Println((b+1) * d - x)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "sample_input": "6 2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02584", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 286, "cpu_time_ms": 5, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s722878417", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tX, K, D := ReadInt(), ReadInt(), ReadInt()\n\tif X < 0 {\n\t\tX = -X\n\t}\n\tL := (X + D - 1) / D\n\tif K < L {\n\t\tfmt.Println(X - K*D)\n\t\treturn\n\t}\n\tlx := X - L*D\n\tif lx == 0 {\n\t\tif (K-L)%2 == 0 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(D)\n\t\t}\n\t\treturn\n\t}\n\tif (K-L)%2 == 1 {\n\t\tfmt.Println(X % D)\n\t} else {\n\t\tfmt.Println(D - X%D)\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1597519847, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02584.html", "problem_id": "p02584", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02584/input.txt", "sample_output_relpath": "derived/input_output/data/p02584/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02584/Go/s722878417.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s722878417", "user_id": "u328656362"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tX, K, D := ReadInt(), ReadInt(), ReadInt()\n\tif X < 0 {\n\t\tX = -X\n\t}\n\tL := (X + D - 1) / D\n\tif K < L {\n\t\tfmt.Println(X - K*D)\n\t\treturn\n\t}\n\tlx := X - L*D\n\tif lx == 0 {\n\t\tif (K-L)%2 == 0 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(D)\n\t\t}\n\t\treturn\n\t}\n\tif (K-L)%2 == 1 {\n\t\tfmt.Println(X % D)\n\t} else {\n\t\tfmt.Println(D - X%D)\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "sample_input": "6 2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02584", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.\n\nFind the minimum possible absolute value of the coordinate of the destination.\n\nConstraints\n\n-10^{15} \\leq X \\leq 10^{15}\n\n1 \\leq K \\leq 10^{15}\n\n1 \\leq D \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX K D\n\nOutput\n\nPrint the minimum possible absolute value of the coordinate of the destination.\n\nSample Input 1\n\n6 2 4\n\nSample Output 1\n\n2\n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\nMove from coordinate 6 to (6 - 4 =) 2.\n\nMove from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we cannot make it smaller.\n\nSample Input 2\n\n7 4 3\n\nSample Output 2\n\n1\n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the following moves:\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 7.\n\nMove from coordinate 7 to 4.\n\nMove from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we cannot make it smaller.\n\nSample Input 3\n\n10 1 2\n\nSample Output 3\n\n8\n\nSample Input 4\n\n1000000000000000 1000000000000000 1000000000000000\n\nSample Output 4\n\n1000000000000000\n\nThe answer can be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 735, "cpu_time_ms": 6, "memory_kb": 1840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s244053538", "group_id": "codeNet:p02585", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Inf = 1 << 60\n\nfunc main() {\n\tN, K := ReadInt(), ReadInt()\n\tP := ReadInts(N)\n\tC := ReadInts(N)\n\n\tfor i := 0; i < N; i++ {\n\t\tP[i]--\n\t}\n\n\tmaxScore := -Inf\n\tfor i := 0; i < N; i++ {\n\t\tseen := make([]bool, N)\n\t\tvar dfs func(v int) (int, int)\n\t\tdfs = func(v int) (int, int) {\n\t\t\tif seen[v] {\n\t\t\t\treturn 0, 0\n\t\t\t}\n\t\t\tseen[v] = true\n\t\t\tsize, score := dfs(P[v])\n\t\t\treturn size + 1, C[v] + score\n\t\t}\n\t\tsize, loopScore := dfs(i)\n\n\t\tscore := 0\n\t\trest := 0\n\t\tif loopScore > 0 {\n\t\t\tloop := K/size - 1\n\t\t\tscore += loop * loopScore\n\t\t\trest = K - loop*size\n\t\t\tif score > maxScore {\n\t\t\t\tmaxScore = score\n\t\t\t}\n\t\t} else {\n\t\t\trest = size\n\t\t}\n\t\tv := i\n\t\tfor j := 0; j < rest; j++ {\n\t\t\tv = P[v]\n\t\t\tscore += C[v]\n\t\t\tif score > maxScore {\n\t\t\t\tmaxScore = score\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(maxScore)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1599103845, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02585.html", "problem_id": "p02585", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02585/input.txt", "sample_output_relpath": "derived/input_output/data/p02585/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02585/Go/s244053538.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s244053538", "user_id": "u328656362"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Inf = 1 << 60\n\nfunc main() {\n\tN, K := ReadInt(), ReadInt()\n\tP := ReadInts(N)\n\tC := ReadInts(N)\n\n\tfor i := 0; i < N; i++ {\n\t\tP[i]--\n\t}\n\n\tmaxScore := -Inf\n\tfor i := 0; i < N; i++ {\n\t\tseen := make([]bool, N)\n\t\tvar dfs func(v int) (int, int)\n\t\tdfs = func(v int) (int, int) {\n\t\t\tif seen[v] {\n\t\t\t\treturn 0, 0\n\t\t\t}\n\t\t\tseen[v] = true\n\t\t\tsize, score := dfs(P[v])\n\t\t\treturn size + 1, C[v] + score\n\t\t}\n\t\tsize, loopScore := dfs(i)\n\n\t\tscore := 0\n\t\trest := 0\n\t\tif loopScore > 0 {\n\t\t\tloop := K/size - 1\n\t\t\tscore += loop * loopScore\n\t\t\trest = K - loop*size\n\t\t\tif score > maxScore {\n\t\t\t\tmaxScore = score\n\t\t\t}\n\t\t} else {\n\t\t\trest = size\n\t\t}\n\t\tv := i\n\t\tfor j := 0; j < rest; j++ {\n\t\t\tv = P[v]\n\t\t\tscore += C[v]\n\t\t\tif score > maxScore {\n\t\t\t\tmaxScore = score\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(maxScore)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "sample_input": "5 2\n2 4 5 1 3\n3 4 -10 -8 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02585", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1174, "cpu_time_ms": 483, "memory_kb": 7016}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s250059081", "group_id": "codeNet:p02585", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n}\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\tn, _ := strconv.Atoi(ReadString())\n\treturn n\n}\n\n// 10 11 12 => [10, 11, 12]\nfunc readIntSlice(size int) []int {\n\ta := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc get2byte(size int) [][]byte {\n\ta := make([][]byte, size)\n\tfor i := 0; i < size; i++ {\n\t\tvar low string\n\t\tfmt.Scan(&low)\n\t\ta[i] = []byte(low)\n\t}\n\treturn a\n}\n\nfunc transpose(a [][]int) {\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\ta[i][j], a[j][i] = a[j][i], a[i][j]\n\t\t}\n\t}\n}\n\nfunc fact(n, m int) int {\n\tres := 1\n\tfor i := m + 1; i <= n; i++ {\n\t\tres *= i\n\t}\n\treturn res\n}\n\nfunc perm(n, r int) int {\n\tif r > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-r)\n}\n\nfunc comb(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-m) / fact(m, 0)\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\nfunc sum(integers ...int) int64 {\n\tvar res int64\n\tfor _, integer := range integers {\n\t\tres += int64(integer)\n\t}\n\treturn res\n}\nfunc cumulativeSum(as []int) []int64 {\n\tcs := make([]int64, len(as)+1)\n\tfor i, a := range as {\n\t\tcs[i+1] = cs[i] + int64(a)\n\t}\n\treturn cs\n}\n\nfunc main() {\n\tn, k := readInt(), readInt()\n\tps := readIntSlice(n)\n\tcs := readIntSlice(n)\n\n\tfmt.Println(naiveSolve(n, k, ps, cs))\n}\n\nfunc naiveSolve(n, k int, ps, cs []int) int64 {\n\tvar max int64 = -10000000000\n\tfor i := 0; i < n; i++ {\n\t\tvar sum int64\n\t\tj := ps[i] - 1\n\t\tvar counter int\n\n\t\tfor counter < k {\n\t\t\tsum += int64(cs[j])\n\t\t\tif max < sum {\n\t\t\t\tmax = sum\n\t\t\t}\n\t\t\tj = ps[j] - 1\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn max\n}\n\nfunc solve(n, k int, ps, cs []int) int64 {\n\tvisited := make(map[int]struct{})\n\tvar arrays [][]int\n\tfor i := 0; i < n; i++ {\n\t\tif _, ok := visited[i]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tvar as []int\n\t\tvisited[i] = struct{}{}\n\t\tas = append(as, cs[i])\n\t\tj := ps[i] - 1\n\t\tfor j != i {\n\t\t\tas = append(as, cs[j])\n\t\t\tvisited[j] = struct{}{}\n\t\t\tj = ps[j] - 1\n\t\t}\n\t\tarrays = append(arrays, as)\n\t}\n\tvar max int64\n\tmax = -10000000000\n\tfor _, as := range arrays {\n\t\ttmp := calcMaxScore(as, k)\n\t\tif max < tmp {\n\t\t\tmax = tmp\n\t\t}\n\t}\n\treturn max\n}\n\nfunc calcMaxScore(as []int, k int) int64 {\n\tn := len(as)\n\tloopArray := append(as, as...)\n\tloopArray = append(loopArray, as...)\n\tstart := 0\n\tend := 1\n\tcs := cumulativeSum(loopArray)\n\tsum := sum(as...)\n\tvar baseScore int64\n\tif sum > 0 {\n\t\tcount := k/n - 1\n\t\tbaseScore = sum * int64(count)\n\t}\n\tvar calcRange int\n\tif k%n == 0 {\n\t\tcalcRange = n\n\t} else {\n\t\tcalcRange = k%n + n\n\t}\n\tvar max int64\n\tmax = -10000000000\n\tfor end < len(loopArray) || (loopArray[start] < 0 && start != end-1) {\n\t\tif start != end-1 && loopArray[start] < 0 {\n\t\t\tstart++\n\t\t}\n\t\tsum := cs[end] - cs[start]\n\t\tif sum > max {\n\t\t\tmax = sum\n\t\t}\n\t\tif calcRange == 1 {\n\t\t\tstart++\n\t\t\tend++\n\t\t} else if end-start == calcRange {\n\t\t\tstart++\n\t\t} else if end < len(loopArray) {\n\t\t\tend++\n\t\t}\n\t}\n\treturn max + baseScore\n}\n", "language": "Go", "metadata": {"date": 1597696207, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02585.html", "problem_id": "p02585", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02585/input.txt", "sample_output_relpath": "derived/input_output/data/p02585/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02585/Go/s250059081.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s250059081", "user_id": "u884847580"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n}\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\tn, _ := strconv.Atoi(ReadString())\n\treturn n\n}\n\n// 10 11 12 => [10, 11, 12]\nfunc readIntSlice(size int) []int {\n\ta := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc get2byte(size int) [][]byte {\n\ta := make([][]byte, size)\n\tfor i := 0; i < size; i++ {\n\t\tvar low string\n\t\tfmt.Scan(&low)\n\t\ta[i] = []byte(low)\n\t}\n\treturn a\n}\n\nfunc transpose(a [][]int) {\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\ta[i][j], a[j][i] = a[j][i], a[i][j]\n\t\t}\n\t}\n}\n\nfunc fact(n, m int) int {\n\tres := 1\n\tfor i := m + 1; i <= n; i++ {\n\t\tres *= i\n\t}\n\treturn res\n}\n\nfunc perm(n, r int) int {\n\tif r > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-r)\n}\n\nfunc comb(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-m) / fact(m, 0)\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\nfunc sum(integers ...int) int64 {\n\tvar res int64\n\tfor _, integer := range integers {\n\t\tres += int64(integer)\n\t}\n\treturn res\n}\nfunc cumulativeSum(as []int) []int64 {\n\tcs := make([]int64, len(as)+1)\n\tfor i, a := range as {\n\t\tcs[i+1] = cs[i] + int64(a)\n\t}\n\treturn cs\n}\n\nfunc main() {\n\tn, k := readInt(), readInt()\n\tps := readIntSlice(n)\n\tcs := readIntSlice(n)\n\n\tfmt.Println(naiveSolve(n, k, ps, cs))\n}\n\nfunc naiveSolve(n, k int, ps, cs []int) int64 {\n\tvar max int64 = -10000000000\n\tfor i := 0; i < n; i++ {\n\t\tvar sum int64\n\t\tj := ps[i] - 1\n\t\tvar counter int\n\n\t\tfor counter < k {\n\t\t\tsum += int64(cs[j])\n\t\t\tif max < sum {\n\t\t\t\tmax = sum\n\t\t\t}\n\t\t\tj = ps[j] - 1\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn max\n}\n\nfunc solve(n, k int, ps, cs []int) int64 {\n\tvisited := make(map[int]struct{})\n\tvar arrays [][]int\n\tfor i := 0; i < n; i++ {\n\t\tif _, ok := visited[i]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tvar as []int\n\t\tvisited[i] = struct{}{}\n\t\tas = append(as, cs[i])\n\t\tj := ps[i] - 1\n\t\tfor j != i {\n\t\t\tas = append(as, cs[j])\n\t\t\tvisited[j] = struct{}{}\n\t\t\tj = ps[j] - 1\n\t\t}\n\t\tarrays = append(arrays, as)\n\t}\n\tvar max int64\n\tmax = -10000000000\n\tfor _, as := range arrays {\n\t\ttmp := calcMaxScore(as, k)\n\t\tif max < tmp {\n\t\t\tmax = tmp\n\t\t}\n\t}\n\treturn max\n}\n\nfunc calcMaxScore(as []int, k int) int64 {\n\tn := len(as)\n\tloopArray := append(as, as...)\n\tloopArray = append(loopArray, as...)\n\tstart := 0\n\tend := 1\n\tcs := cumulativeSum(loopArray)\n\tsum := sum(as...)\n\tvar baseScore int64\n\tif sum > 0 {\n\t\tcount := k/n - 1\n\t\tbaseScore = sum * int64(count)\n\t}\n\tvar calcRange int\n\tif k%n == 0 {\n\t\tcalcRange = n\n\t} else {\n\t\tcalcRange = k%n + n\n\t}\n\tvar max int64\n\tmax = -10000000000\n\tfor end < len(loopArray) || (loopArray[start] < 0 && start != end-1) {\n\t\tif start != end-1 && loopArray[start] < 0 {\n\t\t\tstart++\n\t\t}\n\t\tsum := cs[end] - cs[start]\n\t\tif sum > max {\n\t\t\tmax = sum\n\t\t}\n\t\tif calcRange == 1 {\n\t\t\tstart++\n\t\t\tend++\n\t\t} else if end-start == calcRange {\n\t\t\tstart++\n\t\t} else if end < len(loopArray) {\n\t\t\tend++\n\t\t}\n\t}\n\treturn max + baseScore\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "sample_input": "5 2\n2 4 5 1 3\n3 4 -10 -8 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02585", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3764, "cpu_time_ms": 3308, "memory_kb": 1968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s437125336", "group_id": "codeNet:p02585", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tK := getInt()\n\tP := getIntArray(N)\n\tC := getIntArray(N)\n\n\tg := NewGraph(N, C)\n\tfor i := 0; i < N; i++ {\n\t\tg.AddEdge(i, P[i]-1)\n\t}\n\n\troutes := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\troute := make([]int, 0)\n\t\tdfs(i, g.edges, make(map[int]struct{}), &route)\n\t\troutes[i] = route\n\t}\n\n\tpoints := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\troutePoint := 0\n\t\tfor _, p := range routes[i] {\n\t\t\troutePoint += C[p]\n\t\t}\n\n\t\tif routePoint > 0 {\n\t\t\tpoints[i] = routePoint * (K / len(routes[i]))\n\t\t\trest := K % len(routes[i])\n\t\t\tfor j := 0; j < rest; j++ {\n\t\t\t\tpoints[i] += C[routes[i][j+1]]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 0; j < len(routes[i]) - 1; j++ {\n\t\t\t\tif j != 0 && routePoint < 0 && C[routes[i][j+1]] < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tpoints[i] += C[routes[i][j+1]]\n\t\t\t}\n\t\t}\n\t}\n\n\t//for i := 0; i < N; i++ {\n\t//\tfmt.Println(routes[i], points[i])\n\t//}\n\n\tfmt.Println(max(points...))\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n\tpoints []int\n}\n\nfunc NewGraph(n int, points []int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t\tpoints: points,\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}, route *[]int) {\n\tvisited[c] = struct{}{}\n\t*route = append(*route, c)\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited, route)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n%2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x%y)\n\t} else {\n\t\treturn calcGcd(x, y%x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod-2)\n\tfactNKR := powMod(factNK, mod-2)\n\treturn calcMod(factN * calcMod(factKR*factNKR))\n}\n\nfunc primeFactors(n int) []int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i*i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1597542420, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02585.html", "problem_id": "p02585", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02585/input.txt", "sample_output_relpath": "derived/input_output/data/p02585/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02585/Go/s437125336.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s437125336", "user_id": "u964273035"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tK := getInt()\n\tP := getIntArray(N)\n\tC := getIntArray(N)\n\n\tg := NewGraph(N, C)\n\tfor i := 0; i < N; i++ {\n\t\tg.AddEdge(i, P[i]-1)\n\t}\n\n\troutes := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\troute := make([]int, 0)\n\t\tdfs(i, g.edges, make(map[int]struct{}), &route)\n\t\troutes[i] = route\n\t}\n\n\tpoints := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\troutePoint := 0\n\t\tfor _, p := range routes[i] {\n\t\t\troutePoint += C[p]\n\t\t}\n\n\t\tif routePoint > 0 {\n\t\t\tpoints[i] = routePoint * (K / len(routes[i]))\n\t\t\trest := K % len(routes[i])\n\t\t\tfor j := 0; j < rest; j++ {\n\t\t\t\tpoints[i] += C[routes[i][j+1]]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 0; j < len(routes[i]) - 1; j++ {\n\t\t\t\tif j != 0 && routePoint < 0 && C[routes[i][j+1]] < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tpoints[i] += C[routes[i][j+1]]\n\t\t\t}\n\t\t}\n\t}\n\n\t//for i := 0; i < N; i++ {\n\t//\tfmt.Println(routes[i], points[i])\n\t//}\n\n\tfmt.Println(max(points...))\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n\tpoints []int\n}\n\nfunc NewGraph(n int, points []int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t\tpoints: points,\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}, route *[]int) {\n\tvisited[c] = struct{}{}\n\t*route = append(*route, c)\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited, route)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n%2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x%y)\n\t} else {\n\t\treturn calcGcd(x, y%x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod-2)\n\tfactNKR := powMod(factNK, mod-2)\n\treturn calcMod(factN * calcMod(factKR*factNKR))\n}\n\nfunc primeFactors(n int) []int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i*i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "sample_input": "5 2\n2 4 5 1 3\n3 4 -10 -8 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02585", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6648, "cpu_time_ms": 3318, "memory_kb": 259624}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s737732125", "group_id": "codeNet:p02595", "input_text": "package main\n\nimport (\n\t_ \"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t_ \"os\"\n _ \"sort\"\n\t_ \"strconv\"\n\t_ \"strings\"\n)\n\nfunc main() {\n \n var N, D, cnt int\n fmt.Scan(&N, &D)\n \n for i := 0; i < N; i++ {\n var X, Y float64\n fmt.Scan(&X, &Y)\n out := int(math.Ceil(math.Sqrt(math.Pow(X,2)+math.Pow(Y,2))))\n if D >= out {\n cnt++\n }\n }\n fmt.Println(cnt)\n}", "language": "Go", "metadata": {"date": 1596418894, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02595.html", "problem_id": "p02595", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02595/input.txt", "sample_output_relpath": "derived/input_output/data/p02595/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02595/Go/s737732125.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s737732125", "user_id": "u413375118"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t_ \"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t_ \"os\"\n _ \"sort\"\n\t_ \"strconv\"\n\t_ \"strings\"\n)\n\nfunc main() {\n \n var N, D, cnt int\n fmt.Scan(&N, &D)\n \n for i := 0; i < N; i++ {\n var X, Y float64\n fmt.Scan(&X, &Y)\n out := int(math.Ceil(math.Sqrt(math.Pow(X,2)+math.Pow(Y,2))))\n if D >= out {\n cnt++\n }\n }\n fmt.Println(cnt)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "sample_input": "4 5\n0 5\n-2 4\n3 4\n4 -4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02595", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 393, "cpu_time_ms": 2178, "memory_kb": 6428}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s319398113", "group_id": "codeNet:p02595", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tn := 0\n\td := float64(0)\n\n\tcount := 0\n\tx := float64(0)\n\ty := float64(0)\n\n\tfmt.Scanf(\"%d %f\", &n, &d)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%f %f\", &x, &y)\n\t\tdist := math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n\t\tif dist <= float64(d) {\n\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n\n}\n", "language": "Go", "metadata": {"date": 1596417420, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02595.html", "problem_id": "p02595", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02595/input.txt", "sample_output_relpath": "derived/input_output/data/p02595/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02595/Go/s319398113.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s319398113", "user_id": "u298355380"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tn := 0\n\td := float64(0)\n\n\tcount := 0\n\tx := float64(0)\n\ty := float64(0)\n\n\tfmt.Scanf(\"%d %f\", &n, &d)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%f %f\", &x, &y)\n\t\tdist := math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n\t\tif dist <= float64(d) {\n\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "sample_input": "4 5\n0 5\n-2 4\n3 4\n4 -4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02595", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 334, "cpu_time_ms": 2206, "memory_kb": 6432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s156779090", "group_id": "codeNet:p02595", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar d, x, y, ans float64\n\tvar n int\n\tfmt.Scan(&n, &d)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x, &y)\n\n\t\tif math.Sqrt(x*x+y*y) <= d {\n\t\t\tans += 1\n\t\t}\n\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1596417107, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02595.html", "problem_id": "p02595", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02595/input.txt", "sample_output_relpath": "derived/input_output/data/p02595/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02595/Go/s156779090.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s156779090", "user_id": "u545203108"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar d, x, y, ans float64\n\tvar n int\n\tfmt.Scan(&n, &d)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x, &y)\n\n\t\tif math.Sqrt(x*x+y*y) <= d {\n\t\t\tans += 1\n\t\t}\n\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "sample_input": "4 5\n0 5\n-2 4\n3 4\n4 -4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02595", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 228, "cpu_time_ms": 2102, "memory_kb": 6408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s016949268", "group_id": "codeNet:p02595", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tD := float64(getInt())\n\n\tresult := 0\n\tfor i := 0; i < N; i++ {\n\t\tx := getInt()\n\t\ty := getInt()\n\n\t\tdistance := math.Sqrt(float64(pow(x, 2) + pow(y, 2)))\n\t\tif distance <= D {\n\t\t\tresult++\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1596416591, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02595.html", "problem_id": "p02595", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02595/input.txt", "sample_output_relpath": "derived/input_output/data/p02595/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02595/Go/s016949268.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s016949268", "user_id": "u964273035"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tD := float64(getInt())\n\n\tresult := 0\n\tfor i := 0; i < N; i++ {\n\t\tx := getInt()\n\t\ty := getInt()\n\n\t\tdistance := math.Sqrt(float64(pow(x, 2) + pow(y, 2)))\n\t\tif distance <= D {\n\t\t\tresult++\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "sample_input": "4 5\n0 5\n-2 4\n3 4\n4 -4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02595", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).\n\nAmong them, we are looking for the points such that the distance from the origin is at most D. How many such points are there?\n\nWe remind you that the distance between the origin and the point (p, q) can be represented as \\sqrt{p^2+q^2}.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n0 \\leq D \\leq 2\\times 10^5\n\n|X_i|,|Y_i| \\leq 2\\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_1 Y_1\n\\vdots\nX_N Y_N\n\nOutput\n\nPrint an integer representing the number of points such that the distance from the origin is at most D.\n\nSample Input 1\n\n4 5\n0 5\n-2 4\n3 4\n4 -4\n\nSample Output 1\n\n3\n\nThe distance between the origin and each of the given points is as follows:\n\n\\sqrt{0^2+5^2}=5\n\n\\sqrt{(-2)^2+4^2}=4.472\\ldots\n\n\\sqrt{3^2+4^2}=5\n\n\\sqrt{4^2+(-4)^2}=5.656\\ldots\n\nThus, we have three points such that the distance from the origin is at most 5.\n\nSample Input 2\n\n12 3\n1 1\n1 1\n1 1\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\nSample Output 2\n\n7\n\nMultiple points may exist at the same coordinates.\n\nSample Input 3\n\n20 100000\n14309 -32939\n-56855 100340\n151364 25430\n103789 -113141\n147404 -136977\n-37006 -30929\n188810 -49557\n13419 70401\n-88280 165170\n-196399 137941\n-176527 -61904\n46659 115261\n-153551 114185\n98784 -6820\n94111 -86268\n-30401 61477\n-55056 7872\n5901 -163796\n138819 -185986\n-69848 -96669\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5943, "cpu_time_ms": 79, "memory_kb": 4928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s382298885", "group_id": "codeNet:p02596", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tk := nextInt()\n\tc := 0\n\tfor i := 0; i < k; i++ {\n\t\tc = c*10 + 7\n\t\tif c%k == 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t\tc %= k\n\t}\n\tfmt.Println(-1)\n}\n\nfunc nextInt() int {\n\ti, err := strconv.Atoi(nextWord())\n\tpnc(err)\n\treturn i\n}\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc pnc(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1597522691, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02596.html", "problem_id": "p02596", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02596/input.txt", "sample_output_relpath": "derived/input_output/data/p02596/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02596/Go/s382298885.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s382298885", "user_id": "u299672480"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tk := nextInt()\n\tc := 0\n\tfor i := 0; i < k; i++ {\n\t\tc = c*10 + 7\n\t\tif c%k == 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t\tc %= k\n\t}\n\tfmt.Println(-1)\n}\n\nfunc nextInt() int {\n\ti, err := strconv.Atoi(nextWord())\n\tpnc(err)\n\treturn i\n}\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc pnc(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "sample_input": "101\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02596", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 485, "cpu_time_ms": 27, "memory_kb": 1788}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s303960152", "group_id": "codeNet:p02596", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar ans, k int\n\tkk := \"7\"\n\tfmt.Scan(&k)\n\tans = -1\n\n\tfor ii := 1; ii <= 6; ii++ {\n\t\ti, _ := strconv.Atoi(kk)\n\t\tif i%k == 0 {\n\t\t\tans = ii\n\t\t\tbreak\n\t\t}\n\t\tkk += \"7\"\n\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1596417617, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02596.html", "problem_id": "p02596", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02596/input.txt", "sample_output_relpath": "derived/input_output/data/p02596/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02596/Go/s303960152.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s303960152", "user_id": "u545203108"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar ans, k int\n\tkk := \"7\"\n\tfmt.Scan(&k)\n\tans = -1\n\n\tfor ii := 1; ii <= 6; ii++ {\n\t\ti, _ := strconv.Atoi(kk)\n\t\tif i%k == 0 {\n\t\t\tans = ii\n\t\t\tbreak\n\t\t}\n\t\tkk += \"7\"\n\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "sample_input": "101\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02596", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi loves the number 7 and multiples of K.\n\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\n\nIf the sequence contains no multiples of K, print -1 instead.\n\nConstraints\n\n1 \\leq K \\leq 10^6\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint an integer representing the position of the first occurrence of a multiple of K. (For example, if the first occurrence is the fourth element of the sequence, print 4.)\n\nSample Input 1\n\n101\n\nSample Output 1\n\n4\n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n-1\n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\nSample Input 3\n\n999983\n\nSample Output 3\n\n999982", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 244, "cpu_time_ms": 8, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s938809839", "group_id": "codeNet:p02598", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\tn, k := io.NextInt(), io.NextInt()\n\ta := io.NextInts(n)\n\tans := solve(n, k, a)\n\tio.Println(ans)\n}\n\nfunc solve(n, k int, a []int) int {\n\tif k == 0 {\n\t\treturn Max(a...)\n\t}\n\tdivConut := func(x float64) int {\n\t\tcnt := 0\n\t\tfor i := range a {\n\t\t\tif float64(a[i]) <= x {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcnt += int(math.Ceil(float64(a[i])/x)) - 1\n\t\t}\n\t\treturn cnt\n\t}\n\tx := sort.Search(maxIter, func(x int) bool { return divConut(float64(x)/10) <= k })\n\tif x == maxIter {\n\t\tpanic(\"error\")\n\t}\n\treturn int(math.Ceil(float64(x) / 10))\n}\n\nconst maxIter = 1e12\n\n// Max returns max value of inputs\nfunc Max(a ...int) (max int) {\n\tfor i, ai := range a {\n\t\tif i == 0 || ai > max {\n\t\t\tmax = ai\n\t\t}\n\t}\n\treturn max\n}\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextInts returns n integers from stdin\nfunc (io *Io) NextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = io.NextInt()\n\t}\n\treturn ret\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "language": "Go", "metadata": {"date": 1597855084, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02598.html", "problem_id": "p02598", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02598/input.txt", "sample_output_relpath": "derived/input_output/data/p02598/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02598/Go/s938809839.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s938809839", "user_id": "u914096063"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\tn, k := io.NextInt(), io.NextInt()\n\ta := io.NextInts(n)\n\tans := solve(n, k, a)\n\tio.Println(ans)\n}\n\nfunc solve(n, k int, a []int) int {\n\tif k == 0 {\n\t\treturn Max(a...)\n\t}\n\tdivConut := func(x float64) int {\n\t\tcnt := 0\n\t\tfor i := range a {\n\t\t\tif float64(a[i]) <= x {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcnt += int(math.Ceil(float64(a[i])/x)) - 1\n\t\t}\n\t\treturn cnt\n\t}\n\tx := sort.Search(maxIter, func(x int) bool { return divConut(float64(x)/10) <= k })\n\tif x == maxIter {\n\t\tpanic(\"error\")\n\t}\n\treturn int(math.Ceil(float64(x) / 10))\n}\n\nconst maxIter = 1e12\n\n// Max returns max value of inputs\nfunc Max(a ...int) (max int) {\n\tfor i, ai := range a {\n\t\tif i == 0 || ai > max {\n\t\t\tmax = ai\n\t\t}\n\t}\n\treturn max\n}\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextInts returns n integers from stdin\nfunc (io *Io) NextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = io.NextInt()\n\t}\n\treturn ret\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N logs of lengths A_1,A_2,\\cdots A_N.\n\nWe can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0 1 {\n\t\t\t\tna = minInt(na, divCeil(a[j], d-1))\n\t\t\t}\n\t\t}\n\t\t//\t\tfmt.Fprintln(out, \"[DEBUG]\", wk, ans, na)\n\t\tif wk <= n+k {\n\t\t\tbreak\n\t\t}\n\t\tans = na\n\t}\n\n\t//fmt.Fprintln(out, \"[DEBUG]\", a)\n\tfmt.Fprintln(out, ans)\n\n}\n\n// 挿入ソート配列\ntype slist struct {\n\tl []int\n}\n\nfunc makeSlist() slist {\n\treturn slist{[]int{}}\n}\n\nfunc (s *slist) add(a int) {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\tif pos < len(s.l) {\n\t\ts.l = append(s.l[:pos+1], s.l[pos:]...)\n\t\ts.l[pos] = a\n\t} else {\n\t\ts.l = append(s.l, a)\n\t}\n}\nfunc (s slist) contains(a int) bool {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\treturn pos < len(s.l) && s.l[pos] == a\n}\n\n//------------------------------------------------------------------------------\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc printArray(a []int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i >= 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t}\n\t\tfmt.Fprint(out, a[i])\n\t}\n\tfmt.Fprintln(out)\n}\n\nfunc absInt(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc minInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc log10(x int) float64 {\n\treturn math.Log10(float64(x))\n}\nfunc divCeil(shi, bo int) int {\n\tans := shi / bo\n\tif shi%bo != 0 {\n\t\tans++\n\t}\n\treturn ans\n}\n", "language": "Go", "metadata": {"date": 1596420263, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02598.html", "problem_id": "p02598", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02598/input.txt", "sample_output_relpath": "derived/input_output/data/p02598/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02598/Go/s442375536.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s442375536", "user_id": "u805846052"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t/*/TODO:!!!!!!!テスト用!!!!!!!!!\n\tsc = bufio.NewScanner(strings.NewReader(`\n\t\t\t\t\t\t\t\t\t\t`))\n\t//TODO:!!!!!!!テスト用!!!!!!!!!*/\n\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\t//fmt.Fprintln(out, \"[DEBUG]\", time.Now())\n\n\tn := nextInt()\n\tk := nextInt()\n\n\ta := make([]int, n)\n\tsum := 0\n\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\tsum += a[i]\n\t}\n\n\tans := divCeil(sum, (n + k))\n\n\tfor i := 0; i < 10000; i++ {\n\t\twk := 0\n\t\tna := ans * 2\n\n\t\tfor j := 0; j < n; j++ {\n\t\t\td := divCeil(a[j], ans)\n\t\t\twk += d\n\t\t\tif d > 1 {\n\t\t\t\tna = minInt(na, divCeil(a[j], d-1))\n\t\t\t}\n\t\t}\n\t\t//\t\tfmt.Fprintln(out, \"[DEBUG]\", wk, ans, na)\n\t\tif wk <= n+k {\n\t\t\tbreak\n\t\t}\n\t\tans = na\n\t}\n\n\t//fmt.Fprintln(out, \"[DEBUG]\", a)\n\tfmt.Fprintln(out, ans)\n\n}\n\n// 挿入ソート配列\ntype slist struct {\n\tl []int\n}\n\nfunc makeSlist() slist {\n\treturn slist{[]int{}}\n}\n\nfunc (s *slist) add(a int) {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\tif pos < len(s.l) {\n\t\ts.l = append(s.l[:pos+1], s.l[pos:]...)\n\t\ts.l[pos] = a\n\t} else {\n\t\ts.l = append(s.l, a)\n\t}\n}\nfunc (s slist) contains(a int) bool {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\treturn pos < len(s.l) && s.l[pos] == a\n}\n\n//------------------------------------------------------------------------------\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc printArray(a []int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i >= 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t}\n\t\tfmt.Fprint(out, a[i])\n\t}\n\tfmt.Fprintln(out)\n}\n\nfunc absInt(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc minInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc log10(x int) float64 {\n\treturn math.Log10(float64(x))\n}\nfunc divCeil(shi, bo int) int {\n\tans := shi / bo\n\tif shi%bo != 0 {\n\t\tans++\n\t}\n\treturn ans\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N logs of lengths A_1,A_2,\\cdots A_N.\n\nWe can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0 bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, q int\n\tC []int\n\tQ []Query\n\n\tP [500000 + 50]int\n\tAnswers [500000 + 50]int\n)\n\ntype Query struct {\n\tidx, l, r int\n}\n\nfunc main() {\n\tn, q = ReadInt2()\n\tC = ReadIntSlice(n)\n\n\tfor i := 1; i <= n; i++ {\n\t\tP[i] = -1\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tl, r := ReadInt2()\n\t\tquery := Query{idx: i, l: l, r: r}\n\t\tQ = append(Q, query)\n\t}\n\n\tsort.SliceStable(Q, func(i, j int) bool { return Q[i].r < Q[j].r })\n\tft := NewFenwickTree(500000 + 50)\n\n\tk := 0\n\tfor _, query := range Q {\n\t\tfor k < query.r {\n\t\t\tif P[C[k]] != -1 {\n\t\t\t\tft.Add(P[C[k]]+1, -1)\n\t\t\t}\n\t\t\tP[C[k]] = k\n\t\t\tft.Add(k+1, 1)\n\n\t\t\tk++\n\t\t}\n\t\t// PrintfDebug(\"P: %v\\n\", P[:n+1])\n\n\t\tAnswers[query.idx] = ft.Sum(query.r) - ft.Sum(query.l-1)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\t// fmt.Println(Answers[i])\n\t\tPrintfBufStdout(\"%d\\n\", Answers[i])\n\t}\n\tstdout.Flush()\n}\n\n// Public methods\n// ft := NewFenwickTree(200000 + 5)\n// s := ft.Sum(i) \t\t\t\t\t\t// Sum of [1, i] (1-based)\n// ft.Add(i, x) \t\t\t\t\t\t\t// Add x to i (1-based)\n// idx := ft.LowerBound(w) \t\t// minimum idx such that bit.Sum(idx) >= w\n\ntype FenwickTree struct {\n\tdat []int\n\tn int\n\tminPow2 int\n}\n\n// n(>=1) is number of elements of original data\nfunc NewFenwickTree(n int) *FenwickTree {\n\tft := new(FenwickTree)\n\n\tft.dat = make([]int, n+1)\n\tft.n = n\n\n\tft.minPow2 = 1\n\tfor {\n\t\tif (ft.minPow2 << 1) > n {\n\t\t\tbreak\n\t\t}\n\t\tft.minPow2 <<= 1\n\t}\n\n\treturn ft\n}\n\n// Sum of [1, i](1-based)\nfunc (ft *FenwickTree) Sum(i int) int {\n\ts := 0\n\n\tfor i > 0 {\n\t\ts += ft.dat[i]\n\t\ti -= i & (-i)\n\t}\n\n\treturn s\n}\n\n// Add x to i(1-based)\nfunc (ft *FenwickTree) Add(i, x int) {\n\tfor i <= ft.n {\n\t\tft.dat[i] += x\n\t\ti += i & (-i)\n\t}\n}\n\n// LowerBound returns minimum i such that bit.Sum(i) >= w.\nfunc (ft *FenwickTree) LowerBound(w int) int {\n\tif w <= 0 {\n\t\treturn 0\n\t}\n\n\tx := 0\n\tfor k := ft.minPow2; k > 0; k /= 2 {\n\t\tif x+k <= ft.n && ft.dat[x+k] < w {\n\t\t\tw -= ft.dat[x+k]\n\t\t\tx += k\n\t\t}\n\t}\n\n\treturn x + 1\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1597522069, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02599.html", "problem_id": "p02599", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02599/input.txt", "sample_output_relpath": "derived/input_output/data/p02599/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02599/Go/s040219730.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s040219730", "user_id": "u103600314"}, "prompt_components": {"gold_output": "2\n3\n1\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc174/tasks/abc174_f\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, q int\n\tC []int\n\tQ []Query\n\n\tP [500000 + 50]int\n\tAnswers [500000 + 50]int\n)\n\ntype Query struct {\n\tidx, l, r int\n}\n\nfunc main() {\n\tn, q = ReadInt2()\n\tC = ReadIntSlice(n)\n\n\tfor i := 1; i <= n; i++ {\n\t\tP[i] = -1\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tl, r := ReadInt2()\n\t\tquery := Query{idx: i, l: l, r: r}\n\t\tQ = append(Q, query)\n\t}\n\n\tsort.SliceStable(Q, func(i, j int) bool { return Q[i].r < Q[j].r })\n\tft := NewFenwickTree(500000 + 50)\n\n\tk := 0\n\tfor _, query := range Q {\n\t\tfor k < query.r {\n\t\t\tif P[C[k]] != -1 {\n\t\t\t\tft.Add(P[C[k]]+1, -1)\n\t\t\t}\n\t\t\tP[C[k]] = k\n\t\t\tft.Add(k+1, 1)\n\n\t\t\tk++\n\t\t}\n\t\t// PrintfDebug(\"P: %v\\n\", P[:n+1])\n\n\t\tAnswers[query.idx] = ft.Sum(query.r) - ft.Sum(query.l-1)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\t// fmt.Println(Answers[i])\n\t\tPrintfBufStdout(\"%d\\n\", Answers[i])\n\t}\n\tstdout.Flush()\n}\n\n// Public methods\n// ft := NewFenwickTree(200000 + 5)\n// s := ft.Sum(i) \t\t\t\t\t\t// Sum of [1, i] (1-based)\n// ft.Add(i, x) \t\t\t\t\t\t\t// Add x to i (1-based)\n// idx := ft.LowerBound(w) \t\t// minimum idx such that bit.Sum(idx) >= w\n\ntype FenwickTree struct {\n\tdat []int\n\tn int\n\tminPow2 int\n}\n\n// n(>=1) is number of elements of original data\nfunc NewFenwickTree(n int) *FenwickTree {\n\tft := new(FenwickTree)\n\n\tft.dat = make([]int, n+1)\n\tft.n = n\n\n\tft.minPow2 = 1\n\tfor {\n\t\tif (ft.minPow2 << 1) > n {\n\t\t\tbreak\n\t\t}\n\t\tft.minPow2 <<= 1\n\t}\n\n\treturn ft\n}\n\n// Sum of [1, i](1-based)\nfunc (ft *FenwickTree) Sum(i int) int {\n\ts := 0\n\n\tfor i > 0 {\n\t\ts += ft.dat[i]\n\t\ti -= i & (-i)\n\t}\n\n\treturn s\n}\n\n// Add x to i(1-based)\nfunc (ft *FenwickTree) Add(i, x int) {\n\tfor i <= ft.n {\n\t\tft.dat[i] += x\n\t\ti += i & (-i)\n\t}\n}\n\n// LowerBound returns minimum i such that bit.Sum(i) >= w.\nfunc (ft *FenwickTree) LowerBound(w int) int {\n\tif w <= 0 {\n\t\treturn 0\n\t}\n\n\tx := 0\n\tfor k := ft.minPow2; k > 0; k /= 2 {\n\t\tif x+k <= ft.n && ft.dat[x+k] < w {\n\t\t\tw -= ft.dat[x+k]\n\t\t\tx += k\n\t\t}\n\t}\n\n\treturn x + 1\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have N colored balls arranged in a row from left to right; the color of the i-th ball from the left is c_i.\n\nYou are given Q queries. The i-th query is as follows: how many different colors do the l_i-th through r_i-th balls from the left have?\n\nConstraints\n\n1\\leq N,Q \\leq 5 \\times 10^5\n\n1\\leq c_i \\leq N\n\n1\\leq l_i \\leq r_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nc_1 c_2 \\cdots c_N\nl_1 r_1\nl_2 r_2\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the response to the i-th query.\n\nSample Input 1\n\n4 3\n1 2 1 3\n1 3\n2 4\n3 3\n\nSample Output 1\n\n2\n3\n1\n\nThe 1-st, 2-nd, and 3-rd balls from the left have the colors 1, 2, and 1 - two different colors.\n\nThe 2-st, 3-rd, and 4-th balls from the left have the colors 2, 1, and 3 - three different colors.\n\nThe 3-rd ball from the left has the color 1 - just one color.\n\nSample Input 2\n\n10 10\n2 5 6 5 2 1 7 9 7 2\n5 5\n2 4\n6 7\n2 2\n7 8\n7 9\n1 8\n6 9\n8 10\n6 8\n\nSample Output 2\n\n1\n2\n2\n1\n2\n2\n6\n3\n3\n3", "sample_input": "4 3\n1 2 1 3\n1 3\n2 4\n3 3\n"}, "reference_outputs": ["2\n3\n1\n"], "source_document_id": "p02599", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have N colored balls arranged in a row from left to right; the color of the i-th ball from the left is c_i.\n\nYou are given Q queries. The i-th query is as follows: how many different colors do the l_i-th through r_i-th balls from the left have?\n\nConstraints\n\n1\\leq N,Q \\leq 5 \\times 10^5\n\n1\\leq c_i \\leq N\n\n1\\leq l_i \\leq r_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nc_1 c_2 \\cdots c_N\nl_1 r_1\nl_2 r_2\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the response to the i-th query.\n\nSample Input 1\n\n4 3\n1 2 1 3\n1 3\n2 4\n3 3\n\nSample Output 1\n\n2\n3\n1\n\nThe 1-st, 2-nd, and 3-rd balls from the left have the colors 1, 2, and 1 - two different colors.\n\nThe 2-st, 3-rd, and 4-th balls from the left have the colors 2, 1, and 3 - three different colors.\n\nThe 3-rd ball from the left has the color 1 - just one color.\n\nSample Input 2\n\n10 10\n2 5 6 5 2 1 7 9 7 2\n5 5\n2 4\n6 7\n2 2\n7 8\n7 9\n1 8\n6 9\n8 10\n6 8\n\nSample Output 2\n\n1\n2\n2\n1\n2\n2\n6\n3\n3\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6892, "cpu_time_ms": 1399, "memory_kb": 75096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s535134773", "group_id": "codeNet:p02599", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\tbuf := make([]byte, 4096)\n\t_i := len(buf)\n\trc := func() byte {\n\t\tif _i == len(buf) {\n\t\t\t_r.Read(buf)\n\t\t\t_i = 0\n\t\t}\n\t\tb := buf[_i]\n\t\t_i++\n\t\treturn b\n\t}\n\tr := func() (x int) {\n\t\tb := rc()\n\t\tfor ; '0' > b; b = rc() {\n\t\t}\n\t\tfor ; '0' <= b; b = rc() {\n\t\t\tx = x*10 + int(b&15)\n\t\t}\n\t\treturn\n\t}\n\ttype pair struct{ l, r, i int }\n\n\tn, q := r(), r()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = r()\n\t}\n\tqs := make([]pair, q)\n\tfor i := range qs {\n\t\tqs[i] = pair{r(), r(), i}\n\t}\n\tsort.Slice(qs, func(i, j int) bool { return qs[i].r < qs[j].r })\n\n\ttree := make([]int, n+1)\n\tadd := func(i int, val int) {\n\t\tfor ; i <= n; i += i & -i {\n\t\t\ttree[i] += val\n\t\t}\n\t}\n\tquery := func(l, r int) (s int) {\n\t\tfor ; r > l; r &= r - 1 {\n\t\t\ts += tree[r]\n\t\t}\n\t\tfor ; l > r; l &= l - 1 {\n\t\t\ts -= tree[l]\n\t\t}\n\t\treturn\n\t}\n\n\tans := make([]int, q)\n\tposR := make([]int, n+1)\n\ti := 1\n\tfor _, q := range qs {\n\t\tfor ; i <= q.r; i++ {\n\t\t\tif p := posR[a[i]]; p > 0 {\n\t\t\t\tadd(p, -1)\n\t\t\t}\n\t\t\tadd(i, 1)\n\t\t\tposR[a[i]] = i\n\t\t}\n\t\ti = q.r + 1\n\t\tans[q.i] = query(q.l-1, q.r)\n\t}\n\tfor _, v := range ans {\n\t\tFprintln(out, v)\n\t}\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "language": "Go", "metadata": {"date": 1596502024, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02599.html", "problem_id": "p02599", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02599/input.txt", "sample_output_relpath": "derived/input_output/data/p02599/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02599/Go/s535134773.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s535134773", "user_id": "u235132324"}, "prompt_components": {"gold_output": "2\n3\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\tbuf := make([]byte, 4096)\n\t_i := len(buf)\n\trc := func() byte {\n\t\tif _i == len(buf) {\n\t\t\t_r.Read(buf)\n\t\t\t_i = 0\n\t\t}\n\t\tb := buf[_i]\n\t\t_i++\n\t\treturn b\n\t}\n\tr := func() (x int) {\n\t\tb := rc()\n\t\tfor ; '0' > b; b = rc() {\n\t\t}\n\t\tfor ; '0' <= b; b = rc() {\n\t\t\tx = x*10 + int(b&15)\n\t\t}\n\t\treturn\n\t}\n\ttype pair struct{ l, r, i int }\n\n\tn, q := r(), r()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = r()\n\t}\n\tqs := make([]pair, q)\n\tfor i := range qs {\n\t\tqs[i] = pair{r(), r(), i}\n\t}\n\tsort.Slice(qs, func(i, j int) bool { return qs[i].r < qs[j].r })\n\n\ttree := make([]int, n+1)\n\tadd := func(i int, val int) {\n\t\tfor ; i <= n; i += i & -i {\n\t\t\ttree[i] += val\n\t\t}\n\t}\n\tquery := func(l, r int) (s int) {\n\t\tfor ; r > l; r &= r - 1 {\n\t\t\ts += tree[r]\n\t\t}\n\t\tfor ; l > r; l &= l - 1 {\n\t\t\ts -= tree[l]\n\t\t}\n\t\treturn\n\t}\n\n\tans := make([]int, q)\n\tposR := make([]int, n+1)\n\ti := 1\n\tfor _, q := range qs {\n\t\tfor ; i <= q.r; i++ {\n\t\t\tif p := posR[a[i]]; p > 0 {\n\t\t\t\tadd(p, -1)\n\t\t\t}\n\t\t\tadd(i, 1)\n\t\t\tposR[a[i]] = i\n\t\t}\n\t\ti = q.r + 1\n\t\tans[q.i] = query(q.l-1, q.r)\n\t}\n\tfor _, v := range ans {\n\t\tFprintln(out, v)\n\t}\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have N colored balls arranged in a row from left to right; the color of the i-th ball from the left is c_i.\n\nYou are given Q queries. The i-th query is as follows: how many different colors do the l_i-th through r_i-th balls from the left have?\n\nConstraints\n\n1\\leq N,Q \\leq 5 \\times 10^5\n\n1\\leq c_i \\leq N\n\n1\\leq l_i \\leq r_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nc_1 c_2 \\cdots c_N\nl_1 r_1\nl_2 r_2\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the response to the i-th query.\n\nSample Input 1\n\n4 3\n1 2 1 3\n1 3\n2 4\n3 3\n\nSample Output 1\n\n2\n3\n1\n\nThe 1-st, 2-nd, and 3-rd balls from the left have the colors 1, 2, and 1 - two different colors.\n\nThe 2-st, 3-rd, and 4-th balls from the left have the colors 2, 1, and 3 - three different colors.\n\nThe 3-rd ball from the left has the color 1 - just one color.\n\nSample Input 2\n\n10 10\n2 5 6 5 2 1 7 9 7 2\n5 5\n2 4\n6 7\n2 2\n7 8\n7 9\n1 8\n6 9\n8 10\n6 8\n\nSample Output 2\n\n1\n2\n2\n1\n2\n2\n6\n3\n3\n3", "sample_input": "4 3\n1 2 1 3\n1 3\n2 4\n3 3\n"}, "reference_outputs": ["2\n3\n1\n"], "source_document_id": "p02599", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have N colored balls arranged in a row from left to right; the color of the i-th ball from the left is c_i.\n\nYou are given Q queries. The i-th query is as follows: how many different colors do the l_i-th through r_i-th balls from the left have?\n\nConstraints\n\n1\\leq N,Q \\leq 5 \\times 10^5\n\n1\\leq c_i \\leq N\n\n1\\leq l_i \\leq r_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nc_1 c_2 \\cdots c_N\nl_1 r_1\nl_2 r_2\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the response to the i-th query.\n\nSample Input 1\n\n4 3\n1 2 1 3\n1 3\n2 4\n3 3\n\nSample Output 1\n\n2\n3\n1\n\nThe 1-st, 2-nd, and 3-rd balls from the left have the colors 1, 2, and 1 - two different colors.\n\nThe 2-st, 3-rd, and 4-th balls from the left have the colors 2, 1, and 3 - three different colors.\n\nThe 3-rd ball from the left has the color 1 - just one color.\n\nSample Input 2\n\n10 10\n2 5 6 5 2 1 7 9 7 2\n5 5\n2 4\n6 7\n2 2\n7 8\n7 9\n1 8\n6 9\n8 10\n6 8\n\nSample Output 2\n\n1\n2\n2\n1\n2\n2\n6\n3\n3\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1325, "cpu_time_ms": 313, "memory_kb": 36060}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s504157725", "group_id": "codeNet:p02601", "input_text": "package main \n\nimport \"fmt\"\n\nvar a, b, c, k int\n\nfunc main () {\n\tans := \"No\"\n\tfmt.Scan(&a, &b, &c, &k)\n\tfor i:=0; ib {\n\t\t\tb *= 2 \n\t\t}else if b>c{\n\t\t\tc *= 2\n\t\t}\n\tif ab {\n\t\t\tb *= 2 \n\t\t}else if b>c{\n\t\t\tc *= 2\n\t\t}\n\tif a= b {\n\t\t\tb *= 2\n\t\t} else if b >= c {\n\t\t\tc *= 2\n\t\t}\n\t}\n\n\tif a < b && b < c {\n\t\tputs(\"Yes\")\n\t} else {\n\t\tputs(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1595811777, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02601.html", "problem_id": "p02601", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02601/input.txt", "sample_output_relpath": "derived/input_output/data/p02601/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02601/Go/s451065731.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s451065731", "user_id": "u502813058"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\ta, b, c := nextInt(), nextInt(), nextInt()\n\tk := nextInt()\n\n\tfor i := 0; i < k; i++ {\n\t\tif a >= b {\n\t\t\tb *= 2\n\t\t} else if b >= c {\n\t\t\tc *= 2\n\t\t}\n\t}\n\n\tif a < b && b < c {\n\t\tputs(\"Yes\")\n\t} else {\n\t\tputs(\"No\")\n\t}\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nM-kun has the following three cards:\n\nA red card with the integer A.\n\nA green card with the integer B.\n\nA blue card with the integer C.\n\nHe is a genius magician who can do the following operation at most K times:\n\nChoose one of the three cards and multiply the written integer by 2.\n\nHis magic is successful if both of the following conditions are satisfied after the operations:\n\nThe integer on the green card is strictly greater than the integer on the red card.\n\nThe integer on the blue card is strictly greater than the integer on the green card.\n\nDetermine whether the magic can be successful.\n\nConstraints\n\n1 \\leq A, B, C \\leq 7\n\n1 \\leq K \\leq 7\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\nK\n\nOutput\n\nIf the magic can be successful, print Yes; otherwise, print No.\n\nSample Input 1\n\n7 2 5\n3\n\nSample Output 1\n\nYes\n\nThe magic will be successful if, for example, he does the following operations:\n\nFirst, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.\n\nSecond, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.\n\nThird, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.\n\nSample Input 2\n\n7 4 2\n3\n\nSample Output 2\n\nNo\n\nHe has no way to succeed in the magic with at most three operations.", "sample_input": "7 2 5\n3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02601", "source_text": "Score: 200 points\n\nProblem Statement\n\nM-kun has the following three cards:\n\nA red card with the integer A.\n\nA green card with the integer B.\n\nA blue card with the integer C.\n\nHe is a genius magician who can do the following operation at most K times:\n\nChoose one of the three cards and multiply the written integer by 2.\n\nHis magic is successful if both of the following conditions are satisfied after the operations:\n\nThe integer on the green card is strictly greater than the integer on the red card.\n\nThe integer on the blue card is strictly greater than the integer on the green card.\n\nDetermine whether the magic can be successful.\n\nConstraints\n\n1 \\leq A, B, C \\leq 7\n\n1 \\leq K \\leq 7\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\nK\n\nOutput\n\nIf the magic can be successful, print Yes; otherwise, print No.\n\nSample Input 1\n\n7 2 5\n3\n\nSample Output 1\n\nYes\n\nThe magic will be successful if, for example, he does the following operations:\n\nFirst, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.\n\nSecond, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.\n\nThird, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.\n\nSample Input 2\n\n7 4 2\n3\n\nSample Output 2\n\nNo\n\nHe has no way to succeed in the magic with at most three operations.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 697, "cpu_time_ms": 6, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s284001839", "group_id": "codeNet:p02601", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C int\n\tvar K int\n\n\tfmt.Scan(&A, &B, &C)\n\tfmt.Scan(&K)\n\n\tfor i := 0; i < K; i++ {\n\t\tif B <= A {\n\t\t\tB *= 2\n\t\t} else if C <= B {\n\t\t\tC *= 2\n\t\t}\n\t\tif A < B && B < C {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1595729126, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02601.html", "problem_id": "p02601", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02601/input.txt", "sample_output_relpath": "derived/input_output/data/p02601/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02601/Go/s284001839.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s284001839", "user_id": "u595415882"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C int\n\tvar K int\n\n\tfmt.Scan(&A, &B, &C)\n\tfmt.Scan(&K)\n\n\tfor i := 0; i < K; i++ {\n\t\tif B <= A {\n\t\t\tB *= 2\n\t\t} else if C <= B {\n\t\t\tC *= 2\n\t\t}\n\t\tif A < B && B < C {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nM-kun has the following three cards:\n\nA red card with the integer A.\n\nA green card with the integer B.\n\nA blue card with the integer C.\n\nHe is a genius magician who can do the following operation at most K times:\n\nChoose one of the three cards and multiply the written integer by 2.\n\nHis magic is successful if both of the following conditions are satisfied after the operations:\n\nThe integer on the green card is strictly greater than the integer on the red card.\n\nThe integer on the blue card is strictly greater than the integer on the green card.\n\nDetermine whether the magic can be successful.\n\nConstraints\n\n1 \\leq A, B, C \\leq 7\n\n1 \\leq K \\leq 7\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\nK\n\nOutput\n\nIf the magic can be successful, print Yes; otherwise, print No.\n\nSample Input 1\n\n7 2 5\n3\n\nSample Output 1\n\nYes\n\nThe magic will be successful if, for example, he does the following operations:\n\nFirst, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.\n\nSecond, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.\n\nThird, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.\n\nSample Input 2\n\n7 4 2\n3\n\nSample Output 2\n\nNo\n\nHe has no way to succeed in the magic with at most three operations.", "sample_input": "7 2 5\n3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02601", "source_text": "Score: 200 points\n\nProblem Statement\n\nM-kun has the following three cards:\n\nA red card with the integer A.\n\nA green card with the integer B.\n\nA blue card with the integer C.\n\nHe is a genius magician who can do the following operation at most K times:\n\nChoose one of the three cards and multiply the written integer by 2.\n\nHis magic is successful if both of the following conditions are satisfied after the operations:\n\nThe integer on the green card is strictly greater than the integer on the red card.\n\nThe integer on the blue card is strictly greater than the integer on the green card.\n\nDetermine whether the magic can be successful.\n\nConstraints\n\n1 \\leq A, B, C \\leq 7\n\n1 \\leq K \\leq 7\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\nK\n\nOutput\n\nIf the magic can be successful, print Yes; otherwise, print No.\n\nSample Input 1\n\n7 2 5\n3\n\nSample Output 1\n\nYes\n\nThe magic will be successful if, for example, he does the following operations:\n\nFirst, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.\n\nSecond, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.\n\nThird, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.\n\nSample Input 2\n\n7 4 2\n3\n\nSample Output 2\n\nNo\n\nHe has no way to succeed in the magic with at most three operations.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 276, "cpu_time_ms": 6, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s429913796", "group_id": "codeNet:p02603", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tvar slim []int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tif i > 0 {\n\t\t\tif a[i] != a[i-1] {\n\t\t\t\tslim = append(slim, a[i])\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tslim = append(slim, a[i])\n\t}\n\n\tkabu := 0\n\tvar cash uint64\n\tcash = 1000\n\n\tfor i := 0; i < len(slim); i++ {\n\t\tif i == len(slim) - 1 {\n\t\t\tif slim[i] > slim[i-1] {\n\t\t\t\tcash += uint64(slim[i] * kabu)\n\t\t\t\tkabu = 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcash += uint64(slim[i-1] * kabu)\n\t\t\tkabu = 0\n\t\t\tcontinue\n\t\t}\n\t\tif slim[i] > slim[i+1] {\n\t\t\tif kabu > 0 {\n\t\t\t\t// 売る\n\t\t\t\tcash += uint64(slim[i] * kabu)\n\t\t\t\tkabu = 0\n\t\t\t}\n\t\t} else {\n\t\t\tif kabu == 0 {\n\t\t\t\t// 買う\n\t\t\t\tkabu = int(cash) / slim[i]\n\t\t\t\tcash = cash % uint64(slim[i])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cash)\n\n}\n", "language": "Go", "metadata": {"date": 1595744008, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02603.html", "problem_id": "p02603", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02603/input.txt", "sample_output_relpath": "derived/input_output/data/p02603/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02603/Go/s429913796.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s429913796", "user_id": "u769765274"}, "prompt_components": {"gold_output": "1685\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tvar slim []int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tif i > 0 {\n\t\t\tif a[i] != a[i-1] {\n\t\t\t\tslim = append(slim, a[i])\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tslim = append(slim, a[i])\n\t}\n\n\tkabu := 0\n\tvar cash uint64\n\tcash = 1000\n\n\tfor i := 0; i < len(slim); i++ {\n\t\tif i == len(slim) - 1 {\n\t\t\tif slim[i] > slim[i-1] {\n\t\t\t\tcash += uint64(slim[i] * kabu)\n\t\t\t\tkabu = 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcash += uint64(slim[i-1] * kabu)\n\t\t\tkabu = 0\n\t\t\tcontinue\n\t\t}\n\t\tif slim[i] > slim[i+1] {\n\t\t\tif kabu > 0 {\n\t\t\t\t// 売る\n\t\t\t\tcash += uint64(slim[i] * kabu)\n\t\t\t\tkabu = 0\n\t\t\t}\n\t\t} else {\n\t\t\tif kabu == 0 {\n\t\t\t\t// 買う\n\t\t\t\tkabu = int(cash) / slim[i]\n\t\t\t\tcash = cash % uint64(slim[i])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cash)\n\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "sample_input": "7\n100 130 130 130 115 115 150\n"}, "reference_outputs": ["1685\n"], "source_document_id": "p02603", "source_text": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 781, "cpu_time_ms": 5, "memory_kb": 1796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s997834583", "group_id": "codeNet:p02603", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_d\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int\n\tA []int\n\n\t// dp [80 + 5][200000]int\n\tdp [80 + 5][2000 + 50][20 + 5]bool\n)\n\nfunc main() {\n\tn = ReadInt()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= 2000; j++ {\n\t\t\tfor k := 0; k <= 20; k++ {\n\t\t\t\tdp[i][j][k] = false\n\t\t\t}\n\t\t}\n\t}\n\n\tdp[0][1000][0] = true\n\tfor i := 0; i < n; i++ {\n\t\ta := A[i]\n\t\tfor j := 0; j <= 2000; j++ {\n\t\t\tfor k := 0; k <= 20; k++ {\n\t\t\t\tif !dp[i][j][k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// 何もしない\n\t\t\t\tdp[i+1][j][k] = true\n\n\t\t\t\t// k枚の株券を換金\n\t\t\t\tfor l := 1; l <= k; l++ {\n\t\t\t\t\tif j+l*a <= 2000 {\n\t\t\t\t\t\tdp[i+1][j+l*a][k-l] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// j円を株券に変換\n\t\t\t\tq := j / a\n\t\t\t\tfor l := 1; l <= q; l++ {\n\t\t\t\t\tif k+l <= 20 {\n\t\t\t\t\t\tdp[i+1][j-l*a][k+l] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 1000\n\tfor j := 1000; j <= 2000; j++ {\n\t\tfor k := 0; k <= 20; k++ {\n\t\t\tif dp[n][j][k] {\n\t\t\t\tChMax(&ans, j)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n// func main() {\n// \tn = ReadInt()\n// \tA = ReadIntSlice(n)\n\n// \tfor i := 0; i <= n; i++ {\n// \t\tfor j := 0; j <= 100000; j++ {\n// \t\t\tdp[i][j] = -INF_BIT60\n// \t\t}\n// \t}\n\n// \tdp[0][0] = 1000\n// \tfor i := 0; i < n; i++ {\n// \t\ta := A[i]\n// \t\tfor j := 0; j <= 10000; j++ {\n// \t\t\t// dp[i][j]で株を買えるだけ\n// \t\t\tif dp[i][j] > 0 {\n// \t\t\t\tnum := dp[i][j] / a\n// \t\t\t\tnokori := dp[i][j] % a\n// \t\t\t\tChMax(&dp[i+1][j+num], nokori)\n// \t\t\t}\n\n// \t\t\t// 持ってる株j個をすべて売る\n// \t\t\tplus := j * a\n// \t\t\tChMax(&dp[i+1][0], dp[i][j]+plus)\n\n// \t\t\t// 何もしない\n// \t\t\tChMax(&dp[i+1][j], dp[i][j])\n// \t\t}\n// \t}\n\n// \tans := 1000\n// \tfor j := 0; j <= 100000; j++ {\n// \t\tChMax(&ans, dp[n][j])\n// \t}\n// \tfmt.Println(ans)\n// }\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1595728106, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02603.html", "problem_id": "p02603", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02603/input.txt", "sample_output_relpath": "derived/input_output/data/p02603/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02603/Go/s997834583.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s997834583", "user_id": "u103600314"}, "prompt_components": {"gold_output": "1685\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_d\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int\n\tA []int\n\n\t// dp [80 + 5][200000]int\n\tdp [80 + 5][2000 + 50][20 + 5]bool\n)\n\nfunc main() {\n\tn = ReadInt()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= 2000; j++ {\n\t\t\tfor k := 0; k <= 20; k++ {\n\t\t\t\tdp[i][j][k] = false\n\t\t\t}\n\t\t}\n\t}\n\n\tdp[0][1000][0] = true\n\tfor i := 0; i < n; i++ {\n\t\ta := A[i]\n\t\tfor j := 0; j <= 2000; j++ {\n\t\t\tfor k := 0; k <= 20; k++ {\n\t\t\t\tif !dp[i][j][k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// 何もしない\n\t\t\t\tdp[i+1][j][k] = true\n\n\t\t\t\t// k枚の株券を換金\n\t\t\t\tfor l := 1; l <= k; l++ {\n\t\t\t\t\tif j+l*a <= 2000 {\n\t\t\t\t\t\tdp[i+1][j+l*a][k-l] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// j円を株券に変換\n\t\t\t\tq := j / a\n\t\t\t\tfor l := 1; l <= q; l++ {\n\t\t\t\t\tif k+l <= 20 {\n\t\t\t\t\t\tdp[i+1][j-l*a][k+l] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 1000\n\tfor j := 1000; j <= 2000; j++ {\n\t\tfor k := 0; k <= 20; k++ {\n\t\t\tif dp[n][j][k] {\n\t\t\t\tChMax(&ans, j)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n// func main() {\n// \tn = ReadInt()\n// \tA = ReadIntSlice(n)\n\n// \tfor i := 0; i <= n; i++ {\n// \t\tfor j := 0; j <= 100000; j++ {\n// \t\t\tdp[i][j] = -INF_BIT60\n// \t\t}\n// \t}\n\n// \tdp[0][0] = 1000\n// \tfor i := 0; i < n; i++ {\n// \t\ta := A[i]\n// \t\tfor j := 0; j <= 10000; j++ {\n// \t\t\t// dp[i][j]で株を買えるだけ\n// \t\t\tif dp[i][j] > 0 {\n// \t\t\t\tnum := dp[i][j] / a\n// \t\t\t\tnokori := dp[i][j] % a\n// \t\t\t\tChMax(&dp[i+1][j+num], nokori)\n// \t\t\t}\n\n// \t\t\t// 持ってる株j個をすべて売る\n// \t\t\tplus := j * a\n// \t\t\tChMax(&dp[i+1][0], dp[i][j]+plus)\n\n// \t\t\t// 何もしない\n// \t\t\tChMax(&dp[i+1][j], dp[i][j])\n// \t\t}\n// \t}\n\n// \tans := 1000\n// \tfor j := 0; j <= 100000; j++ {\n// \t\tChMax(&ans, dp[n][j])\n// \t}\n// \tfmt.Println(ans)\n// }\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "sample_input": "7\n100 130 130 130 115 115 150\n"}, "reference_outputs": ["1685\n"], "source_document_id": "p02603", "source_text": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6960, "cpu_time_ms": 120, "memory_kb": 5852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s590735953", "group_id": "codeNet:p02605", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst INF int = 10000000\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\ntype Point struct {\n\tpos int\n\td bool\n}\n\nfunc add(m map[int][]Point, ind int, pos int, d bool) {\n\tlist, ok := m[ind]\n\tif !ok {\n\t\tlist = make([]Point, 0)\n\t}\n\tm[ind] = append(list, Point{pos, d})\n}\n\ntype SortArray struct {\n\torig []Point\n}\n\nfunc (sa *SortArray) Len() int {\n\treturn len(sa.orig)\n}\n\nfunc (sa *SortArray) Less(i, j int) bool {\n\treturn sa.orig[i].pos < sa.orig[j].pos\n}\n\nfunc (sa *SortArray) Swap(i, j int) {\n\tsa.orig[i], sa.orig[j] = sa.orig[j], sa.orig[i]\n}\n\nfunc solve(list []Point) int {\n\tsa := SortArray{list}\n\tsort.Sort(&sa)\n\n\tpos_max := -INF\n\tmin_t := INF\n\tvar t int\n\tfor _, p := range sa.orig {\n\t\tif p.d {\n\t\t\tpos_max = p.pos\n\t\t} else {\n\t\t\tif pos_max > -INF {\n\t\t\t\tt = p.pos - pos_max\n\t\t\t\tif t < min_t {\n\t\t\t\t\tmin_t = t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn min_t\n}\n\nfunc find(m map[int][]Point) int {\n\tmin_t := INF\n\tvar t int\n\tfor _, list := range m {\n\t\tt = solve(list)\n\t\tif t < min_t {\n\t\t\tmin_t = t\n\t\t}\n\t}\n\treturn min_t\n}\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tN := nextInt()\n\n\tdl := make(map[int][]Point)\n\tur := make(map[int][]Point)\n\tul := make(map[int][]Point)\n\tdr := make(map[int][]Point)\n\tud := make(map[int][]Point)\n\tlr := make(map[int][]Point)\n\n\tvar X, Y int\n\tvar d string\n\tfor i := 0; i < N; i++ {\n\t\tX, Y = nextInt(), nextInt()\n\t\td = next()\n\t\tif d == \"U\" {\n\t\t\tadd(ur, X+Y, X*2, false)\n\t\t\tadd(ul, X-Y, X*2, true)\n\t\t\tadd(ud, X, Y, true)\n\t\t} else if d == \"D\" {\n\t\t\tadd(dr, X-Y, X*2, false)\n\t\t\tadd(dl, X+Y, X*2, true)\n\t\t\tadd(ud, X, Y, false)\n\t\t} else if d == \"R\" {\n\t\t\tadd(ur, X+Y, X*2, true)\n\t\t\tadd(dr, X-Y, X*2, true)\n\t\t\tadd(lr, Y, X, true)\n\t\t} else if d == \"L\" {\n\t\t\tadd(ul, X-Y, X*2, false)\n\t\t\tadd(dl, X+Y, X*2, false)\n\t\t\tadd(lr, Y, X, false)\n\t\t}\n\t}\n\n\tmin_t := INF\n\tts := make([]int, 6)\n\tts[0] = find(dl)\n\tts[1] = find(ur)\n\tts[2] = find(ul)\n\tts[3] = find(dr)\n\tts[4] = find(ud)\n\tts[5] = find(lr)\n\n\tfor _, t := range ts {\n\t\tif t < min_t {\n\t\t\tmin_t = t\n\t\t}\n\t}\n\n\tif min_t == INF {\n\t\tfmt.Fprintln(out, \"SAFE\")\n\t} else {\n\t\tfmt.Fprintln(out, min_t*5)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1595739286, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02605.html", "problem_id": "p02605", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02605/input.txt", "sample_output_relpath": "derived/input_output/data/p02605/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02605/Go/s590735953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s590735953", "user_id": "u673612774"}, "prompt_components": {"gold_output": "230\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst INF int = 10000000\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\ntype Point struct {\n\tpos int\n\td bool\n}\n\nfunc add(m map[int][]Point, ind int, pos int, d bool) {\n\tlist, ok := m[ind]\n\tif !ok {\n\t\tlist = make([]Point, 0)\n\t}\n\tm[ind] = append(list, Point{pos, d})\n}\n\ntype SortArray struct {\n\torig []Point\n}\n\nfunc (sa *SortArray) Len() int {\n\treturn len(sa.orig)\n}\n\nfunc (sa *SortArray) Less(i, j int) bool {\n\treturn sa.orig[i].pos < sa.orig[j].pos\n}\n\nfunc (sa *SortArray) Swap(i, j int) {\n\tsa.orig[i], sa.orig[j] = sa.orig[j], sa.orig[i]\n}\n\nfunc solve(list []Point) int {\n\tsa := SortArray{list}\n\tsort.Sort(&sa)\n\n\tpos_max := -INF\n\tmin_t := INF\n\tvar t int\n\tfor _, p := range sa.orig {\n\t\tif p.d {\n\t\t\tpos_max = p.pos\n\t\t} else {\n\t\t\tif pos_max > -INF {\n\t\t\t\tt = p.pos - pos_max\n\t\t\t\tif t < min_t {\n\t\t\t\t\tmin_t = t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn min_t\n}\n\nfunc find(m map[int][]Point) int {\n\tmin_t := INF\n\tvar t int\n\tfor _, list := range m {\n\t\tt = solve(list)\n\t\tif t < min_t {\n\t\t\tmin_t = t\n\t\t}\n\t}\n\treturn min_t\n}\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tN := nextInt()\n\n\tdl := make(map[int][]Point)\n\tur := make(map[int][]Point)\n\tul := make(map[int][]Point)\n\tdr := make(map[int][]Point)\n\tud := make(map[int][]Point)\n\tlr := make(map[int][]Point)\n\n\tvar X, Y int\n\tvar d string\n\tfor i := 0; i < N; i++ {\n\t\tX, Y = nextInt(), nextInt()\n\t\td = next()\n\t\tif d == \"U\" {\n\t\t\tadd(ur, X+Y, X*2, false)\n\t\t\tadd(ul, X-Y, X*2, true)\n\t\t\tadd(ud, X, Y, true)\n\t\t} else if d == \"D\" {\n\t\t\tadd(dr, X-Y, X*2, false)\n\t\t\tadd(dl, X+Y, X*2, true)\n\t\t\tadd(ud, X, Y, false)\n\t\t} else if d == \"R\" {\n\t\t\tadd(ur, X+Y, X*2, true)\n\t\t\tadd(dr, X-Y, X*2, true)\n\t\t\tadd(lr, Y, X, true)\n\t\t} else if d == \"L\" {\n\t\t\tadd(ul, X-Y, X*2, false)\n\t\t\tadd(dl, X+Y, X*2, false)\n\t\t\tadd(lr, Y, X, false)\n\t\t}\n\t}\n\n\tmin_t := INF\n\tts := make([]int, 6)\n\tts[0] = find(dl)\n\tts[1] = find(ur)\n\tts[2] = find(ul)\n\tts[3] = find(dr)\n\tts[4] = find(ud)\n\tts[5] = find(lr)\n\n\tfor _, t := range ts {\n\t\tif t < min_t {\n\t\t\tmin_t = t\n\t\t}\n\t}\n\n\tif min_t == INF {\n\t\tfmt.Fprintln(out, \"SAFE\")\n\t} else {\n\t\tfmt.Fprintln(out, min_t*5)\n\t}\n}\n", "problem_context": "Score: 600 points\n\nProblem Statement\n\nM-kun is a brilliant air traffic controller.\n\nOn the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.\n\nEach of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The current coordinates of the airplane numbered i are (X_i, Y_i), and the direction of the airplane is as follows:\n\nif U_i is U, it flies in the positive y direction;\n\nif U_i is R, it flies in the positive x direction;\n\nif U_i is D, it flies in the negative y direction;\n\nif U_i is L, it flies in the negative x direction.\n\nTo help M-kun in his work, determine whether there is a pair of airplanes that will collide with each other if they keep flying as they are now.\n\nIf there is such a pair, find the number of seconds after which the first collision will happen.\n\nWe assume that the airplanes are negligibly small so that two airplanes only collide when they reach the same coordinates simultaneously.\n\nConstraints\n\n1 \\leq N \\leq 200000\n\n0 \\leq X_i, Y_i \\leq 200000\n\nU_i is U, R, D, or L.\n\nThe current positions of the N airplanes, (X_i, Y_i), are all distinct.\n\nN, X_i, and Y_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1 U_1\nX_2 Y_2 U_2\nX_3 Y_3 U_3\n:\nX_N Y_N U_N\n\nOutput\n\nIf there is a pair of airplanes that will collide with each other if they keep flying as they are now, print an integer representing the number of seconds after which the first collision will happen.\n\nIf there is no such pair, print SAFE.\n\nSample Input 1\n\n2\n11 1 U\n11 47 D\n\nSample Output 1\n\n230\n\nIf the airplanes keep flying as they are now, two airplanes numbered 1 and 2 will reach the coordinates (11, 24) simultaneously and collide.\n\nSample Input 2\n\n4\n20 30 U\n30 20 R\n20 10 D\n10 20 L\n\nSample Output 2\n\nSAFE\n\nNo pair of airplanes will collide.\n\nSample Input 3\n\n8\n168 224 U\n130 175 R\n111 198 D\n121 188 L\n201 116 U\n112 121 R\n145 239 D\n185 107 L\n\nSample Output 3\n\n100", "sample_input": "2\n11 1 U\n11 47 D\n"}, "reference_outputs": ["230\n"], "source_document_id": "p02605", "source_text": "Score: 600 points\n\nProblem Statement\n\nM-kun is a brilliant air traffic controller.\n\nOn the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.\n\nEach of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The current coordinates of the airplane numbered i are (X_i, Y_i), and the direction of the airplane is as follows:\n\nif U_i is U, it flies in the positive y direction;\n\nif U_i is R, it flies in the positive x direction;\n\nif U_i is D, it flies in the negative y direction;\n\nif U_i is L, it flies in the negative x direction.\n\nTo help M-kun in his work, determine whether there is a pair of airplanes that will collide with each other if they keep flying as they are now.\n\nIf there is such a pair, find the number of seconds after which the first collision will happen.\n\nWe assume that the airplanes are negligibly small so that two airplanes only collide when they reach the same coordinates simultaneously.\n\nConstraints\n\n1 \\leq N \\leq 200000\n\n0 \\leq X_i, Y_i \\leq 200000\n\nU_i is U, R, D, or L.\n\nThe current positions of the N airplanes, (X_i, Y_i), are all distinct.\n\nN, X_i, and Y_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1 U_1\nX_2 Y_2 U_2\nX_3 Y_3 U_3\n:\nX_N Y_N U_N\n\nOutput\n\nIf there is a pair of airplanes that will collide with each other if they keep flying as they are now, print an integer representing the number of seconds after which the first collision will happen.\n\nIf there is no such pair, print SAFE.\n\nSample Input 1\n\n2\n11 1 U\n11 47 D\n\nSample Output 1\n\n230\n\nIf the airplanes keep flying as they are now, two airplanes numbered 1 and 2 will reach the coordinates (11, 24) simultaneously and collide.\n\nSample Input 2\n\n4\n20 30 U\n30 20 R\n20 10 D\n10 20 L\n\nSample Output 2\n\nSAFE\n\nNo pair of airplanes will collide.\n\nSample Input 3\n\n8\n168 224 U\n130 175 R\n111 198 D\n121 188 L\n201 116 U\n112 121 R\n145 239 D\n185 107 L\n\nSample Output 3\n\n100", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2340, "cpu_time_ms": 380, "memory_kb": 80928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s791953367", "group_id": "codeNet:p02607", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\ta := sc.i()\n\t\tif i%2 == 1 && a%2 == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1594515830, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02607.html", "problem_id": "p02607", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02607/input.txt", "sample_output_relpath": "derived/input_output/data/p02607/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02607/Go/s791953367.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s791953367", "user_id": "u737368452"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\ta := sc.i()\n\t\tif i%2 == 1 && a%2 == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "sample_input": "5\n1 3 4 5 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02607", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1200, "cpu_time_ms": 7, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s325990907", "group_id": "codeNet:p02607", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\nvar inf = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tvar a int\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tif i%2 != 0 && a%2 != 0 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// permutations\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "language": "Go", "metadata": {"date": 1594515777, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02607.html", "problem_id": "p02607", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02607/input.txt", "sample_output_relpath": "derived/input_output/data/p02607/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02607/Go/s325990907.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s325990907", "user_id": "u433254839"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\nvar inf = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tvar a int\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tif i%2 != 0 && a%2 != 0 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// permutations\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "sample_input": "5\n1 3 4 5 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02607", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5032, "cpu_time_ms": 7, "memory_kb": 1840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s430960124", "group_id": "codeNet:p02608", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc f(n int) int {\n\tans := 0\n\tfor x := 1; x <= n; x++ {\n\t\tp := x*x\n\t\tif p > n {\n\t\t\tbreak\n\t\t}\n\t\tfor y := 1; y <= n; y++ {\n\t\t\tq := p + y*y + x*y\n\t\t\tif q > n {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tfor z := 1; z <= n; z++ {\n\t\t\t\tr := q + z*z + y*z + z*x\n\t\t\t\tif r > n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tif r == n {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc solve(n int) []int {\n\tans := make([]int, n)\n\n\tfor i := 1; i < n; i++ {\n\t\tans = append(ans, f(i))\n\t}\n\n\treturn ans\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tresult := solve(N)\n\tfor _, i := range result {\n\t\tfmt.Println(i)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594522900, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02608.html", "problem_id": "p02608", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02608/input.txt", "sample_output_relpath": "derived/input_output/data/p02608/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02608/Go/s430960124.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s430960124", "user_id": "u111833322"}, "prompt_components": {"gold_output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc f(n int) int {\n\tans := 0\n\tfor x := 1; x <= n; x++ {\n\t\tp := x*x\n\t\tif p > n {\n\t\t\tbreak\n\t\t}\n\t\tfor y := 1; y <= n; y++ {\n\t\t\tq := p + y*y + x*y\n\t\t\tif q > n {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tfor z := 1; z <= n; z++ {\n\t\t\t\tr := q + z*z + y*z + z*x\n\t\t\t\tif r > n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tif r == n {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc solve(n int) []int {\n\tans := make([]int, n)\n\n\tfor i := 1; i < n; i++ {\n\t\tans = append(ans, f(i))\n\t}\n\n\treturn ans\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tresult := solve(N)\n\tfor _, i := range result {\n\t\tfmt.Println(i)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "sample_input": "20\n"}, "reference_outputs": ["0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"], "source_document_id": "p02608", "source_text": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 590, "cpu_time_ms": 1552, "memory_kb": 2284}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s850968104", "group_id": "codeNet:p02608", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tfor i := 1; i <= n; i++ {\n\t\tret := exec(i)\n\t\tfmt.Printf(\"%d\\n\", ret)\n\t}\n}\n\nfunc exec(n int) int {\n\tmax := sqrt(n)\n\tvar ret int\n\tfor x := 1; x < max; x++ {\n\t\tfor y := 1; y < max; y++ {\n\t\t\tfor z := 1; z < max; z++ {\n\t\t\t\tif cal(x, y, z) == n {\n\t\t\t\t\tret++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc cal(x, y, z int) int {\n\treturn x*x + y*y + z*z + x*y + x*z + y*z\n}\n\nfunc sqrt(p int) int {\n\treturn int(math.Sqrt(float64(p)))\n}\n", "language": "Go", "metadata": {"date": 1594519769, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02608.html", "problem_id": "p02608", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02608/input.txt", "sample_output_relpath": "derived/input_output/data/p02608/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02608/Go/s850968104.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s850968104", "user_id": "u137939942"}, "prompt_components": {"gold_output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tfor i := 1; i <= n; i++ {\n\t\tret := exec(i)\n\t\tfmt.Printf(\"%d\\n\", ret)\n\t}\n}\n\nfunc exec(n int) int {\n\tmax := sqrt(n)\n\tvar ret int\n\tfor x := 1; x < max; x++ {\n\t\tfor y := 1; y < max; y++ {\n\t\t\tfor z := 1; z < max; z++ {\n\t\t\t\tif cal(x, y, z) == n {\n\t\t\t\t\tret++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc cal(x, y, z int) int {\n\treturn x*x + y*y + z*z + x*y + x*z + y*z\n}\n\nfunc sqrt(p int) int {\n\treturn int(math.Sqrt(float64(p)))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "sample_input": "20\n"}, "reference_outputs": ["0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"], "source_document_id": "p02608", "source_text": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 506, "cpu_time_ms": 2205, "memory_kb": 1908}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s393442412", "group_id": "codeNet:p02608", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\n\tfor n := 1; n <= N; n++ {\n\t\tans := 0\n\t\tfor x := 1; x < 32; x++ {\n\t\t\tfor y := 1; y < 32; y++ {\n\t\t\t\tfor z := 1; z < 32; z++ {\n\t\t\t\t\tv := x * x\n\t\t\t\t\tv += y * y\n\t\t\t\t\tv += z * z\n\t\t\t\t\tv += x * y\n\t\t\t\t\tv += y * z\n\t\t\t\t\tv += x * z\n\t\t\t\t\tif v > 1000 {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif v == n {\n\t\t\t\t\t\tans++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1594517055, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02608.html", "problem_id": "p02608", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02608/input.txt", "sample_output_relpath": "derived/input_output/data/p02608/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02608/Go/s393442412.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s393442412", "user_id": "u737368452"}, "prompt_components": {"gold_output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\n\tfor n := 1; n <= N; n++ {\n\t\tans := 0\n\t\tfor x := 1; x < 32; x++ {\n\t\t\tfor y := 1; y < 32; y++ {\n\t\t\t\tfor z := 1; z < 32; z++ {\n\t\t\t\t\tv := x * x\n\t\t\t\t\tv += y * y\n\t\t\t\t\tv += z * z\n\t\t\t\t\tv += x * y\n\t\t\t\t\tv += y * z\n\t\t\t\t\tv += x * z\n\t\t\t\t\tif v > 1000 {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif v == n {\n\t\t\t\t\t\tans++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "sample_input": "20\n"}, "reference_outputs": ["0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"], "source_document_id": "p02608", "source_text": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1419, "cpu_time_ms": 233, "memory_kb": 1796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s349225189", "group_id": "codeNet:p02609", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc popcount(x int) int {\n\tres := 0\n\tfor x > 0 {\n\t\tres += (x & 1)\n\t\tx >>= 1\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, x := nextInt(), next()\n\n\tf := make([]int, 200001)\n\tfor i := 1; i <= 200000; i++ {\n\t\tp := popcount(i)\n\t\tf[i] = f[i%p] + 1\n\t}\n\tpc := 0\n\tfor i := range x {\n\t\tif x[i] == '1' {\n\t\t\tpc++\n\t\t}\n\t}\n\tif pc == 0 {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tputs(1)\n\t\t}\n\t\treturn\n\t} else if pc == 1 {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif x[i] == '1' {\n\t\t\t\tputs(0)\n\t\t\t} else if i == n-1 || x[n-1] == '1' {\n\t\t\t\tputs(2)\n\t\t\t} else {\n\t\t\t\tputs(1)\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\t// r[i]: 2^(n-1-i)を[pc-1, pc+1]で割ったあまり\n\tr := make([][2]int, n)\n\t// xr: xを[pc-1, pc+1]で割ったあまり\n\txr := [2]int{}\n\tpow0, pow1 := 1, 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tr[i][0], r[i][1] = pow0, pow1\n\t\tif x[i] == '1' {\n\t\t\txr[0] += r[i][0]\n\t\t\txr[0] %= pc - 1\n\t\t\txr[1] += r[i][1]\n\t\t\txr[1] %= pc + 1\n\t\t}\n\t\tpow0 *= 2\n\t\tpow0 %= pc - 1\n\t\tpow1 *= 2\n\t\tpow1 %= pc + 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tvar xi int\n\t\tif x[i] == '0' {\n\t\t\t// 0 -> 1\n\t\t\txi = (xr[1] + r[i][1]) % (pc + 1)\n\t\t} else {\n\t\t\t// 1 -> 0\n\t\t\txi = (xr[0] - r[i][0] + pc - 1) % (pc - 1)\n\t\t}\n\t\tans := 1 + f[xi]\n\t\tputs(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594607853, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02609.html", "problem_id": "p02609", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02609/input.txt", "sample_output_relpath": "derived/input_output/data/p02609/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02609/Go/s349225189.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s349225189", "user_id": "u502813058"}, "prompt_components": {"gold_output": "2\n1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc popcount(x int) int {\n\tres := 0\n\tfor x > 0 {\n\t\tres += (x & 1)\n\t\tx >>= 1\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, x := nextInt(), next()\n\n\tf := make([]int, 200001)\n\tfor i := 1; i <= 200000; i++ {\n\t\tp := popcount(i)\n\t\tf[i] = f[i%p] + 1\n\t}\n\tpc := 0\n\tfor i := range x {\n\t\tif x[i] == '1' {\n\t\t\tpc++\n\t\t}\n\t}\n\tif pc == 0 {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tputs(1)\n\t\t}\n\t\treturn\n\t} else if pc == 1 {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif x[i] == '1' {\n\t\t\t\tputs(0)\n\t\t\t} else if i == n-1 || x[n-1] == '1' {\n\t\t\t\tputs(2)\n\t\t\t} else {\n\t\t\t\tputs(1)\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\t// r[i]: 2^(n-1-i)を[pc-1, pc+1]で割ったあまり\n\tr := make([][2]int, n)\n\t// xr: xを[pc-1, pc+1]で割ったあまり\n\txr := [2]int{}\n\tpow0, pow1 := 1, 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tr[i][0], r[i][1] = pow0, pow1\n\t\tif x[i] == '1' {\n\t\t\txr[0] += r[i][0]\n\t\t\txr[0] %= pc - 1\n\t\t\txr[1] += r[i][1]\n\t\t\txr[1] %= pc + 1\n\t\t}\n\t\tpow0 *= 2\n\t\tpow0 %= pc - 1\n\t\tpow1 *= 2\n\t\tpow1 %= pc + 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tvar xi int\n\t\tif x[i] == '0' {\n\t\t\t// 0 -> 1\n\t\t\txi = (xr[1] + r[i][1]) % (pc + 1)\n\t\t} else {\n\t\t\t// 1 -> 0\n\t\t\txi = (xr[0] - r[i][0] + pc - 1) % (pc - 1)\n\t\t}\n\t\tans := 1 + f[xi]\n\t\tputs(ans)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "sample_input": "3\n011\n"}, "reference_outputs": ["2\n1\n1\n"], "source_document_id": "p02609", "source_text": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1620, "cpu_time_ms": 53, "memory_kb": 8716}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s207527049", "group_id": "codeNet:p02609", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/bits\"\n\t\"strconv\"\n)\n\nfunc popCount(n uint64) int {\n\treturn bits.OnesCount64(n)\n}\n\nfunc f(n int64) int {\n\tcnt := 0\n\tfor n != 0 {\n\t\tn = n % int64(popCount(uint64(n)))\n\t\tcnt++\n\t}\n\t\n\treturn cnt\n}\n\nfunc bitFlip(n int64, pos int) int64 {\n\treturn n ^ (int64(1) << pos)\n}\n\nfunc solve(n uint, s string) []int {\n\tanswer := make([]int, 0, n)\n\tx, _ := strconv.ParseInt(s, 2, 64)\n\t\n\tfor i := n-1; i > 0; i-- {\n\t\txi := bitFlip(x, int(i))\n\t\tanswer = append(answer, f(xi))\n\t}\n\n\treturn answer\n}\n\nfunc main() {\n\tvar N uint\n\tfmt.Scan(&N)\n\n\tvar s string\n\tfmt.Scan(&s)\n\t\n\n\tresult := solve(N, s)\n\tfor _, n := range result {\n\t\tfmt.Println(n)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594523491, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02609.html", "problem_id": "p02609", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02609/input.txt", "sample_output_relpath": "derived/input_output/data/p02609/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02609/Go/s207527049.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s207527049", "user_id": "u111833322"}, "prompt_components": {"gold_output": "2\n1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/bits\"\n\t\"strconv\"\n)\n\nfunc popCount(n uint64) int {\n\treturn bits.OnesCount64(n)\n}\n\nfunc f(n int64) int {\n\tcnt := 0\n\tfor n != 0 {\n\t\tn = n % int64(popCount(uint64(n)))\n\t\tcnt++\n\t}\n\t\n\treturn cnt\n}\n\nfunc bitFlip(n int64, pos int) int64 {\n\treturn n ^ (int64(1) << pos)\n}\n\nfunc solve(n uint, s string) []int {\n\tanswer := make([]int, 0, n)\n\tx, _ := strconv.ParseInt(s, 2, 64)\n\t\n\tfor i := n-1; i > 0; i-- {\n\t\txi := bitFlip(x, int(i))\n\t\tanswer = append(answer, f(xi))\n\t}\n\n\treturn answer\n}\n\nfunc main() {\n\tvar N uint\n\tfmt.Scan(&N)\n\n\tvar s string\n\tfmt.Scan(&s)\n\t\n\n\tresult := solve(N, s)\n\tfor _, n := range result {\n\t\tfmt.Println(n)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "sample_input": "3\n011\n"}, "reference_outputs": ["2\n1\n1\n"], "source_document_id": "p02609", "source_text": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 660, "cpu_time_ms": 2205, "memory_kb": 4828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s434205575", "group_id": "codeNet:p02609", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/bits\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getMod(X string, m int) int {\n\n\tr := 0\n\tfor _, v := range X {\n\t\tr *= 2\n\t\tif v == '1' {\n\t\t\tr += 1\n\t\t}\n\t\tr %= m\n\t}\n\treturn r\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN, X := sc.NextInt(), sc.Next()\n\tmemo := map[int]int{}\n\tvar dfs func(int, int) int\n\tdfs = func(X int, count int) int {\n\t\tif X == 0 {\n\t\t\treturn count\n\t\t}\n\t\tif _, ok := memo[X]; !ok {\n\t\t\tm := bits.OnesCount32(uint32(X))\n\t\t\tmemo[X] = dfs(X%m, count+1)\n\t\t\treturn memo[X]\n\t\t} else {\n\t\t\treturn memo[X] + count\n\t\t}\n\t}\n\tfor i := 1; i <= N; i++ {\n\t\tdfs(i, 0)\n\t}\n\t//fmt.Printf(\"%+v\\n\", memo)\n\n\tc := strings.Count(X, \"1\")\n\t//baseMode := getMod(X, c)\n\tbaseModePlus := getMod(X, c+1)\n\tvar baseModeMinus int\n\tif c > 1 {\n\t\tbaseModeMinus = getMod(X, c-1)\n\t} else {\n\t\tbaseModeMinus = 0\n\t}\n\tac := make([]int, 2)\n\tac[0] = 1\n\tac[1] = 1\n\tans := make([]int, N)\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif X[i] == '0' {\n\t\t\tm := (baseModePlus + ac[0]) % (c + 1)\n\t\t\t//println(X, c, i, m, q)\n\t\t\tans[i] = dfs(m, 0) + 1\n\t\t} else {\n\t\t\tif c == 1 {\n\t\t\t\tans[i] = 0\n\t\t\t} else {\n\t\t\t\tm := (baseModeMinus - ac[1] + c - 1) % (c - 1)\n\t\t\t\t//println(baseModeMinus, ac[1], c, m)\n\t\t\t\tif m == 0 {\n\t\t\t\t\tans[i] = 1\n\t\t\t\t} else {\n\t\t\t\t\tans[i] = dfs(m, 0) + 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tac[i] *= 2\n\t\t}\n\t\tac[0] %= c + 1\n\t\tif c > 1 {\n\t\t\tac[1] %= c - 1\n\t\t} else {\n\t\t\tac[1] = 0\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Println(ans[i])\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594521029, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02609.html", "problem_id": "p02609", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02609/input.txt", "sample_output_relpath": "derived/input_output/data/p02609/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02609/Go/s434205575.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s434205575", "user_id": "u504669764"}, "prompt_components": {"gold_output": "2\n1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/bits\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getMod(X string, m int) int {\n\n\tr := 0\n\tfor _, v := range X {\n\t\tr *= 2\n\t\tif v == '1' {\n\t\t\tr += 1\n\t\t}\n\t\tr %= m\n\t}\n\treturn r\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN, X := sc.NextInt(), sc.Next()\n\tmemo := map[int]int{}\n\tvar dfs func(int, int) int\n\tdfs = func(X int, count int) int {\n\t\tif X == 0 {\n\t\t\treturn count\n\t\t}\n\t\tif _, ok := memo[X]; !ok {\n\t\t\tm := bits.OnesCount32(uint32(X))\n\t\t\tmemo[X] = dfs(X%m, count+1)\n\t\t\treturn memo[X]\n\t\t} else {\n\t\t\treturn memo[X] + count\n\t\t}\n\t}\n\tfor i := 1; i <= N; i++ {\n\t\tdfs(i, 0)\n\t}\n\t//fmt.Printf(\"%+v\\n\", memo)\n\n\tc := strings.Count(X, \"1\")\n\t//baseMode := getMod(X, c)\n\tbaseModePlus := getMod(X, c+1)\n\tvar baseModeMinus int\n\tif c > 1 {\n\t\tbaseModeMinus = getMod(X, c-1)\n\t} else {\n\t\tbaseModeMinus = 0\n\t}\n\tac := make([]int, 2)\n\tac[0] = 1\n\tac[1] = 1\n\tans := make([]int, N)\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif X[i] == '0' {\n\t\t\tm := (baseModePlus + ac[0]) % (c + 1)\n\t\t\t//println(X, c, i, m, q)\n\t\t\tans[i] = dfs(m, 0) + 1\n\t\t} else {\n\t\t\tif c == 1 {\n\t\t\t\tans[i] = 0\n\t\t\t} else {\n\t\t\t\tm := (baseModeMinus - ac[1] + c - 1) % (c - 1)\n\t\t\t\t//println(baseModeMinus, ac[1], c, m)\n\t\t\t\tif m == 0 {\n\t\t\t\t\tans[i] = 1\n\t\t\t\t} else {\n\t\t\t\t\tans[i] = dfs(m, 0) + 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tac[i] *= 2\n\t\t}\n\t\tac[0] %= c + 1\n\t\tif c > 1 {\n\t\t\tac[1] %= c - 1\n\t\t} else {\n\t\t\tac[1] = 0\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Println(ans[i])\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "sample_input": "3\n011\n"}, "reference_outputs": ["2\n1\n1\n"], "source_document_id": "p02609", "source_text": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3367, "cpu_time_ms": 394, "memory_kb": 14200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s802911144", "group_id": "codeNet:p02609", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tX := getString()\n\n\tdefaultValue, _ := strconv.ParseInt(X, 2, 64)\n\tdefaultCnt := strings.Count(X, \"1\")\n\tvalues := make([]int, N)\n\tcounts := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tif X[i] == '0' {\n\t\t\tvalues[i] = int(defaultValue) + pow(2, N - (i+1))\n\t\t\tcounts[i] = defaultCnt + 1\n\t\t} else {\n\t\t\tvalues[i] = int(defaultValue) - pow(2, N - (i+1))\n\t\t\tcounts[i] = defaultCnt - 1\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tresult := 0\n\t\tfor ; values[i] != 0; {\n\t\t\tresult++\n\t\t\tvalues[i] = values[i] % counts[i]\n\t\t\tcounts[i] = strings.Count(fmt.Sprintf(\"%b\", values[i]), \"1\")\n\t\t}\n\t\tfmt.Println(result)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1594517742, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02609.html", "problem_id": "p02609", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02609/input.txt", "sample_output_relpath": "derived/input_output/data/p02609/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02609/Go/s802911144.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s802911144", "user_id": "u964273035"}, "prompt_components": {"gold_output": "2\n1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tX := getString()\n\n\tdefaultValue, _ := strconv.ParseInt(X, 2, 64)\n\tdefaultCnt := strings.Count(X, \"1\")\n\tvalues := make([]int, N)\n\tcounts := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tif X[i] == '0' {\n\t\t\tvalues[i] = int(defaultValue) + pow(2, N - (i+1))\n\t\t\tcounts[i] = defaultCnt + 1\n\t\t} else {\n\t\t\tvalues[i] = int(defaultValue) - pow(2, N - (i+1))\n\t\t\tcounts[i] = defaultCnt - 1\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tresult := 0\n\t\tfor ; values[i] != 0; {\n\t\t\tresult++\n\t\t\tvalues[i] = values[i] % counts[i]\n\t\t\tcounts[i] = strings.Count(fmt.Sprintf(\"%b\", values[i]), \"1\")\n\t\t}\n\t\tfmt.Println(result)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "sample_input": "3\n011\n"}, "reference_outputs": ["2\n1\n1\n"], "source_document_id": "p02609", "source_text": "Score : 400 points\n\nProblem Statement\n\nLet \\mathrm{popcount}(n) be the number of 1s in the binary representation of n.\nFor example, \\mathrm{popcount}(3) = 2, \\mathrm{popcount}(7) = 3, and \\mathrm{popcount}(0) = 0.\n\nLet f(n) be the number of times the following operation will be done when we repeat it until n becomes 0: \"replace n with the remainder when n is divided by \\mathrm{popcount}(n).\" (It can be proved that, under the constraints of this problem, n always becomes 0 after a finite number of operations.)\n\nFor example, when n=7, it becomes 0 after two operations, as follows:\n\n\\mathrm{popcount}(7)=3, so we divide 7 by 3 and replace it with the remainder, 1.\n\n\\mathrm{popcount}(1)=1, so we divide 1 by 1 and replace it with the remainder, 0.\n\nYou are given an integer X with N digits in binary.\nFor each integer i such that 1 \\leq i \\leq N, let X_i be what X becomes when the i-th bit from the top is inverted.\nFind f(X_1), f(X_2), \\ldots, f(X_N).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nX is an integer with N digits in binary, possibly with leading zeros.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(X_i).\n\nSample Input 1\n\n3\n011\n\nSample Output 1\n\n2\n1\n1\n\nX_1 = 7, which will change as follows: 7 \\rightarrow 1 \\rightarrow 0. Thus, f(7) = 2.\n\nX_2 = 1, which will change as follows: 1 \\rightarrow 0. Thus, f(1) = 1.\n\nX_3 = 2, which will change as follows: 2 \\rightarrow 0. Thus, f(2) = 1.\n\nSample Input 2\n\n23\n00110111001011011001110\n\nSample Output 2\n\n2\n1\n2\n2\n1\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6333, "cpu_time_ms": 390, "memory_kb": 9244}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s073275717", "group_id": "codeNet:p02613", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ts := make([]string, n)\n\tresult := map[string]int{\"AC\": 0, \"WA\": 0, \"TLE\": 0, \"RE\": 0}\n\n\tfor i:=0; i>shift&1 == 1 {\n\t\t\t\tignoreRows[shift] = struct{}{}\n\t\t\t}\n\t\t}\n\t\tfor j, jMax := 0, 1<>shift&1 == 1 {\n\t\t\t\t\tignoreCols[shift] = struct{}{}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcnt := count(c, ignoreRows, ignoreCols)\n\t\t\tif cnt == k {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc count(c []string, ignoreRows, ignoreCols map[int]struct{}) int {\n\tret := 0\n\tfor i, row := range c {\n\t\tif _, ok := ignoreRows[i]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tfor j, char := range row {\n\t\t\tif _, ok := ignoreCols[j]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif char == '#' {\n\t\t\t\tret++\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "language": "Go", "metadata": {"date": 1594001167, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02614.html", "problem_id": "p02614", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02614/input.txt", "sample_output_relpath": "derived/input_output/data/p02614/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02614/Go/s309915217.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s309915217", "user_id": "u914096063"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\th, w, k := io.NextInt(), io.NextInt(), io.NextInt()\n\tc := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tc[i] = io.Next()\n\t}\n\tans := solve(h, w, k, c)\n\tio.Println(ans)\n}\n\nfunc solve(h, w, k int, c []string) (ans int) {\n\tfor i, iMax := 0, 1<>shift&1 == 1 {\n\t\t\t\tignoreRows[shift] = struct{}{}\n\t\t\t}\n\t\t}\n\t\tfor j, jMax := 0, 1<>shift&1 == 1 {\n\t\t\t\t\tignoreCols[shift] = struct{}{}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcnt := count(c, ignoreRows, ignoreCols)\n\t\t\tif cnt == k {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc count(c []string, ignoreRows, ignoreCols map[int]struct{}) int {\n\tret := 0\n\tfor i, row := range c {\n\t\tif _, ok := ignoreRows[i]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tfor j, char := range row {\n\t\t\tif _, ok := ignoreCols[j]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif char == '#' {\n\t\t\t\tret++\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a grid of H rows and W columns of squares. The color of the square at the i-th row from the top and the j-th column from the left (1 \\leq i \\leq H, 1 \\leq j \\leq W) is given to you as a character c_{i,j}: the square is white if c_{i,j} is ., and black if c_{i,j} is #.\n\nConsider doing the following operation:\n\nChoose some number of rows (possibly zero), and some number of columns (possibly zero). Then, paint red all squares in the chosen rows and all squares in the chosen columns.\n\nYou are given a positive integer K. How many choices of rows and columns result in exactly K black squares remaining after the operation? Here, we consider two choices different when there is a row or column chosen in only one of those choices.\n\nConstraints\n\n1 \\leq H, W \\leq 6\n\n1 \\leq K \\leq HW\n\nc_{i,j} is . or #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\nc_{1,1}c_{1,2}...c_{1,W}\nc_{2,1}c_{2,2}...c_{2,W}\n:\nc_{H,1}c_{H,2}...c_{H,W}\n\nOutput\n\nPrint an integer representing the number of choices of rows and columns satisfying the condition.\n\nSample Input 1\n\n2 3 2\n..#\n###\n\nSample Output 1\n\n5\n\nFive choices below satisfy the condition.\n\nThe 1-st row and 1-st column\n\nThe 1-st row and 2-nd column\n\nThe 1-st row and 3-rd column\n\nThe 1-st and 2-nd column\n\nThe 3-rd column\n\nSample Input 2\n\n2 3 4\n..#\n###\n\nSample Output 2\n\n1\n\nOne choice, which is choosing nothing, satisfies the condition.\n\nSample Input 3\n\n2 2 3\n##\n##\n\nSample Output 3\n\n0\n\nSample Input 4\n\n6 6 8\n..##..\n.#..#.\n#....#\n######\n#....#\n#....#\n\nSample Output 4\n\n208", "sample_input": "2 3 2\n..#\n###\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02614", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a grid of H rows and W columns of squares. The color of the square at the i-th row from the top and the j-th column from the left (1 \\leq i \\leq H, 1 \\leq j \\leq W) is given to you as a character c_{i,j}: the square is white if c_{i,j} is ., and black if c_{i,j} is #.\n\nConsider doing the following operation:\n\nChoose some number of rows (possibly zero), and some number of columns (possibly zero). Then, paint red all squares in the chosen rows and all squares in the chosen columns.\n\nYou are given a positive integer K. How many choices of rows and columns result in exactly K black squares remaining after the operation? Here, we consider two choices different when there is a row or column chosen in only one of those choices.\n\nConstraints\n\n1 \\leq H, W \\leq 6\n\n1 \\leq K \\leq HW\n\nc_{i,j} is . or #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\nc_{1,1}c_{1,2}...c_{1,W}\nc_{2,1}c_{2,2}...c_{2,W}\n:\nc_{H,1}c_{H,2}...c_{H,W}\n\nOutput\n\nPrint an integer representing the number of choices of rows and columns satisfying the condition.\n\nSample Input 1\n\n2 3 2\n..#\n###\n\nSample Output 1\n\n5\n\nFive choices below satisfy the condition.\n\nThe 1-st row and 1-st column\n\nThe 1-st row and 2-nd column\n\nThe 1-st row and 3-rd column\n\nThe 1-st and 2-nd column\n\nThe 3-rd column\n\nSample Input 2\n\n2 3 4\n..#\n###\n\nSample Output 2\n\n1\n\nOne choice, which is choosing nothing, satisfies the condition.\n\nSample Input 3\n\n2 2 3\n##\n##\n\nSample Output 3\n\n0\n\nSample Input 4\n\n6 6 8\n..##..\n.#..#.\n#....#\n######\n#....#\n#....#\n\nSample Output 4\n\n208", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2297, "cpu_time_ms": 8, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s309290833", "group_id": "codeNet:p02615", "input_text": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n \"bufio\"\n \"os\"\n \"io\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc main() {\n sc = initScanner(os.Stdin)\n fmt.Println(resolve(parseProblem()))\n}\n\nfunc parseProblem() (int, []int) {\n n := scanInt(sc)\n player := make([]int, n)\n for i := 0; i < n; i++ {\n player[i] = scanInt(sc)\n }\n return n, player\n}\n\nfunc resolve(n int, player []int) int {\n //フレンドリーを逆順にソートする\n sort.Sort(sort.Reverse(sort.IntSlice(player)))\n\n comfort := 0\n for i := 1; i < n; i++ {\n comfort += player[i/2]\n }\n return comfort\n}\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n sc := bufio.NewScanner(r)\n sc.Split(bufio.ScanWords)\n return sc\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n sc.Scan()\n i, _ := strconv.Atoi(sc.Text())\n return int(i)\n}\n\nfunc scanString(sc *bufio.Scanner) string {\n sc.Scan()\n return sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1595775731, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/Go/s309290833.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s309290833", "user_id": "u231416359"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n \"bufio\"\n \"os\"\n \"io\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc main() {\n sc = initScanner(os.Stdin)\n fmt.Println(resolve(parseProblem()))\n}\n\nfunc parseProblem() (int, []int) {\n n := scanInt(sc)\n player := make([]int, n)\n for i := 0; i < n; i++ {\n player[i] = scanInt(sc)\n }\n return n, player\n}\n\nfunc resolve(n int, player []int) int {\n //フレンドリーを逆順にソートする\n sort.Sort(sort.Reverse(sort.IntSlice(player)))\n\n comfort := 0\n for i := 1; i < n; i++ {\n comfort += player[i/2]\n }\n return comfort\n}\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n sc := bufio.NewScanner(r)\n sc.Split(bufio.ScanWords)\n return sc\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n sc.Scan()\n i, _ := strconv.Atoi(sc.Text())\n return int(i)\n}\n\nfunc scanString(sc *bufio.Scanner) string {\n sc.Scan()\n return sc.Text()\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 942, "cpu_time_ms": 92, "memory_kb": 5920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s144140428", "group_id": "codeNet:p02615", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tN int\n\tA []int\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\treadVariables()\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] > A[j]\n\t})\n\tq := NewIntPriorityQueue(func(x, y int) bool {\n\t\treturn x > y\n\t})\n\theap.Push(q, A[0])\n\tvar answer int\n\tfor i := 1; i < N; i++ {\n\t\tv := heap.Pop(q).(int)\n\t\tanswer += v\n\t\tnext := MinInt(v, A[i])\n\t\theap.Push(q, next)\n\t\theap.Push(q, next) // 2回追加する\n\t}\n\tprintln(answer)\n}\n\nfunc readVariables() {\n\tN = nextInt()\n\tA = make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\n}\n\n/* Template */\n\nvar (\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n)\n\nfunc init() {\n\tMax := 1001001\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 0, Max), Max)\n\tscanner.Split(bufio.ScanWords)\n\twriter = bufio.NewWriterSize(os.Stdout, Max)\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n\n//nextInt converts next token from stdin and returns integer value.\n//nextInt panics when conversion into an integer fails.\nfunc nextInt() int {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(\"nextInt(): cannot convert to int: \" + scanner.Text())\n\t}\n\treturn num\n}\n\nfunc nextStr() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\treturn scanner.Text()\n}\n\n// MinInt returns minimum argument\nfunc MinInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\n//MaxInt returns maximum argument\nfunc MaxInt(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\n//AbsInt returns |x| for x\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n// IntPriorityQueue は、整数値の優先度付きキューを表す。\ntype IntPriorityQueue struct {\n\tvalues []int\n\tlessVal func(x, y int) bool // indexではなく値を比較するless関数\n}\n\n// NewIntPriorityQueue は、引数のless関数で整数値を比較するIntPriorityQueueを生成する。\nfunc NewIntPriorityQueue(lessVal func(x, y int) bool) *IntPriorityQueue {\n\tq := &IntPriorityQueue{\n\t\tvalues: make([]int, 0),\n\t\tlessVal: lessVal,\n\t}\n\theap.Init(q)\n\treturn q\n}\n\n// Len は、要素数を返す。\nfunc (q *IntPriorityQueue) Len() int {\n\treturn len(q.values)\n}\n\n// Less は、比較関数\nfunc (q *IntPriorityQueue) Less(i, j int) bool {\n\treturn q.lessVal(q.values[i], q.values[j])\n}\n\n// Swap は、要素をスワップする\nfunc (q *IntPriorityQueue) Swap(i, j int) {\n\tq.values[i], q.values[j] = q.values[j], q.values[i]\n}\n\n// Pop pops elem\nfunc (q *IntPriorityQueue) Pop() interface{} {\n\tv := q.values[q.Len()-1]\n\tq.values = q.values[0 : q.Len()-1]\n\treturn v\n}\n\nfunc (q *IntPriorityQueue) Push(x interface{}) {\n\tv := x.(int)\n\tq.values = append(q.values, v)\n}\n", "language": "Go", "metadata": {"date": 1594774276, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/Go/s144140428.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s144140428", "user_id": "u390694622"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tN int\n\tA []int\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\treadVariables()\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] > A[j]\n\t})\n\tq := NewIntPriorityQueue(func(x, y int) bool {\n\t\treturn x > y\n\t})\n\theap.Push(q, A[0])\n\tvar answer int\n\tfor i := 1; i < N; i++ {\n\t\tv := heap.Pop(q).(int)\n\t\tanswer += v\n\t\tnext := MinInt(v, A[i])\n\t\theap.Push(q, next)\n\t\theap.Push(q, next) // 2回追加する\n\t}\n\tprintln(answer)\n}\n\nfunc readVariables() {\n\tN = nextInt()\n\tA = make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\n}\n\n/* Template */\n\nvar (\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n)\n\nfunc init() {\n\tMax := 1001001\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 0, Max), Max)\n\tscanner.Split(bufio.ScanWords)\n\twriter = bufio.NewWriterSize(os.Stdout, Max)\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n\n//nextInt converts next token from stdin and returns integer value.\n//nextInt panics when conversion into an integer fails.\nfunc nextInt() int {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(\"nextInt(): cannot convert to int: \" + scanner.Text())\n\t}\n\treturn num\n}\n\nfunc nextStr() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\treturn scanner.Text()\n}\n\n// MinInt returns minimum argument\nfunc MinInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\n//MaxInt returns maximum argument\nfunc MaxInt(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\n//AbsInt returns |x| for x\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n// IntPriorityQueue は、整数値の優先度付きキューを表す。\ntype IntPriorityQueue struct {\n\tvalues []int\n\tlessVal func(x, y int) bool // indexではなく値を比較するless関数\n}\n\n// NewIntPriorityQueue は、引数のless関数で整数値を比較するIntPriorityQueueを生成する。\nfunc NewIntPriorityQueue(lessVal func(x, y int) bool) *IntPriorityQueue {\n\tq := &IntPriorityQueue{\n\t\tvalues: make([]int, 0),\n\t\tlessVal: lessVal,\n\t}\n\theap.Init(q)\n\treturn q\n}\n\n// Len は、要素数を返す。\nfunc (q *IntPriorityQueue) Len() int {\n\treturn len(q.values)\n}\n\n// Less は、比較関数\nfunc (q *IntPriorityQueue) Less(i, j int) bool {\n\treturn q.lessVal(q.values[i], q.values[j])\n}\n\n// Swap は、要素をスワップする\nfunc (q *IntPriorityQueue) Swap(i, j int) {\n\tq.values[i], q.values[j] = q.values[j], q.values[i]\n}\n\n// Pop pops elem\nfunc (q *IntPriorityQueue) Pop() interface{} {\n\tv := q.values[q.Len()-1]\n\tq.values = q.values[0 : q.Len()-1]\n\treturn v\n}\n\nfunc (q *IntPriorityQueue) Push(x interface{}) {\n\tv := x.(int)\n\tq.values = append(q.values, v)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2869, "cpu_time_ms": 136, "memory_kb": 13292}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s963394118", "group_id": "codeNet:p02615", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\ta = risort(a)\n\tvar c []int\n\tvar ret int\n\tfor _, v := range a {\n\t\tvar f int\n\t\tc, f = addCircle(c, v)\n\t\tret += f\n\t}\n\n\tfmt.Println(ret)\n}\n\nfunc addCircle(c []int, n int) ([]int, int) {\n\tif len(c) == 0 {\n\t\tc = append(c, n)\n\t\treturn c, 0\n\t}\n\tif len(c) == 1 {\n\t\tf := c[0]\n\t\tc = append(c, n)\n\t\treturn c, f\n\t}\n\n\tvar maxKey int\n\tvar maxValue int\n\tfor k, v := range c {\n\t\tif k == 0 {\n\t\t\tif v < c[len(c)-1] {\n\t\t\t\tmaxValue = v\n\t\t\t} else {\n\t\t\t\tmaxValue = c[len(c)-1]\n\t\t\t}\n\t\t\tmaxKey = 0\n\t\t\tcontinue\n\t\t}\n\n\t\tvar tmp int\n\t\tif v < c[k-1] {\n\t\t\ttmp = v\n\t\t} else {\n\t\t\ttmp = c[k-1]\n\t\t}\n\t\tif maxValue < tmp {\n\t\t\tmaxValue = tmp\n\t\t\tmaxKey = k\n\t\t}\n\t}\n\n\tc = insert(c, maxKey, n)\n\treturn c, maxValue\n}\n\nfunc insert(h []int, k int, n int) []int {\n\tret := h[0:k:k]\n\tret = append(ret, n)\n\tret = append(ret, h[k:]...)\n\treturn ret\n}\n\nfunc risort(s []int) []int {\n\tsort.Slice(s, func(i, j int) bool { return s[i] > s[j] })\n\treturn s\n}\nfunc isort(s []int) []int {\n\tsort.Slice(s, func(i, j int) bool { return s[i] < s[j] })\n\treturn s\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1594173775, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/Go/s963394118.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s963394118", "user_id": "u137939942"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\ta = risort(a)\n\tvar c []int\n\tvar ret int\n\tfor _, v := range a {\n\t\tvar f int\n\t\tc, f = addCircle(c, v)\n\t\tret += f\n\t}\n\n\tfmt.Println(ret)\n}\n\nfunc addCircle(c []int, n int) ([]int, int) {\n\tif len(c) == 0 {\n\t\tc = append(c, n)\n\t\treturn c, 0\n\t}\n\tif len(c) == 1 {\n\t\tf := c[0]\n\t\tc = append(c, n)\n\t\treturn c, f\n\t}\n\n\tvar maxKey int\n\tvar maxValue int\n\tfor k, v := range c {\n\t\tif k == 0 {\n\t\t\tif v < c[len(c)-1] {\n\t\t\t\tmaxValue = v\n\t\t\t} else {\n\t\t\t\tmaxValue = c[len(c)-1]\n\t\t\t}\n\t\t\tmaxKey = 0\n\t\t\tcontinue\n\t\t}\n\n\t\tvar tmp int\n\t\tif v < c[k-1] {\n\t\t\ttmp = v\n\t\t} else {\n\t\t\ttmp = c[k-1]\n\t\t}\n\t\tif maxValue < tmp {\n\t\t\tmaxValue = tmp\n\t\t\tmaxKey = k\n\t\t}\n\t}\n\n\tc = insert(c, maxKey, n)\n\treturn c, maxValue\n}\n\nfunc insert(h []int, k int, n int) []int {\n\tret := h[0:k:k]\n\tret = append(ret, n)\n\tret = append(ret, h[k:]...)\n\treturn ret\n}\n\nfunc risort(s []int) []int {\n\tsort.Slice(s, func(i, j int) bool { return s[i] > s[j] })\n\treturn s\n}\nfunc isort(s []int) []int {\n\tsort.Slice(s, func(i, j int) bool { return s[i] < s[j] })\n\treturn s\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1339, "cpu_time_ms": 2206, "memory_kb": 8700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s701133442", "group_id": "codeNet:p02616", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr *bufio.Reader\nvar mI, pI int\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n}\n\nfunc solve() {\n\tN, K := readint2()\n\tA := readIntSlice(N)\n\tplus := make([]int, 0)\n\tminus := make([]int, 0)\n\tfor _, v := range A {\n\t\tif v >= 0 {\n\t\t\tplus = append(plus, v)\n\t\t} else {\n\t\t\tminus = append(minus, v)\n\t\t}\n\t}\n\tsort.Slice(plus, func(i, j int) bool {\n\t\treturn plus[i] > plus[j]\n\t})\n\tsort.Slice(minus, func(i, j int) bool {\n\t\treturn minus[i] < minus[j]\n\t})\n\n\tif N == K {\n\t\tans := 1\n\t\tfor _, v := range A {\n\t\t\tans = (ans * v) % MOD\n\t\t}\n\t\tfmt.Println(ans)\n\t\tos.Exit(0)\n\t}\n\n\tif K%2 == 1 && len(minus) == N {\n\t\tans := 1\n\t\tfor i := 0; i < K; i++ {\n\t\t\tans = mod(ans*minus[N-1-i], MOD)\n\t\t}\n\t\tfmt.Println(ans)\n\t\tos.Exit(0)\n\t}\n\n\t// ans := 1\n\tl, r := 0, N-1\n\tans := 1\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] > A[j]\n\t})\n\tif K%2 == 1 {\n\t\tans = mod(ans*A[0], MOD)\n\t\tl += 1\n\t\tK -= 1\n\t}\n\n\tfor i := 0; i < K/2; i++ {\n\t\tlv := A[l] * A[l+1]\n\t\trv := A[r] * A[r-1]\n\t\tif rv > lv {\n\t\t\tans = mod(mod(rv, MOD)*ans, MOD)\n\t\t\tr -= 2\n\t\t} else {\n\t\t\tans = mod(mod(lv, MOD)*ans, MOD)\n\t\t\tl += 2\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, 16)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i(v)\n\t}\n\treturn slice\n}\n\nfunc readInt64Slice(size int) []int64 {\n\tslice := make([]int64, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i64(v)\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint2() (int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1])\n}\n\nfunc readint64() int64 {\n\treturn s2i64(readline())\n}\n\n// For int64\nfunc b2i64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min64(values ...int64) int64 {\n\tret := int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max64(values ...int64) int64 {\n\tret := -int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc mod(x, y int) int {\n\tm := x % y\n\tif m < 0 {\n\t\treturn m + y\n\t}\n\treturn m\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\nfunc min(values ...int) int {\n\tret := INF_INT\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INF_INT\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc lcm(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc gcd(v1, v2 int) int {\n\treturn v1 * v2 / lcm(v1, v2)\n}\n\nfunc bit(size int) [][]bool {\n\tbSize := int(math.Pow(2, float64(size)))\n\tb := make([][]bool, bSize)\n\tfor i := 0; i < bSize; i++ {\n\t\tb[i] = make([]bool, size)\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif i>>j&1 == 1 {\n\t\t\t\tb[i][j] = true\n\t\t\t} else {\n\t\t\t\tb[i][j] = false\n\t\t\t}\n\t\t}\n\t}\n\treturn b\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n", "language": "Go", "metadata": {"date": 1596670002, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02616.html", "problem_id": "p02616", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02616/input.txt", "sample_output_relpath": "derived/input_output/data/p02616/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02616/Go/s701133442.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s701133442", "user_id": "u811202694"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr *bufio.Reader\nvar mI, pI int\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n}\n\nfunc solve() {\n\tN, K := readint2()\n\tA := readIntSlice(N)\n\tplus := make([]int, 0)\n\tminus := make([]int, 0)\n\tfor _, v := range A {\n\t\tif v >= 0 {\n\t\t\tplus = append(plus, v)\n\t\t} else {\n\t\t\tminus = append(minus, v)\n\t\t}\n\t}\n\tsort.Slice(plus, func(i, j int) bool {\n\t\treturn plus[i] > plus[j]\n\t})\n\tsort.Slice(minus, func(i, j int) bool {\n\t\treturn minus[i] < minus[j]\n\t})\n\n\tif N == K {\n\t\tans := 1\n\t\tfor _, v := range A {\n\t\t\tans = (ans * v) % MOD\n\t\t}\n\t\tfmt.Println(ans)\n\t\tos.Exit(0)\n\t}\n\n\tif K%2 == 1 && len(minus) == N {\n\t\tans := 1\n\t\tfor i := 0; i < K; i++ {\n\t\t\tans = mod(ans*minus[N-1-i], MOD)\n\t\t}\n\t\tfmt.Println(ans)\n\t\tos.Exit(0)\n\t}\n\n\t// ans := 1\n\tl, r := 0, N-1\n\tans := 1\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] > A[j]\n\t})\n\tif K%2 == 1 {\n\t\tans = mod(ans*A[0], MOD)\n\t\tl += 1\n\t\tK -= 1\n\t}\n\n\tfor i := 0; i < K/2; i++ {\n\t\tlv := A[l] * A[l+1]\n\t\trv := A[r] * A[r-1]\n\t\tif rv > lv {\n\t\t\tans = mod(mod(rv, MOD)*ans, MOD)\n\t\t\tr -= 2\n\t\t} else {\n\t\t\tans = mod(mod(lv, MOD)*ans, MOD)\n\t\t\tl += 2\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, 16)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i(v)\n\t}\n\treturn slice\n}\n\nfunc readInt64Slice(size int) []int64 {\n\tslice := make([]int64, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i64(v)\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint2() (int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1])\n}\n\nfunc readint64() int64 {\n\treturn s2i64(readline())\n}\n\n// For int64\nfunc b2i64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min64(values ...int64) int64 {\n\tret := int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max64(values ...int64) int64 {\n\tret := -int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc mod(x, y int) int {\n\tm := x % y\n\tif m < 0 {\n\t\treturn m + y\n\t}\n\treturn m\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\nfunc min(values ...int) int {\n\tret := INF_INT\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INF_INT\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc lcm(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc gcd(v1, v2 int) int {\n\treturn v1 * v2 / lcm(v1, v2)\n}\n\nfunc bit(size int) [][]bool {\n\tbSize := int(math.Pow(2, float64(size)))\n\tb := make([][]bool, bSize)\n\tfor i := 0; i < bSize; i++ {\n\t\tb[i] = make([]bool, size)\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif i>>j&1 == 1 {\n\t\t\t\tb[i][j] = true\n\t\t\t} else {\n\t\t\t\tb[i][j] = false\n\t\t\t}\n\t\t}\n\t}\n\treturn b\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "sample_input": "4 2\n1 2 -3 -4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02616", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4333, "cpu_time_ms": 103, "memory_kb": 21628}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s229865792", "group_id": "codeNet:p02616", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n}\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\tn, _ := strconv.Atoi(ReadString())\n\treturn n\n}\n\n// 10 11 12 => [10, 11, 12]\nfunc readIntSlice(size int) []int {\n\ta := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc get2byte(size int) [][]byte {\n\ta := make([][]byte, size)\n\tfor i := 0; i < size; i++ {\n\t\tvar low string\n\t\tfmt.Scan(&low)\n\t\ta[i] = []byte(low)\n\t}\n\treturn a\n}\n\nfunc transpose(a [][]int) {\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\ta[i][j], a[j][i] = a[j][i], a[i][j]\n\t\t}\n\t}\n}\n\nfunc fact(n, m int) int {\n\tres := 1\n\tfor i := m + 1; i <= n; i++ {\n\t\tres *= i\n\t}\n\treturn res\n}\n\nfunc perm(n, r int) int {\n\tif r > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-r)\n}\n\nfunc comb(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-m) / fact(m, 0)\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc reverseInts(list []int) []int {\n\tn := len(list)\n\ttmp := make([]int, n)\n\tfor i, l := range list {\n\t\ttmp[n-1-i] = l\n\t}\n\treturn tmp\n}\n\nconst mod = 1000000007\n\nfunc main() {\n\tn, k := readInt(), readInt()\n\tas := readIntSlice(n)\n\tsort.Ints(as)\n\tres := solve(n, k, reverseInts(as))\n\tif res < 0 {\n\t\tres = mod + res\n\t}\n\tfmt.Println(res)\n}\n\nfunc multi(a, b int) int {\n\tres := (a * b) % mod\n\treturn res\n}\nfunc solve(n, k int, as []int) int {\n\tif n == k {\n\t\tres := 1\n\t\tfor _, a := range as {\n\t\t\tres = multi(res, a)\n\t\t}\n\t\treturn res\n\t}\n\tmaxAs := max(as...)\n\tif maxAs <= 0 {\n\t\ttmp := as\n\t\tif k%2 == 0 {\n\t\t\ttmp = reverseInts(as)\n\t\t}\n\t\tres := 1\n\t\tfor i := 0; i < k; i++ {\n\t\t\tres = multi(res, tmp[i])\n\t\t}\n\t\treturn res\n\t}\n\n\tvar negativePart, zeroPart, positivePart []int\n\tfor _, a := range as {\n\t\tif a > 0 {\n\t\t\tpositivePart = append(positivePart, a)\n\t\t} else if a == 0 {\n\t\t\tzeroPart = append(zeroPart, a)\n\t\t} else {\n\t\t\tnegativePart = append(negativePart, a)\n\t\t}\n\t}\n\tif len(positivePart)+len(negativePart) < k {\n\t\treturn 0\n\t} else if len(positivePart)+len(negativePart) == k {\n\t\tif len(negativePart)%2 == 1 {\n\t\t\treturn 0\n\t\t}\n\t\tres := 1\n\t\tfor _, a := range positivePart {\n\t\t\tres = multi(res, a)\n\t\t}\n\t\tfor _, a := range negativePart {\n\t\t\tres = multi(res, a)\n\t\t}\n\t\treturn res\n\t}\n\n\tif len(negativePart) == 0 {\n\t\tres := 1\n\t\tfor i := 0; i < k; i++ {\n\t\t\tres = multi(res, as[i])\n\t\t}\n\t\treturn res\n\t}\n\n\tnegativePart = reverseInts(negativePart)\n\tres := 1\n\tfor i := 0; i < k-1; i++ {\n\t\tif len(negativePart) == 1 {\n\t\t\tres = multi(res, positivePart[0])\n\t\t\tpositivePart = positivePart[1:]\n\t\t} else if len(positivePart) == 1 {\n\t\t\tres = multi(res, negativePart[0])\n\t\t\tnegativePart = negativePart[1:]\n\t\t} else if positivePart[0] >= -negativePart[0] {\n\t\t\tres = multi(res, positivePart[0])\n\t\t\tpositivePart = positivePart[1:]\n\t\t} else {\n\t\t\tres = multi(res, negativePart[0])\n\t\t\tnegativePart = negativePart[1:]\n\t\t}\n\t}\n\tif res < 0 {\n\t\tres = multi(res, negativePart[0])\n\t} else {\n\t\tres = multi(res, positivePart[0])\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1596634006, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02616.html", "problem_id": "p02616", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02616/input.txt", "sample_output_relpath": "derived/input_output/data/p02616/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02616/Go/s229865792.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s229865792", "user_id": "u884847580"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n}\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\tn, _ := strconv.Atoi(ReadString())\n\treturn n\n}\n\n// 10 11 12 => [10, 11, 12]\nfunc readIntSlice(size int) []int {\n\ta := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc get2byte(size int) [][]byte {\n\ta := make([][]byte, size)\n\tfor i := 0; i < size; i++ {\n\t\tvar low string\n\t\tfmt.Scan(&low)\n\t\ta[i] = []byte(low)\n\t}\n\treturn a\n}\n\nfunc transpose(a [][]int) {\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\ta[i][j], a[j][i] = a[j][i], a[i][j]\n\t\t}\n\t}\n}\n\nfunc fact(n, m int) int {\n\tres := 1\n\tfor i := m + 1; i <= n; i++ {\n\t\tres *= i\n\t}\n\treturn res\n}\n\nfunc perm(n, r int) int {\n\tif r > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-r)\n}\n\nfunc comb(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t}\n\treturn fact(n, n-m) / fact(m, 0)\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc reverseInts(list []int) []int {\n\tn := len(list)\n\ttmp := make([]int, n)\n\tfor i, l := range list {\n\t\ttmp[n-1-i] = l\n\t}\n\treturn tmp\n}\n\nconst mod = 1000000007\n\nfunc main() {\n\tn, k := readInt(), readInt()\n\tas := readIntSlice(n)\n\tsort.Ints(as)\n\tres := solve(n, k, reverseInts(as))\n\tif res < 0 {\n\t\tres = mod + res\n\t}\n\tfmt.Println(res)\n}\n\nfunc multi(a, b int) int {\n\tres := (a * b) % mod\n\treturn res\n}\nfunc solve(n, k int, as []int) int {\n\tif n == k {\n\t\tres := 1\n\t\tfor _, a := range as {\n\t\t\tres = multi(res, a)\n\t\t}\n\t\treturn res\n\t}\n\tmaxAs := max(as...)\n\tif maxAs <= 0 {\n\t\ttmp := as\n\t\tif k%2 == 0 {\n\t\t\ttmp = reverseInts(as)\n\t\t}\n\t\tres := 1\n\t\tfor i := 0; i < k; i++ {\n\t\t\tres = multi(res, tmp[i])\n\t\t}\n\t\treturn res\n\t}\n\n\tvar negativePart, zeroPart, positivePart []int\n\tfor _, a := range as {\n\t\tif a > 0 {\n\t\t\tpositivePart = append(positivePart, a)\n\t\t} else if a == 0 {\n\t\t\tzeroPart = append(zeroPart, a)\n\t\t} else {\n\t\t\tnegativePart = append(negativePart, a)\n\t\t}\n\t}\n\tif len(positivePart)+len(negativePart) < k {\n\t\treturn 0\n\t} else if len(positivePart)+len(negativePart) == k {\n\t\tif len(negativePart)%2 == 1 {\n\t\t\treturn 0\n\t\t}\n\t\tres := 1\n\t\tfor _, a := range positivePart {\n\t\t\tres = multi(res, a)\n\t\t}\n\t\tfor _, a := range negativePart {\n\t\t\tres = multi(res, a)\n\t\t}\n\t\treturn res\n\t}\n\n\tif len(negativePart) == 0 {\n\t\tres := 1\n\t\tfor i := 0; i < k; i++ {\n\t\t\tres = multi(res, as[i])\n\t\t}\n\t\treturn res\n\t}\n\n\tnegativePart = reverseInts(negativePart)\n\tres := 1\n\tfor i := 0; i < k-1; i++ {\n\t\tif len(negativePart) == 1 {\n\t\t\tres = multi(res, positivePart[0])\n\t\t\tpositivePart = positivePart[1:]\n\t\t} else if len(positivePart) == 1 {\n\t\t\tres = multi(res, negativePart[0])\n\t\t\tnegativePart = negativePart[1:]\n\t\t} else if positivePart[0] >= -negativePart[0] {\n\t\t\tres = multi(res, positivePart[0])\n\t\t\tpositivePart = positivePart[1:]\n\t\t} else {\n\t\t\tres = multi(res, negativePart[0])\n\t\t\tnegativePart = negativePart[1:]\n\t\t}\n\t}\n\tif res < 0 {\n\t\tres = multi(res, negativePart[0])\n\t} else {\n\t\tres = multi(res, positivePart[0])\n\t}\n\treturn res\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "sample_input": "4 2\n1 2 -3 -4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02616", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3785, "cpu_time_ms": 85, "memory_kb": 12060}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s595576114", "group_id": "codeNet:p02617", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\te := make([][]int, n-1)\n\tfor i := 0; i < n-1; i++ {\n\t\tvar u, v int\n\t\tfmt.Fscan(r, &u, &v)\n\t\tif u > v {\n\t\t\tu, v = v, u\n\t\t}\n\t\te[i] = []int{u, v}\n\t}\n\n\tvar ans int64\n\tfor i := 1; i <= n; i++ {\n\t\tans += int64(i) * int64(n-i+1)\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\tans -= int64(e[i][0]) * int64(n-e[i][1]+1)\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1594075931, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02617.html", "problem_id": "p02617", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02617/input.txt", "sample_output_relpath": "derived/input_output/data/p02617/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02617/Go/s595576114.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s595576114", "user_id": "u448258717"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\te := make([][]int, n-1)\n\tfor i := 0; i < n-1; i++ {\n\t\tvar u, v int\n\t\tfmt.Fscan(r, &u, &v)\n\t\tif u > v {\n\t\t\tu, v = v, u\n\t\t}\n\t\te[i] = []int{u, v}\n\t}\n\n\tvar ans int64\n\tfor i := 1; i <= n; i++ {\n\t\tans += int64(i) * int64(n-i+1)\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\tans -= int64(e[i][0]) * int64(n-e[i][1]+1)\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices and N-1 edges, respectively numbered 1, 2,\\cdots, N and 1, 2, \\cdots, N-1. Edge i connects Vertex u_i and v_i.\n\nFor integers L, R (1 \\leq L \\leq R \\leq N), let us define a function f(L, R) as follows:\n\nLet S be the set of the vertices numbered L through R. f(L, R) represents the number of connected components in the subgraph formed only from the vertex set S and the edges whose endpoints both belong to S.\n\nCompute \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq u_i, v_i \\leq N\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1\nu_2 v_2\n:\nu_{N-1} v_{N-1}\n\nOutput\n\nPrint \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nSample Input 1\n\n3\n1 3\n2 3\n\nSample Output 1\n\n7\n\nWe have six possible pairs (L, R) as follows:\n\nFor L = 1, R = 1, S = \\{1\\} and we have 1 connected component.\n\nFor L = 1, R = 2, S = \\{1, 2\\} and we have 2 connected components.\n\nFor L = 1, R = 3, S = \\{1, 2, 3\\} and we have 1 connected component, since S contains both endpoints of each of the edges 1, 2.\n\nFor L = 2, R = 2, S = \\{2\\} and we have 1 connected component.\n\nFor L = 2, R = 3, S = \\{2, 3\\} and we have 1 connected component, since S contains both endpoints of Edge 2.\n\nFor L = 3, R = 3, S = \\{3\\} and we have 1 connected component.\n\nThe sum of these is 7.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n5 3\n5 7\n8 9\n1 9\n9 10\n8 4\n7 4\n6 10\n7 2\n\nSample Output 3\n\n113", "sample_input": "3\n1 3\n2 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02617", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices and N-1 edges, respectively numbered 1, 2,\\cdots, N and 1, 2, \\cdots, N-1. Edge i connects Vertex u_i and v_i.\n\nFor integers L, R (1 \\leq L \\leq R \\leq N), let us define a function f(L, R) as follows:\n\nLet S be the set of the vertices numbered L through R. f(L, R) represents the number of connected components in the subgraph formed only from the vertex set S and the edges whose endpoints both belong to S.\n\nCompute \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq u_i, v_i \\leq N\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1\nu_2 v_2\n:\nu_{N-1} v_{N-1}\n\nOutput\n\nPrint \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nSample Input 1\n\n3\n1 3\n2 3\n\nSample Output 1\n\n7\n\nWe have six possible pairs (L, R) as follows:\n\nFor L = 1, R = 1, S = \\{1\\} and we have 1 connected component.\n\nFor L = 1, R = 2, S = \\{1, 2\\} and we have 2 connected components.\n\nFor L = 1, R = 3, S = \\{1, 2, 3\\} and we have 1 connected component, since S contains both endpoints of each of the edges 1, 2.\n\nFor L = 2, R = 2, S = \\{2\\} and we have 1 connected component.\n\nFor L = 2, R = 3, S = \\{2, 3\\} and we have 1 connected component, since S contains both endpoints of Edge 2.\n\nFor L = 3, R = 3, S = \\{3\\} and we have 1 connected component.\n\nThe sum of these is 7.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n5 3\n5 7\n8 9\n1 9\n9 10\n8 4\n7 4\n6 10\n7 2\n\nSample Output 3\n\n113", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 445, "cpu_time_ms": 212, "memory_kb": 14428}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s390340439", "group_id": "codeNet:p02619", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\td := nextInt()\n\tclist := make([]int, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tclist[i] = nextInt()\n\t}\n\tvar slist [365][26]int\n\tfor i := 0; i < d; i++ {\n\t\tfor j := 0; j < 26; j++ {\n\t\t\ttmp := nextInt()\n\t\t\t//fmt.Println(tmp)\n\t\t\tslist[i][j] = tmp\n\t\t}\n\t}\n\n\ttlist := make([]int, d)\n\tlast := map[int]int{}\n\n\tfor i := 0; i < d; i++ {\n\t\ttlist[i] = nextInt() - 1\n\t}\n\n\tvlist := make([]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ttodaytype := tlist[i]\n\t\tlast[todaytype] = i + 1\n\n\t\t// 基礎満足度増加計算\n\t\tif i == 0 {\n\t\t\tvlist[i] += slist[i][todaytype]\n\t\t} else {\n\t\t\tvlist[i] += vlist[i-1] + slist[i][todaytype]\n\t\t}\n\n\t\t// 満足度低下計算\n\t\tteika := 0\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tteika += clist[j] * (i + 1 - last[j])\n\t\t}\n\t\tvlist[i] -= teika\n\t}\n\n\t// 出力\n\tfor i := 0; i < d; i++ {\n\t\tfmt.Printf(\"%d\\n\", vlist[i])\n\t}\n\n}\n\n// ---- readfunc\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1593395938, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02619.html", "problem_id": "p02619", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02619/input.txt", "sample_output_relpath": "derived/input_output/data/p02619/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02619/Go/s390340439.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390340439", "user_id": "u756000295"}, "prompt_components": {"gold_output": "18398\n35037\n51140\n65837\n79325\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\td := nextInt()\n\tclist := make([]int, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tclist[i] = nextInt()\n\t}\n\tvar slist [365][26]int\n\tfor i := 0; i < d; i++ {\n\t\tfor j := 0; j < 26; j++ {\n\t\t\ttmp := nextInt()\n\t\t\t//fmt.Println(tmp)\n\t\t\tslist[i][j] = tmp\n\t\t}\n\t}\n\n\ttlist := make([]int, d)\n\tlast := map[int]int{}\n\n\tfor i := 0; i < d; i++ {\n\t\ttlist[i] = nextInt() - 1\n\t}\n\n\tvlist := make([]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ttodaytype := tlist[i]\n\t\tlast[todaytype] = i + 1\n\n\t\t// 基礎満足度増加計算\n\t\tif i == 0 {\n\t\t\tvlist[i] += slist[i][todaytype]\n\t\t} else {\n\t\t\tvlist[i] += vlist[i-1] + slist[i][todaytype]\n\t\t}\n\n\t\t// 満足度低下計算\n\t\tteika := 0\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tteika += clist[j] * (i + 1 - last[j])\n\t\t}\n\t\tvlist[i] -= teika\n\t}\n\n\t// 出力\n\tfor i := 0; i < d; i++ {\n\t\tfmt.Printf(\"%d\\n\", vlist[i])\n\t}\n\n}\n\n// ---- readfunc\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "(Please read problem A first. The maximum score you can get by solving this problem B is 1, which will have almost no effect on your ranking.)\n\nBeginner's Guide\n\nLet's first write a program to calculate the score from a pair of input and output. You can know the total score by submitting your solution, or an official program to calculate a score is often provided for local evaluation as in this contest. Nevertheless, writing a score calculator by yourself is still useful to check your understanding of the problem specification. Moreover, the source code of the score calculator can often be reused for solving the problem or debugging your solution. So it is worthwhile to write a score calculator unless it is very complicated.\n\nProblem Statement\n\nYou will be given a contest schedule for D days.\nFor each d=1,2,\\ldots,D, calculate the satisfaction at the end of day d.\n\nInput\n\nInput is given from Standard Input in the form of the input of Problem A followed by the output of Problem A.\n\nD\nc_1 c_2 \\cdots c_{26}\ns_{1,1} s_{1,2} \\cdots s_{1,26}\n\\vdots\ns_{D,1} s_{D,2} \\cdots s_{D,26}\nt_1\nt_2\n\\vdots\nt_D\n\nThe constraints and generation methods for the input part are the same as those for Problem A.\n\nFor each d, t_d is an integer satisfying 1\\leq t_d \\leq 26, and your program is expected to work correctly for any value that meets the constraints.\n\nOutput\n\nLet v_d be the satisfaction at the end of day d.\nPrint D integers v_d to Standard Output in the following format:\n\nv_1\nv_2\n\\vdots\nv_D\n\nSample Input 1\n\n5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n\nSample Output 1\n\n18398\n35037\n51140\n65837\n79325\n\nNote that this example is a small one for checking the problem specification. It does not satisfy the constraint D=365 and is never actually given as a test case.\n\nNext Step\n\nWe can build a solution (schedule) for this problem in the order of day 1, day 2, and so on. And for every partial solution we have built, we can calculate the goodness (satisfaction) by using the above score calculator. So we can construct the following algorithm: for each d=1,2,\\ldots,D, we select the contest type that maximizes the satisfaction at the end of day d. You may have already encountered this kind of \"greedy algorithms\" in algorithm contests such as ABC. Greedy algorithms can guarantee the optimality for several problems, but unfortunately, it doesn't ensure optimality for this problem. However, even if it does not ensure optimality, we can still obtain a reasonable solution in many cases. Let's go back to Problem A and implement the greedy algorithm by utilizing the score calculator you just implemented!\n\nGreedy methods can be applied to a variety of problems, are easy to implement, and often run relatively fast compared to other methods. Greedy is often the most powerful method when we need to process huge inputs.\nWe can further improve the score by changing the greedy selection criteria (evaluation function), keeping multiple candidates instead of focusing on one best partial solution (beam search), or using the output of greedy algorithms as an initial solution of other methods.\nFor more information, please refer to the editorial that will be published after the contest.", "sample_input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n"}, "reference_outputs": ["18398\n35037\n51140\n65837\n79325\n"], "source_document_id": "p02619", "source_text": "(Please read problem A first. The maximum score you can get by solving this problem B is 1, which will have almost no effect on your ranking.)\n\nBeginner's Guide\n\nLet's first write a program to calculate the score from a pair of input and output. You can know the total score by submitting your solution, or an official program to calculate a score is often provided for local evaluation as in this contest. Nevertheless, writing a score calculator by yourself is still useful to check your understanding of the problem specification. Moreover, the source code of the score calculator can often be reused for solving the problem or debugging your solution. So it is worthwhile to write a score calculator unless it is very complicated.\n\nProblem Statement\n\nYou will be given a contest schedule for D days.\nFor each d=1,2,\\ldots,D, calculate the satisfaction at the end of day d.\n\nInput\n\nInput is given from Standard Input in the form of the input of Problem A followed by the output of Problem A.\n\nD\nc_1 c_2 \\cdots c_{26}\ns_{1,1} s_{1,2} \\cdots s_{1,26}\n\\vdots\ns_{D,1} s_{D,2} \\cdots s_{D,26}\nt_1\nt_2\n\\vdots\nt_D\n\nThe constraints and generation methods for the input part are the same as those for Problem A.\n\nFor each d, t_d is an integer satisfying 1\\leq t_d \\leq 26, and your program is expected to work correctly for any value that meets the constraints.\n\nOutput\n\nLet v_d be the satisfaction at the end of day d.\nPrint D integers v_d to Standard Output in the following format:\n\nv_1\nv_2\n\\vdots\nv_D\n\nSample Input 1\n\n5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n\nSample Output 1\n\n18398\n35037\n51140\n65837\n79325\n\nNote that this example is a small one for checking the problem specification. It does not satisfy the constraint D=365 and is never actually given as a test case.\n\nNext Step\n\nWe can build a solution (schedule) for this problem in the order of day 1, day 2, and so on. And for every partial solution we have built, we can calculate the goodness (satisfaction) by using the above score calculator. So we can construct the following algorithm: for each d=1,2,\\ldots,D, we select the contest type that maximizes the satisfaction at the end of day d. You may have already encountered this kind of \"greedy algorithms\" in algorithm contests such as ABC. Greedy algorithms can guarantee the optimality for several problems, but unfortunately, it doesn't ensure optimality for this problem. However, even if it does not ensure optimality, we can still obtain a reasonable solution in many cases. Let's go back to Problem A and implement the greedy algorithm by utilizing the score calculator you just implemented!\n\nGreedy methods can be applied to a variety of problems, are easy to implement, and often run relatively fast compared to other methods. Greedy is often the most powerful method when we need to process huge inputs.\nWe can further improve the score by changing the greedy selection criteria (evaluation function), keeping multiple candidates instead of focusing on one best partial solution (beam search), or using the output of greedy algorithms as an initial solution of other methods.\nFor more information, please refer to the editorial that will be published after the contest.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1126, "cpu_time_ms": 11, "memory_kb": 2004}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s367901858", "group_id": "codeNet:p02619", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\n\t//\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc intScanner() int {\n\tn, _ := strconv.Atoi(Scanner())\n\treturn n\n}\n\nfunc floatScanner() float64 {\n\tn, _ := strconv.ParseFloat(Scanner(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc stringSliceScanner(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scanner()\n\t}\n\treturn a\n}\nfunc intSliceScanner(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t}\n\treturn a\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nvar mod int\n\nfunc main() {\n\tmod = 1000000007\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\td := intScanner()\n\tc := intSliceScanner(26)\n\ts := make([][]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ts[i] = intSliceScanner(26)\n\t}\n\tt := intSliceScanner(d)\n\tfor i, _ := range t {\n\t\tt[i]--\n\t}\n\tcalcScore(t, c, s, d)\n}\nfunc calcScore(schedule []int, c []int, s [][]int, d int) {\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i, v := range schedule {\n\t\tscore += s[i][v]\n\t\tfor j, _ := range last {\n\t\t\tlast[j]++\n\t\t}\n\t\tlast[v] = 0\n\t\tfor j, v := range last {\n\t\t\tscore -= c[j] * v\n\t\t}\n\t\tfmt.Println(score)\n\t}\n\t//return score\n}\n", "language": "Go", "metadata": {"date": 1593393637, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02619.html", "problem_id": "p02619", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02619/input.txt", "sample_output_relpath": "derived/input_output/data/p02619/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02619/Go/s367901858.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s367901858", "user_id": "u843722521"}, "prompt_components": {"gold_output": "18398\n35037\n51140\n65837\n79325\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\n\t//\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc intScanner() int {\n\tn, _ := strconv.Atoi(Scanner())\n\treturn n\n}\n\nfunc floatScanner() float64 {\n\tn, _ := strconv.ParseFloat(Scanner(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc stringSliceScanner(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scanner()\n\t}\n\treturn a\n}\nfunc intSliceScanner(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t}\n\treturn a\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nvar mod int\n\nfunc main() {\n\tmod = 1000000007\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\td := intScanner()\n\tc := intSliceScanner(26)\n\ts := make([][]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ts[i] = intSliceScanner(26)\n\t}\n\tt := intSliceScanner(d)\n\tfor i, _ := range t {\n\t\tt[i]--\n\t}\n\tcalcScore(t, c, s, d)\n}\nfunc calcScore(schedule []int, c []int, s [][]int, d int) {\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i, v := range schedule {\n\t\tscore += s[i][v]\n\t\tfor j, _ := range last {\n\t\t\tlast[j]++\n\t\t}\n\t\tlast[v] = 0\n\t\tfor j, v := range last {\n\t\t\tscore -= c[j] * v\n\t\t}\n\t\tfmt.Println(score)\n\t}\n\t//return score\n}\n", "problem_context": "(Please read problem A first. The maximum score you can get by solving this problem B is 1, which will have almost no effect on your ranking.)\n\nBeginner's Guide\n\nLet's first write a program to calculate the score from a pair of input and output. You can know the total score by submitting your solution, or an official program to calculate a score is often provided for local evaluation as in this contest. Nevertheless, writing a score calculator by yourself is still useful to check your understanding of the problem specification. Moreover, the source code of the score calculator can often be reused for solving the problem or debugging your solution. So it is worthwhile to write a score calculator unless it is very complicated.\n\nProblem Statement\n\nYou will be given a contest schedule for D days.\nFor each d=1,2,\\ldots,D, calculate the satisfaction at the end of day d.\n\nInput\n\nInput is given from Standard Input in the form of the input of Problem A followed by the output of Problem A.\n\nD\nc_1 c_2 \\cdots c_{26}\ns_{1,1} s_{1,2} \\cdots s_{1,26}\n\\vdots\ns_{D,1} s_{D,2} \\cdots s_{D,26}\nt_1\nt_2\n\\vdots\nt_D\n\nThe constraints and generation methods for the input part are the same as those for Problem A.\n\nFor each d, t_d is an integer satisfying 1\\leq t_d \\leq 26, and your program is expected to work correctly for any value that meets the constraints.\n\nOutput\n\nLet v_d be the satisfaction at the end of day d.\nPrint D integers v_d to Standard Output in the following format:\n\nv_1\nv_2\n\\vdots\nv_D\n\nSample Input 1\n\n5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n\nSample Output 1\n\n18398\n35037\n51140\n65837\n79325\n\nNote that this example is a small one for checking the problem specification. It does not satisfy the constraint D=365 and is never actually given as a test case.\n\nNext Step\n\nWe can build a solution (schedule) for this problem in the order of day 1, day 2, and so on. And for every partial solution we have built, we can calculate the goodness (satisfaction) by using the above score calculator. So we can construct the following algorithm: for each d=1,2,\\ldots,D, we select the contest type that maximizes the satisfaction at the end of day d. You may have already encountered this kind of \"greedy algorithms\" in algorithm contests such as ABC. Greedy algorithms can guarantee the optimality for several problems, but unfortunately, it doesn't ensure optimality for this problem. However, even if it does not ensure optimality, we can still obtain a reasonable solution in many cases. Let's go back to Problem A and implement the greedy algorithm by utilizing the score calculator you just implemented!\n\nGreedy methods can be applied to a variety of problems, are easy to implement, and often run relatively fast compared to other methods. Greedy is often the most powerful method when we need to process huge inputs.\nWe can further improve the score by changing the greedy selection criteria (evaluation function), keeping multiple candidates instead of focusing on one best partial solution (beam search), or using the output of greedy algorithms as an initial solution of other methods.\nFor more information, please refer to the editorial that will be published after the contest.", "sample_input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n"}, "reference_outputs": ["18398\n35037\n51140\n65837\n79325\n"], "source_document_id": "p02619", "source_text": "(Please read problem A first. The maximum score you can get by solving this problem B is 1, which will have almost no effect on your ranking.)\n\nBeginner's Guide\n\nLet's first write a program to calculate the score from a pair of input and output. You can know the total score by submitting your solution, or an official program to calculate a score is often provided for local evaluation as in this contest. Nevertheless, writing a score calculator by yourself is still useful to check your understanding of the problem specification. Moreover, the source code of the score calculator can often be reused for solving the problem or debugging your solution. So it is worthwhile to write a score calculator unless it is very complicated.\n\nProblem Statement\n\nYou will be given a contest schedule for D days.\nFor each d=1,2,\\ldots,D, calculate the satisfaction at the end of day d.\n\nInput\n\nInput is given from Standard Input in the form of the input of Problem A followed by the output of Problem A.\n\nD\nc_1 c_2 \\cdots c_{26}\ns_{1,1} s_{1,2} \\cdots s_{1,26}\n\\vdots\ns_{D,1} s_{D,2} \\cdots s_{D,26}\nt_1\nt_2\n\\vdots\nt_D\n\nThe constraints and generation methods for the input part are the same as those for Problem A.\n\nFor each d, t_d is an integer satisfying 1\\leq t_d \\leq 26, and your program is expected to work correctly for any value that meets the constraints.\n\nOutput\n\nLet v_d be the satisfaction at the end of day d.\nPrint D integers v_d to Standard Output in the following format:\n\nv_1\nv_2\n\\vdots\nv_D\n\nSample Input 1\n\n5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n\nSample Output 1\n\n18398\n35037\n51140\n65837\n79325\n\nNote that this example is a small one for checking the problem specification. It does not satisfy the constraint D=365 and is never actually given as a test case.\n\nNext Step\n\nWe can build a solution (schedule) for this problem in the order of day 1, day 2, and so on. And for every partial solution we have built, we can calculate the goodness (satisfaction) by using the above score calculator. So we can construct the following algorithm: for each d=1,2,\\ldots,D, we select the contest type that maximizes the satisfaction at the end of day d. You may have already encountered this kind of \"greedy algorithms\" in algorithm contests such as ABC. Greedy algorithms can guarantee the optimality for several problems, but unfortunately, it doesn't ensure optimality for this problem. However, even if it does not ensure optimality, we can still obtain a reasonable solution in many cases. Let's go back to Problem A and implement the greedy algorithm by utilizing the score calculator you just implemented!\n\nGreedy methods can be applied to a variety of problems, are easy to implement, and often run relatively fast compared to other methods. Greedy is often the most powerful method when we need to process huge inputs.\nWe can further improve the score by changing the greedy selection criteria (evaluation function), keeping multiple candidates instead of focusing on one best partial solution (beam search), or using the output of greedy algorithms as an initial solution of other methods.\nFor more information, please refer to the editorial that will be published after the contest.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1705, "cpu_time_ms": 11, "memory_kb": 1924}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s048600469", "group_id": "codeNet:p02621", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := scanInt()\n\tfmt.Println(a + a*a + a*a*a)\n}\n", "language": "Go", "metadata": {"date": 1593362089, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02621.html", "problem_id": "p02621", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02621/input.txt", "sample_output_relpath": "derived/input_output/data/p02621/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02621/Go/s048600469.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s048600469", "user_id": "u475329018"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := scanInt()\n\tfmt.Println(a + a*a + a*a*a)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven an integer a as input, print the value a + a^2 + a^3.\n\nConstraints\n\n1 \\leq a \\leq 10\n\na is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\n\nOutput\n\nPrint the value a + a^2 + a^3 as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n14\n\nWhen a = 2, we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14.\n\nPrint the answer as an input. Outputs such as 14.0 will be judged as incorrect.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1110", "sample_input": "2\n"}, "reference_outputs": ["14\n"], "source_document_id": "p02621", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven an integer a as input, print the value a + a^2 + a^3.\n\nConstraints\n\n1 \\leq a \\leq 10\n\na is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\n\nOutput\n\nPrint the value a + a^2 + a^3 as an integer.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n14\n\nWhen a = 2, we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14.\n\nPrint the answer as an input. Outputs such as 14.0 will be judged as incorrect.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1110", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 697, "cpu_time_ms": 6, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s146171941", "group_id": "codeNet:p02622", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] != t[i] {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n\n\n}\n", "language": "Go", "metadata": {"date": 1593306195, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02622.html", "problem_id": "p02622", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02622/input.txt", "sample_output_relpath": "derived/input_output/data/p02622/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02622/Go/s146171941.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s146171941", "user_id": "u769765274"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] != t[i] {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "sample_input": "cupofcoffee\ncupofhottea\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02622", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 182, "cpu_time_ms": 306, "memory_kb": 3388}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s818597478", "group_id": "codeNet:p02625", "input_text": "package main\n\nimport \"fmt\"\n\ntype Combination struct {\n\tn int\n\tf *Factorial\n}\n\nfunc NewCombination(n int, m int64) *Combination {\n\tf := NewFactorial(n, m)\n\treturn &Combination{n, f}\n}\n\nfunc (c *Combination) Combination(n, k int) int64 {\n\treturn c.f.F[n] * c.f.Inv[k] % c.f.Mod * c.f.Inv[n-k] % c.f.Mod\n}\n\nfunc (c *Combination) Permutation(n, k int) int64 {\n\treturn c.Combination(n, k) * c.f.F[k] % c.f.Mod\n}\n\nfunc (c *Combination) Factorial(n int) int64 {\n\treturn c.f.F[n]\n}\n\ntype Factorial struct {\n\tn int\n\tMod int64\n\tF, Inv []int64\n}\n\nfunc NewFactorial(n int, m int64) *Factorial {\n\tf := Factorial{n, m, nil, nil}\n\tf.F = make([]int64, n+1)\n\tf.Inv = make([]int64, n+1)\n\tf.F[0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tf.F[i] = f.F[i-1] * int64(i) % f.Mod\n\t}\n\tf.Inv[n] = pow(f.F[n], f.Mod-2, f.Mod)\n\tfor i := n; i > 0; i-- {\n\t\tf.Inv[i-1] = f.Inv[i] * int64(i) % f.Mod\n\t}\n\treturn &f\n}\n\nfunc pow(x, n, m int64) int64 {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n&1 == 0 {\n\t\tr := pow(x, n/2, m)\n\t\treturn r * r % m\n\t}\n\treturn x * pow(x, n-1, m) % m\n}\n\nfunc div(x, n, m int64) int64 {\n\treturn x * pow(n, m-2, m) % m\n}\n\nfunc main() {\n\tvar n, m int\n\tconst M int64 = int64(1e9) + 7\n\tfmt.Scan(&n, &m)\n\tc := NewCombination(m, M)\n\tvar ret int64\n\tfor i := 0; i <= n; i++ {\n\t\tv := c.Combination(n, i)\n\t\tv *= c.Permutation(m, i)\n\t\tv %= M\n\t\tvar r int64 = 1\n\t\tif i < m {\n\t\t\tr = c.Permutation(m-i, n-i)\n\t\t}\n\t\tv *= r * r % M\n\t\tv %= M\n\t\tif i%2 == 1 {\n\t\t\tv = M - v\n\t\t}\n\t\tret += v\n\t\tret %= M\n\t}\n\tfmt.Println(ret)\n}\n", "language": "Go", "metadata": {"date": 1593488683, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02625.html", "problem_id": "p02625", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02625/input.txt", "sample_output_relpath": "derived/input_output/data/p02625/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02625/Go/s818597478.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s818597478", "user_id": "u448258717"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype Combination struct {\n\tn int\n\tf *Factorial\n}\n\nfunc NewCombination(n int, m int64) *Combination {\n\tf := NewFactorial(n, m)\n\treturn &Combination{n, f}\n}\n\nfunc (c *Combination) Combination(n, k int) int64 {\n\treturn c.f.F[n] * c.f.Inv[k] % c.f.Mod * c.f.Inv[n-k] % c.f.Mod\n}\n\nfunc (c *Combination) Permutation(n, k int) int64 {\n\treturn c.Combination(n, k) * c.f.F[k] % c.f.Mod\n}\n\nfunc (c *Combination) Factorial(n int) int64 {\n\treturn c.f.F[n]\n}\n\ntype Factorial struct {\n\tn int\n\tMod int64\n\tF, Inv []int64\n}\n\nfunc NewFactorial(n int, m int64) *Factorial {\n\tf := Factorial{n, m, nil, nil}\n\tf.F = make([]int64, n+1)\n\tf.Inv = make([]int64, n+1)\n\tf.F[0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tf.F[i] = f.F[i-1] * int64(i) % f.Mod\n\t}\n\tf.Inv[n] = pow(f.F[n], f.Mod-2, f.Mod)\n\tfor i := n; i > 0; i-- {\n\t\tf.Inv[i-1] = f.Inv[i] * int64(i) % f.Mod\n\t}\n\treturn &f\n}\n\nfunc pow(x, n, m int64) int64 {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n&1 == 0 {\n\t\tr := pow(x, n/2, m)\n\t\treturn r * r % m\n\t}\n\treturn x * pow(x, n-1, m) % m\n}\n\nfunc div(x, n, m int64) int64 {\n\treturn x * pow(n, m-2, m) % m\n}\n\nfunc main() {\n\tvar n, m int\n\tconst M int64 = int64(1e9) + 7\n\tfmt.Scan(&n, &m)\n\tc := NewCombination(m, M)\n\tvar ret int64\n\tfor i := 0; i <= n; i++ {\n\t\tv := c.Combination(n, i)\n\t\tv *= c.Permutation(m, i)\n\t\tv %= M\n\t\tvar r int64 = 1\n\t\tif i < m {\n\t\t\tr = c.Permutation(m-i, n-i)\n\t\t}\n\t\tv *= r * r % M\n\t\tv %= M\n\t\tif i%2 == 1 {\n\t\t\tv = M - v\n\t\t}\n\t\tret += v\n\t\tret %= M\n\t}\n\tfmt.Println(ret)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nCount the pairs of length-N sequences consisting of integers between 1 and M (inclusive), A_1, A_2, \\cdots, A_{N} and B_1, B_2, \\cdots, B_{N}, that satisfy all of the following conditions:\n\nA_i \\neq B_i, for every i such that 1\\leq i\\leq N.\n\nA_i \\neq A_j and B_i \\neq B_j, for every (i, j) such that 1\\leq i < j\\leq N.\n\nSince the count can be enormous, print it modulo (10^9+7).\n\nConstraints\n\n1\\leq N \\leq M \\leq 5\\times10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the count modulo (10^9+7).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nA_1=1,A_2=2,B_1=2,B_2=1 and A_1=2,A_2=1,B_1=1,B_2=2 satisfy the conditions.\n\nSample Input 2\n\n2 3\n\nSample Output 2\n\n18\n\nSample Input 3\n\n141421 356237\n\nSample Output 3\n\n881613484", "sample_input": "2 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02625", "source_text": "Score : 500 points\n\nProblem Statement\n\nCount the pairs of length-N sequences consisting of integers between 1 and M (inclusive), A_1, A_2, \\cdots, A_{N} and B_1, B_2, \\cdots, B_{N}, that satisfy all of the following conditions:\n\nA_i \\neq B_i, for every i such that 1\\leq i\\leq N.\n\nA_i \\neq A_j and B_i \\neq B_j, for every (i, j) such that 1\\leq i < j\\leq N.\n\nSince the count can be enormous, print it modulo (10^9+7).\n\nConstraints\n\n1\\leq N \\leq M \\leq 5\\times10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the count modulo (10^9+7).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nA_1=1,A_2=2,B_1=2,B_2=1 and A_1=2,A_2=1,B_1=1,B_2=2 satisfy the conditions.\n\nSample Input 2\n\n2 3\n\nSample Output 2\n\n18\n\nSample Input 3\n\n141421 356237\n\nSample Output 3\n\n881613484", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1482, "cpu_time_ms": 72, "memory_kb": 9956}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s913481224", "group_id": "codeNet:p02627", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar s string\n\tcon.Scan(&s)\n\tif 'A' <= s[0] && s[0] <= 'Z' {\n\t\tcon.Println(\"A\")\n\t} else {\n\t\tcon.Println(\"a\")\n\t}\n\treturn nil\n}\n", "language": "Go", "metadata": {"date": 1592788515, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02627.html", "problem_id": "p02627", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02627/input.txt", "sample_output_relpath": "derived/input_output/data/p02627/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02627/Go/s913481224.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s913481224", "user_id": "u718747410"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar s string\n\tcon.Scan(&s)\n\tif 'A' <= s[0] && s[0] <= 'Z' {\n\t\tcon.Println(\"A\")\n\t} else {\n\t\tcon.Println(\"a\")\n\t}\n\treturn nil\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "sample_input": "B\n"}, "reference_outputs": ["A\n"], "source_document_id": "p02627", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1020, "cpu_time_ms": 7, "memory_kb": 1844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s968625366", "group_id": "codeNet:p02627", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tif unicode.IsUpper(rune(a[0])) {\n\t\tfmt.Println(\"A\")\n\t} else {\n\t\tfmt.Println(\"a\")\n\t}\n}", "language": "Go", "metadata": {"date": 1592788182, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02627.html", "problem_id": "p02627", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02627/input.txt", "sample_output_relpath": "derived/input_output/data/p02627/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02627/Go/s968625366.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s968625366", "user_id": "u655410252"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tif unicode.IsUpper(rune(a[0])) {\n\t\tfmt.Println(\"A\")\n\t} else {\n\t\tfmt.Println(\"a\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "sample_input": "B\n"}, "reference_outputs": ["A\n"], "source_document_id": "p02627", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 172, "cpu_time_ms": 7, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s867241177", "group_id": "codeNet:p02628", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tarr := scanNums(2)\n\tpa := scanNums(arr[0])\n\tMySort(pa)\n\tsum := 0\n\tfor i := 0; i < arr[1]; i++ {\n\t\tsum += pa[i]\n\t}\n\tfmt.Print(sum)\n}\nfunc MySort(a []int) {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\n}\nfunc SortedBinaryAppend(sortedArr []int, targetValue int) []int {\n\treturn []int{}\n}\nfunc SortedBinaryDelete(sortedArr []int, targetValue int) []int {\n\treturn []int{}\n}\nfunc SortedBinarySearch(sortedArr []int, targetValue int) int {\n\tpost := len(sortedArr) - 1\n\tpre := 0\n\tfor {\n\t\tdiv := (post + pre) / 2\n\t\ttim := sortedArr[div]\n\t\tif tim == targetValue {\n\t\t\treturn pre + div\n\t\t} else if tim > targetValue {\n\t\t\tpost = tim\n\t\t} else {\n\t\t\tpre = tim\n\t\t}\n\t\tif pre == post {\n\t\t\treturn -1\n\t\t}\n\t}\n}\nfunc Abs(i int) int {\n\tif i < 0 {\n\t\treturn -1 * i\n\t}\n\treturn i\n}\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {\n\tif (*dp)[[2]int{tate, yoko}] != 0 {\n\t\treturn (*dp)[[2]int{tate, yoko}]\n\t}\n\treturn yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1592788313, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02628.html", "problem_id": "p02628", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02628/input.txt", "sample_output_relpath": "derived/input_output/data/p02628/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02628/Go/s867241177.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s867241177", "user_id": "u757474247"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tarr := scanNums(2)\n\tpa := scanNums(arr[0])\n\tMySort(pa)\n\tsum := 0\n\tfor i := 0; i < arr[1]; i++ {\n\t\tsum += pa[i]\n\t}\n\tfmt.Print(sum)\n}\nfunc MySort(a []int) {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\n}\nfunc SortedBinaryAppend(sortedArr []int, targetValue int) []int {\n\treturn []int{}\n}\nfunc SortedBinaryDelete(sortedArr []int, targetValue int) []int {\n\treturn []int{}\n}\nfunc SortedBinarySearch(sortedArr []int, targetValue int) int {\n\tpost := len(sortedArr) - 1\n\tpre := 0\n\tfor {\n\t\tdiv := (post + pre) / 2\n\t\ttim := sortedArr[div]\n\t\tif tim == targetValue {\n\t\t\treturn pre + div\n\t\t} else if tim > targetValue {\n\t\t\tpost = tim\n\t\t} else {\n\t\t\tpre = tim\n\t\t}\n\t\tif pre == post {\n\t\t\treturn -1\n\t\t}\n\t}\n}\nfunc Abs(i int) int {\n\tif i < 0 {\n\t\treturn -1 * i\n\t}\n\treturn i\n}\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {\n\tif (*dp)[[2]int{tate, yoko}] != 0 {\n\t\treturn (*dp)[[2]int{tate, yoko}]\n\t}\n\treturn yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "sample_input": "5 3\n50 100 80 120 80\n"}, "reference_outputs": ["210\n"], "source_document_id": "p02628", "source_text": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1483, "cpu_time_ms": 12, "memory_kb": 1916}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s710218031", "group_id": "codeNet:p02628", "input_text": "package main\nimport (\n \"fmt\"\n \"sort\"\n //\"regexp\"\n)\n \nfunc main(){\n var n, k, a, ans int\n fmt.Scan(&n)\n fmt.Scan(&k)\n s := make([]int, 0)\n for i := 0; i < n; i++ {\n fmt.Scan(&a)\n s = append(s, a)\n }\n sort.Slice(s, func(i, j int) bool { return s[i] < s[j] })\n for i :=0; i < k; i++ {\n ans += s[i]\n }\n fmt.Printf(\"%d\\n\", ans)\n}", "language": "Go", "metadata": {"date": 1592788220, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02628.html", "problem_id": "p02628", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02628/input.txt", "sample_output_relpath": "derived/input_output/data/p02628/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02628/Go/s710218031.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s710218031", "user_id": "u467535434"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"sort\"\n //\"regexp\"\n)\n \nfunc main(){\n var n, k, a, ans int\n fmt.Scan(&n)\n fmt.Scan(&k)\n s := make([]int, 0)\n for i := 0; i < n; i++ {\n fmt.Scan(&a)\n s = append(s, a)\n }\n sort.Slice(s, func(i, j int) bool { return s[i] < s[j] })\n for i :=0; i < k; i++ {\n ans += s[i]\n }\n fmt.Printf(\"%d\\n\", ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "sample_input": "5 3\n50 100 80 120 80\n"}, "reference_outputs": ["210\n"], "source_document_id": "p02628", "source_text": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 346, "cpu_time_ms": 10, "memory_kb": 1916}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s069868164", "group_id": "codeNet:p02629", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn := r.nextInt()\n\n\ta := \"\"\n\tfor {\n\t\tif n <= 0 {\n\t\t\tbreak\n\t\t}\n\t\ta = string([]byte{byte('a' + (n%26+25)%26)}) + a\n\t\tn = (n - 1) / ('Z' - 'A' + 1)\n\t}\n\n\tfmt.Fprintln(stdout, a)\n}\n", "language": "Go", "metadata": {"date": 1592854947, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/Go/s069868164.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s069868164", "user_id": "u463655976"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn := r.nextInt()\n\n\ta := \"\"\n\tfor {\n\t\tif n <= 0 {\n\t\t\tbreak\n\t\t}\n\t\ta = string([]byte{byte('a' + (n%26+25)%26)}) + a\n\t\tn = (n - 1) / ('Z' - 'A' + 1)\n\t}\n\n\tfmt.Fprintln(stdout, a)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2832, "cpu_time_ms": 4, "memory_kb": 1740}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s003978870", "group_id": "codeNet:p02629", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar LowerAlphabets = [...]string{\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",\n\t\"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"}\n\nvar AlphabetNumberMap = map[string]int{\n\t\"a\": 10,\n\t\"b\": 11,\n\t\"c\": 12,\n\t\"d\": 13,\n\t\"e\": 14,\n\t\"f\": 15,\n\t\"g\": 16,\n\t\"h\": 17,\n\t\"i\": 18,\n\t\"j\": 19,\n\t\"k\": 20,\n\t\"l\": 21,\n\t\"m\": 22,\n\t\"n\": 23,\n\t\"o\": 24,\n\t\"p\": 25,\n\t\"q\": 26,\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar names []string\n\tfor n > 26 {\n\t\tnames = append([]string{LowerAlphabets[((n - 1) % 26)]}, names...)\n\t\tn = (n-1) / 26\n\t}\n\tnames = append([]string{LowerAlphabets[((n - 1) % 26)]}, names...)\n\tfmt.Println(strings.Join(names, \"\"))\n}\n", "language": "Go", "metadata": {"date": 1592792966, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/Go/s003978870.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003978870", "user_id": "u717943620"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar LowerAlphabets = [...]string{\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",\n\t\"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"}\n\nvar AlphabetNumberMap = map[string]int{\n\t\"a\": 10,\n\t\"b\": 11,\n\t\"c\": 12,\n\t\"d\": 13,\n\t\"e\": 14,\n\t\"f\": 15,\n\t\"g\": 16,\n\t\"h\": 17,\n\t\"i\": 18,\n\t\"j\": 19,\n\t\"k\": 20,\n\t\"l\": 21,\n\t\"m\": 22,\n\t\"n\": 23,\n\t\"o\": 24,\n\t\"p\": 25,\n\t\"q\": 26,\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar names []string\n\tfor n > 26 {\n\t\tnames = append([]string{LowerAlphabets[((n - 1) % 26)]}, names...)\n\t\tn = (n-1) / 26\n\t}\n\tnames = append([]string{LowerAlphabets[((n - 1) % 26)]}, names...)\n\tfmt.Println(strings.Join(names, \"\"))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 692, "cpu_time_ms": 7, "memory_kb": 1856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s908426138", "group_id": "codeNet:p02629", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n uint64\n\tfmt.Scanf(\"%d\", &n);\n\tcode := \"abcdefghijklmnopqrstuvwxyz\"\n\n\tanswer := make([]byte, 0, 1000000000)\n\tdigit := uint64(26)\n\tfor true {\n\t\tnext := digit * 26\n\t\tif (n / next == 0) {\n\t\t\tbreak\n\t\t}\n\t\tdigit = next\n\t}\n\t//fmt.Printf(\"%d\\n\", digit)\n\n\ttmp := uint64(n)\n\tfor digit != 0 {\n\t\tcurrent := tmp / digit\n\t\ttmp = tmp % digit\n\t\tdigit = digit / 26\n\t\t//fmt.Printf(\"%d\\n\", current)\n\t\tif (current != 0) {\n\t\t\tanswer = append(answer, code[current - 1])\n\t\t}\n\t}\n\n\tfmt.Printf(\"%s\", string(answer))\n}\n", "language": "Go", "metadata": {"date": 1592790340, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/Go/s908426138.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s908426138", "user_id": "u167600602"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n uint64\n\tfmt.Scanf(\"%d\", &n);\n\tcode := \"abcdefghijklmnopqrstuvwxyz\"\n\n\tanswer := make([]byte, 0, 1000000000)\n\tdigit := uint64(26)\n\tfor true {\n\t\tnext := digit * 26\n\t\tif (n / next == 0) {\n\t\t\tbreak\n\t\t}\n\t\tdigit = next\n\t}\n\t//fmt.Printf(\"%d\\n\", digit)\n\n\ttmp := uint64(n)\n\tfor digit != 0 {\n\t\tcurrent := tmp / digit\n\t\ttmp = tmp % digit\n\t\tdigit = digit / 26\n\t\t//fmt.Printf(\"%d\\n\", current)\n\t\tif (current != 0) {\n\t\t\tanswer = append(answer, code[current - 1])\n\t\t}\n\t}\n\n\tfmt.Printf(\"%s\", string(answer))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 545, "cpu_time_ms": 39, "memory_kb": 33476}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992345966", "group_id": "codeNet:p02630", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rd = bufio.NewReader(os.Stdin)\n\n// 標準入力から1行読み込む。\nfunc readLine() string {\n\tbuf := make([]byte, 0)\n\tfor {\n\t\tl, p, e := rd.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\n// 渡された文字列(空白区切りの整数の並び)をintのスライスにする。\nfunc intsFromLine(line string) []int {\n\tslice := make([]int, 0)\n\tfor _, str := range strings.Split(line, \" \") {\n\t\tnum, err := strconv.Atoi(str)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tslice = append(slice, num)\n\t}\n\treturn slice\n}\n\nfunc main() {\n\t_ = intsFromLine(readLine())[0]\n\tnums := intsFromLine(readLine())\n\tQ := intsFromLine(readLine())[0]\n\tcount := make([]int, 10001)\n\ttotal := 0\n\n\tfor _, num := range nums {\n\t\ttotal += num\n\t\tcount[num]++\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tbuf := intsFromLine(readLine())\n\t\tB, C := buf[0], buf[1]\n\t\ttotal += (C - B) * count[B]\n\t\tcount[C] += count[B]\n\t\tcount[B] = 0\n\n\t\tfmt.Println(total)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593815533, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02630.html", "problem_id": "p02630", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02630/input.txt", "sample_output_relpath": "derived/input_output/data/p02630/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02630/Go/s992345966.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s992345966", "user_id": "u565273749"}, "prompt_components": {"gold_output": "11\n12\n16\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rd = bufio.NewReader(os.Stdin)\n\n// 標準入力から1行読み込む。\nfunc readLine() string {\n\tbuf := make([]byte, 0)\n\tfor {\n\t\tl, p, e := rd.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\n// 渡された文字列(空白区切りの整数の並び)をintのスライスにする。\nfunc intsFromLine(line string) []int {\n\tslice := make([]int, 0)\n\tfor _, str := range strings.Split(line, \" \") {\n\t\tnum, err := strconv.Atoi(str)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tslice = append(slice, num)\n\t}\n\treturn slice\n}\n\nfunc main() {\n\t_ = intsFromLine(readLine())[0]\n\tnums := intsFromLine(readLine())\n\tQ := intsFromLine(readLine())[0]\n\tcount := make([]int, 10001)\n\ttotal := 0\n\n\tfor _, num := range nums {\n\t\ttotal += num\n\t\tcount[num]++\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tbuf := intsFromLine(readLine())\n\t\tB, C := buf[0], buf[1]\n\t\ttotal += (C - B) * count[B]\n\t\tcount[C] += count[B]\n\t\tcount[B] = 0\n\n\t\tfmt.Println(total)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have a sequence A composed of N positive integers: A_{1}, A_{2}, \\cdots, A_{N}.\n\nYou will now successively do the following Q operations:\n\nIn the i-th operation, you replace every element whose value is B_{i} with C_{i}.\n\nFor each i (1 \\leq i \\leq Q), find S_{i}: the sum of all elements in A just after the i-th operation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q, A_{i}, B_{i}, C_{i} \\leq 10^{5}\n\nB_{i} \\neq C_{i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1} A_{2} \\cdots A_{N}\nQ\nB_{1} C_{1}\nB_{2} C_{2}\n\\vdots\nB_{Q} C_{Q}\n\nOutput\n\nPrint Q integers S_{i} to Standard Output in the following format:\n\nS_{1}\nS_{2}\n\\vdots\nS_{Q}\n\nNote that S_{i} may not fit into a 32-bit integer.\n\nSample Input 1\n\n4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n11\n12\n16\n\nInitially, the sequence A is 1,2,3,4.\n\nAfter each operation, it becomes the following:\n\n2, 2, 3, 4\n\n2, 2, 4, 4\n\n4, 4, 4, 4\n\nSample Input 2\n\n4\n1 1 1 1\n3\n1 2\n2 1\n3 5\n\nSample Output 2\n\n8\n4\n4\n\nNote that the sequence A may not contain an element whose value is B_{i}.\n\nSample Input 3\n\n2\n1 2\n3\n1 100\n2 100\n100 1000\n\nSample Output 3\n\n102\n200\n2000", "sample_input": "4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n"}, "reference_outputs": ["11\n12\n16\n"], "source_document_id": "p02630", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have a sequence A composed of N positive integers: A_{1}, A_{2}, \\cdots, A_{N}.\n\nYou will now successively do the following Q operations:\n\nIn the i-th operation, you replace every element whose value is B_{i} with C_{i}.\n\nFor each i (1 \\leq i \\leq Q), find S_{i}: the sum of all elements in A just after the i-th operation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q, A_{i}, B_{i}, C_{i} \\leq 10^{5}\n\nB_{i} \\neq C_{i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1} A_{2} \\cdots A_{N}\nQ\nB_{1} C_{1}\nB_{2} C_{2}\n\\vdots\nB_{Q} C_{Q}\n\nOutput\n\nPrint Q integers S_{i} to Standard Output in the following format:\n\nS_{1}\nS_{2}\n\\vdots\nS_{Q}\n\nNote that S_{i} may not fit into a 32-bit integer.\n\nSample Input 1\n\n4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n11\n12\n16\n\nInitially, the sequence A is 1,2,3,4.\n\nAfter each operation, it becomes the following:\n\n2, 2, 3, 4\n\n2, 2, 4, 4\n\n4, 4, 4, 4\n\nSample Input 2\n\n4\n1 1 1 1\n3\n1 2\n2 1\n3 5\n\nSample Output 2\n\n8\n4\n4\n\nNote that the sequence A may not contain an element whose value is B_{i}.\n\nSample Input 3\n\n2\n1 2\n3\n1 100\n2 100\n100 1000\n\nSample Output 3\n\n102\n200\n2000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1058, "cpu_time_ms": 23, "memory_kb": 11708}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s362423560", "group_id": "codeNet:p02632", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tK := nextInt()\n\tL := len(nextString())\n\n\tinitFact(200010)\n\tn := mint(0)\n\n\t// iはS[N]以降の文字数\n\tfor i := 0; i <= K; i++ {\n\t\ta := L - 1 + K - i\n\t\tb := L - 1\n\t\tc := facts[a].div(facts[b]).div(facts[a-b])\n\t\tp1 := mint(26).pow(mint(i))\n\t\tp2 := mint(25).pow(mint(K - i))\n\t\tm := p1.mul(p2).mul(c)\n\t\tn = n.add(m)\n\t}\n\n\tfmt.Println(n)\n}\n\nvar facts []mint // facts[i] = i!\n//var ifacts []mint // ifacts[i] = i!の逆元\n\n// nの階乗までを初期化します\nfunc initFact(n int) {\n\tif len(facts) == 0 {\n\t\tfacts = []mint{mint(1)}\n\t}\n\tm := mint(n)\n\tfor i := mint(len(facts)); i <= m; i++ {\n\t\tfacts = append(facts, facts[i-1].mul(i))\n\t}\n}\n\ntype mint int64\n\nvar mod = mint(1e9 + 7)\n\n// add は a + bを返します\nfunc (a mint) add(b mint) mint {\n\treturn (a + b) % mod\n}\n\n// sub は a - bを返します\nfunc (a mint) sub(b mint) mint {\n\treturn (a - b + mod) % mod\n}\n\n// mul は a * bを返します\nfunc (a mint) mul(b mint) mint {\n\treturn (a * (b % mod)) % mod\n}\n\n// div は a/bを返します\nfunc (a mint) div(b mint) mint {\n\treturn a.mul(b.inv())\n}\n\n// inv は aの逆元を返します\nfunc (a mint) inv() mint {\n\t// 拡張ユークリッドの互除法\n\tb := mod\n\tu := mint(1)\n\tv := mint(0)\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\treturn (u + mod) % mod\n}\n\n// pow は a ^ bを返します\nfunc (a mint) pow(b mint) mint {\n\tans := mint(1)\n\n\tfor b != 0 {\n\t\tif b&1 == 1 {\n\t\t\tans = ans.mul(a)\n\t\t}\n\t\ta = a.mul(a)\n\t\tb = b >> 1\n\t}\n\treturn ans\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n\nfunc debug(args ...interface{}) {\n\tfmt.Fprintln(os.Stderr, args)\n}\n", "language": "Go", "metadata": {"date": 1592796057, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02632.html", "problem_id": "p02632", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02632/input.txt", "sample_output_relpath": "derived/input_output/data/p02632/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02632/Go/s362423560.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s362423560", "user_id": "u578274732"}, "prompt_components": {"gold_output": "575111451\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tK := nextInt()\n\tL := len(nextString())\n\n\tinitFact(200010)\n\tn := mint(0)\n\n\t// iはS[N]以降の文字数\n\tfor i := 0; i <= K; i++ {\n\t\ta := L - 1 + K - i\n\t\tb := L - 1\n\t\tc := facts[a].div(facts[b]).div(facts[a-b])\n\t\tp1 := mint(26).pow(mint(i))\n\t\tp2 := mint(25).pow(mint(K - i))\n\t\tm := p1.mul(p2).mul(c)\n\t\tn = n.add(m)\n\t}\n\n\tfmt.Println(n)\n}\n\nvar facts []mint // facts[i] = i!\n//var ifacts []mint // ifacts[i] = i!の逆元\n\n// nの階乗までを初期化します\nfunc initFact(n int) {\n\tif len(facts) == 0 {\n\t\tfacts = []mint{mint(1)}\n\t}\n\tm := mint(n)\n\tfor i := mint(len(facts)); i <= m; i++ {\n\t\tfacts = append(facts, facts[i-1].mul(i))\n\t}\n}\n\ntype mint int64\n\nvar mod = mint(1e9 + 7)\n\n// add は a + bを返します\nfunc (a mint) add(b mint) mint {\n\treturn (a + b) % mod\n}\n\n// sub は a - bを返します\nfunc (a mint) sub(b mint) mint {\n\treturn (a - b + mod) % mod\n}\n\n// mul は a * bを返します\nfunc (a mint) mul(b mint) mint {\n\treturn (a * (b % mod)) % mod\n}\n\n// div は a/bを返します\nfunc (a mint) div(b mint) mint {\n\treturn a.mul(b.inv())\n}\n\n// inv は aの逆元を返します\nfunc (a mint) inv() mint {\n\t// 拡張ユークリッドの互除法\n\tb := mod\n\tu := mint(1)\n\tv := mint(0)\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\treturn (u + mod) % mod\n}\n\n// pow は a ^ bを返します\nfunc (a mint) pow(b mint) mint {\n\tans := mint(1)\n\n\tfor b != 0 {\n\t\tif b&1 == 1 {\n\t\t\tans = ans.mul(a)\n\t\t}\n\t\ta = a.mul(a)\n\t\tb = b >> 1\n\t}\n\treturn ans\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n\nfunc debug(args ...interface{}) {\n\tfmt.Fprintln(os.Stderr, args)\n}\n", "problem_context": "Score: 600 points\n\nProblem Statement\n\nHow many strings can be obtained by applying the following operation on a string S exactly K times: \"choose one lowercase English letter and insert it somewhere\"?\n\nThe answer can be enormous, so print it modulo (10^9+7).\n\nConstraints\n\nK is an integer between 1 and 10^6 (inclusive).\n\nS is a string of length between 1 and 10^6 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint the number of strings satisfying the condition, modulo (10^9+7).\n\nSample Input 1\n\n5\noof\n\nSample Output 1\n\n575111451\n\nFor example, we can obtain proofend, moonwolf, and onionpuf, while we cannot obtain oofsix, oofelevennn, voxafolt, or fooooooo.\n\nSample Input 2\n\n37564\nwhydidyoudesertme\n\nSample Output 2\n\n318008117", "sample_input": "5\noof\n"}, "reference_outputs": ["575111451\n"], "source_document_id": "p02632", "source_text": "Score: 600 points\n\nProblem Statement\n\nHow many strings can be obtained by applying the following operation on a string S exactly K times: \"choose one lowercase English letter and insert it somewhere\"?\n\nThe answer can be enormous, so print it modulo (10^9+7).\n\nConstraints\n\nK is an integer between 1 and 10^6 (inclusive).\n\nS is a string of length between 1 and 10^6 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint the number of strings satisfying the condition, modulo (10^9+7).\n\nSample Input 1\n\n5\noof\n\nSample Output 1\n\n575111451\n\nFor example, we can obtain proofend, moonwolf, and onionpuf, while we cannot obtain oofsix, oofelevennn, voxafolt, or fooooooo.\n\nSample Input 2\n\n37564\nwhydidyoudesertme\n\nSample Output 2\n\n318008117", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2145, "cpu_time_ms": 91, "memory_kb": 10344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s316262436", "group_id": "codeNet:p02633", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\tfmt.Println(Lcm(x, 360) / x)\n}\n\n// Gcd returns greatest common divisor\nfunc Gcd(x, y int) int {\n\tmod := x % y\n\tif mod > 0 {\n\t\treturn Gcd(y, mod)\n\t} else {\n\t\treturn y\n\t}\n}\n\n// Lcm returns least common multiple\nfunc Lcm(x, y int) int {\n\treturn x * y / Gcd(x, y)\n}\n", "language": "Go", "metadata": {"date": 1592706340, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02633.html", "problem_id": "p02633", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02633/input.txt", "sample_output_relpath": "derived/input_output/data/p02633/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02633/Go/s316262436.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s316262436", "user_id": "u717943620"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\tfmt.Println(Lcm(x, 360) / x)\n}\n\n// Gcd returns greatest common divisor\nfunc Gcd(x, y int) int {\n\tmod := x % y\n\tif mod > 0 {\n\t\treturn Gcd(y, mod)\n\t} else {\n\t\treturn y\n\t}\n}\n\n// Lcm returns least common multiple\nfunc Lcm(x, y int) int {\n\treturn x * y / Gcd(x, y)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times:\n\nGo one meter in the direction he is facing. Then, turn X degrees counter-clockwise.\n\nConstraints\n\n1 \\leq X \\leq 179\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of times Takahashi will do the action before he is at the starting position again.\n\nSample Input 1\n\n90\n\nSample Output 1\n\n4\n\nTakahashi's path is a square.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n360", "sample_input": "90\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02633", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times:\n\nGo one meter in the direction he is facing. Then, turn X degrees counter-clockwise.\n\nConstraints\n\n1 \\leq X \\leq 179\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of times Takahashi will do the action before he is at the starting position again.\n\nSample Input 1\n\n90\n\nSample Output 1\n\n4\n\nTakahashi's path is a square.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n360", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 330, "cpu_time_ms": 7, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s699859181", "group_id": "codeNet:p02639", "input_text": "//go:generate echo \"https://atcoder.jp/contests/abc170/tasks/abc170_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = newScanner(os.Stdin)\n\nfunc Solve(X []int) int {\n\tfor i, x := range X {\n\t\tif x == 0 {\n\t\t\treturn i + 1\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tfmt.Println(Solve(sc.Ints(5)))\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Floats64(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "language": "Go", "metadata": {"date": 1599921421, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02639/input.txt", "sample_output_relpath": "derived/input_output/data/p02639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02639/Go/s699859181.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s699859181", "user_id": "u890085018"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/abc170/tasks/abc170_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = newScanner(os.Stdin)\n\nfunc Solve(X []int) int {\n\tfor i, x := range X {\n\t\tif x == 0 {\n\t\t\treturn i + 1\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tfmt.Println(Solve(sc.Ints(5)))\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Floats64(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "sample_input": "0 2 3 4 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02639", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4469, "cpu_time_ms": 7, "memory_kb": 1788}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s971713891", "group_id": "codeNet:p02639", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tfor i := 0; i < 5; i++ {\n\t\ttmp := nextInt()\n\t\tif tmp == 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1592182955, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02639/input.txt", "sample_output_relpath": "derived/input_output/data/p02639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02639/Go/s971713891.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s971713891", "user_id": "u432333240"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tfor i := 0; i < 5; i++ {\n\t\ttmp := nextInt()\n\t\tif tmp == 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t}\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "sample_input": "0 2 3 4 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02639", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2315, "cpu_time_ms": 6, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s858756916", "group_id": "codeNet:p02640", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Crane and Turtle\n\tvar a, b int\n\tvar x, y int\n\tfmt.Scan(&a, &b)\n\tx = (4*a - b) / 2\n\ty = (b - 2*a) / 2\n\n\tif x >= 0 && y >= 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594944209, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/Go/s858756916.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s858756916", "user_id": "u771420313"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Crane and Turtle\n\tvar a, b int\n\tvar x, y int\n\tfmt.Scan(&a, &b)\n\tx = (4*a - b) / 2\n\ty = (b - 2*a) / 2\n\n\tif x >= 0 && y >= 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 9, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s711231568", "group_id": "codeNet:p02640", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\n\t//a := y / 2\n\t//b := y / 4\n\n\tcount := 0\n\tfor i := 0; i < x; i++ {\n\t\tif y%4 == 0 {\n\t\t\tcount += y / 4\n\t\t\tcontinue\n\t\t}\n\t\tif y%2 == 0 {\n\t\t\tcount += y / 2\n\t\t\tcontinue\n\t\t}\n\t}\n\tif count/2 == x || count == x {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1592185006, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/Go/s711231568.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s711231568", "user_id": "u370270364"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\n\t//a := y / 2\n\t//b := y / 4\n\n\tcount := 0\n\tfor i := 0; i < x; i++ {\n\t\tif y%4 == 0 {\n\t\t\tcount += y / 4\n\t\t\tcontinue\n\t\t}\n\t\tif y%2 == 0 {\n\t\t\tcount += y / 2\n\t\t\tcontinue\n\t\t}\n\t}\n\tif count/2 == x || count == x {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s983755905", "group_id": "codeNet:p02640", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tx, y int\n)\n\nfunc main() {\n\tx = readi()\n\ty = readi()\n\n\tfor i := 0; i <= x; i++ {\n\t\tturu := i\n\t\tkame := x - i\n\t\tif y == (turu*2 + kame*4) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n// func searchInts(a []int, k int) int {\n// \treturn binarySearch(len(a), func(i int) bool {\n// \t\treturn a[i] >= k\n// \t})\n// }\n\nfunc binarySearch(n int, f func(int) bool) int {\n\ti, j := 0, n\n\tfor i < j {\n\t\th := int(uint(i+j) >> 1)\n\t\tif !f(h) {\n\t\t\ti = h + 1\n\t\t} else {\n\t\t\tj = h\n\t\t}\n\t}\n\treturn i\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592183939, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/Go/s983755905.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s983755905", "user_id": "u183912232"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tx, y int\n)\n\nfunc main() {\n\tx = readi()\n\ty = readi()\n\n\tfor i := 0; i <= x; i++ {\n\t\tturu := i\n\t\tkame := x - i\n\t\tif y == (turu*2 + kame*4) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n// func searchInts(a []int, k int) int {\n// \treturn binarySearch(len(a), func(i int) bool {\n// \t\treturn a[i] >= k\n// \t})\n// }\n\nfunc binarySearch(n int, f func(int) bool) int {\n\ti, j := 0, n\n\tfor i < j {\n\t\th := int(uint(i+j) >> 1)\n\t\tif !f(h) {\n\t\t\ti = h + 1\n\t\t} else {\n\t\t\tj = h\n\t\t}\n\t}\n\treturn i\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2715, "cpu_time_ms": 7, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s067173919", "group_id": "codeNet:p02640", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar x, y int\n\tfmt.Fscan(r, &x)\n\tfmt.Fscan(r, &y)\n\n\tfor i := 0; i <= x; i++ {\n\t\tif i*2+(x-i)*4 == y {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "language": "Go", "metadata": {"date": 1592183091, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/Go/s067173919.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s067173919", "user_id": "u433254839"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar x, y int\n\tfmt.Fscan(r, &x)\n\tfmt.Fscan(r, &y)\n\n\tfor i := 0; i <= x; i++ {\n\t\tif i*2+(x-i)*4 == y {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4513, "cpu_time_ms": 2, "memory_kb": 1824}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s381483199", "group_id": "codeNet:p02640", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\tX := readi()\n\tY := readi()\n\n\tif Y%2 == 0 && X*2 <= Y && Y <= X*4 {\n\t\tprintln(\"Yes\")\n\t} else {\n\t\tprintln(\"No\")\n\t}\n\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "language": "Go", "metadata": {"date": 1592182967, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/Go/s381483199.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s381483199", "user_id": "u705974985"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\tX := readi()\n\tY := readi()\n\n\tif Y%2 == 0 && X*2 <= Y && Y <= X*4 {\n\t\tprintln(\"Yes\")\n\t} else {\n\t\tprintln(\"No\")\n\t}\n\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6755, "cpu_time_ms": 5, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s065242779", "group_id": "codeNet:p02641", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar X, n, p int\n\tvar P [101]int\n\tvar tmp float64\n\ttmp = 100000\n\tans := 0\n\n\tfmt.Scan(&X, &n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&p)\n\t\tP[p] = 1\n\t}\n\n\tfor i := 0; i < 101; i++ {\n\t\tif P[i] == 0 {\n\t\t\tif float64(tmp) > math.Abs(float64(X - i)) {\n\t\t\t\tans = i\n\t\t\t\ttmp = math.Abs(float64(X - i))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1597513127, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02641/input.txt", "sample_output_relpath": "derived/input_output/data/p02641/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02641/Go/s065242779.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s065242779", "user_id": "u411858517"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar X, n, p int\n\tvar P [101]int\n\tvar tmp float64\n\ttmp = 100000\n\tans := 0\n\n\tfmt.Scan(&X, &n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&p)\n\t\tP[p] = 1\n\t}\n\n\tfor i := 0; i < 101; i++ {\n\t\tif P[i] == 0 {\n\t\t\tif float64(tmp) > math.Abs(float64(X - i)) {\n\t\t\t\tans = i\n\t\t\t\ttmp = math.Abs(float64(X - i))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 376, "cpu_time_ms": 6, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s973268428", "group_id": "codeNet:p02641", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc contains(n int, slice []int) bool {\n\tfor _, e := range slice {\n\t\tif e == n {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tscanner := makeWordScanner()\n\tx := eGetInt(scanner)\n\tn := eGetInt(scanner)\n\tps := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tps[i] = eGetInt(scanner)\n\t}\n\tfor diff := 0; diff < 100; diff++ {\n\t\t// 小さい方\n\t\ts := x - diff\n\t\tif !contains(s, ps) {\n\t\t\tfmt.Println(s)\n\t\t\treturn\n\t\t}\n\t\t// 大きい方\n\t\tl := x + diff\n\t\tif !contains(l, ps) {\n\t\t\tfmt.Println(l)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nconst (\n\tTooLarge = math.MaxInt64\n\tTooSmall = math.MinInt64\n)\n\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeCharScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanRunes)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n == 1 {\n\t\treturn a\n\t}\n\tif n%2 == 1 {\n\t\treturn pow((a*a), n/2) * a\n\t}\n\treturn pow((a * a), n/2)\n}\nfunc pow5(a int, memo map[int]int) int {\n\tv, ok := memo[a]\n\tif ok {\n\t\treturn v\n\t}\n\n\tb := a * a\n\tc := b * b\n\tmemo[a] = c * 5\n\treturn memo[a]\n}\nfunc powMod(a, n, mod int) int {\n\tif n == 0 {\n\t\treturn 1 % mod\n\t}\n\tif n == 1 {\n\t\treturn a % mod\n\t}\n\tif n%2 == 1 {\n\t\treturn powMod((a*a)%mod, n/2, mod) * a % mod\n\t}\n\treturn powMod((a*a)%mod, n/2, mod)\n}\n\nfunc factoricalMod(n, count, mod int) int {\n\tif count == 1 {\n\t\treturn n % mod\n\t}\n\treturn (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod\n}\n\nfunc combinationMod(n, a, mod int) int {\n\tx := factoricalMod(n, a, mod)\n\ty := factoricalMod(a, a, mod)\n\ty = powMod(y, mod-2, mod)\n\treturn ((x % mod) * (y % mod)) % mod\n}\nfunc countBitOfOn(i, numbits int) int {\n\tcount := 0\n\tvar bit uint64\n\tfor bit = 0; bit < uint64(numbits); bit++ {\n\t\tt := 1 << bit\n\t\tif i&t > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\ntype ints []int\n\nfunc ToString(slice []int) string {\n\tformat := fmt.Sprint(slice)\n\treturn fmt.Sprint(format[1 : len(format)-1])\n}\n\ntype String string\n\nfunc reverseS(s []int) {\n\tfor i := 0; i < len(s)/2; i++ {\n\t\ts[i], s[len(s)-1-i] = s[len(s)-1-i], s[i]\n\t}\n}\n\nfunc (s String) revese() string {\n\tb := []byte(s)\n\tfor i := 0; i < len(b)/2; i++ {\n\t\tb[i], b[len(b)-1-i] = b[len(b)-1-i], b[i]\n\t}\n\treturn string(b)\n}\n", "language": "Go", "metadata": {"date": 1592185244, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02641/input.txt", "sample_output_relpath": "derived/input_output/data/p02641/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02641/Go/s973268428.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s973268428", "user_id": "u663116078"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc contains(n int, slice []int) bool {\n\tfor _, e := range slice {\n\t\tif e == n {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tscanner := makeWordScanner()\n\tx := eGetInt(scanner)\n\tn := eGetInt(scanner)\n\tps := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tps[i] = eGetInt(scanner)\n\t}\n\tfor diff := 0; diff < 100; diff++ {\n\t\t// 小さい方\n\t\ts := x - diff\n\t\tif !contains(s, ps) {\n\t\t\tfmt.Println(s)\n\t\t\treturn\n\t\t}\n\t\t// 大きい方\n\t\tl := x + diff\n\t\tif !contains(l, ps) {\n\t\t\tfmt.Println(l)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nconst (\n\tTooLarge = math.MaxInt64\n\tTooSmall = math.MinInt64\n)\n\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeCharScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanRunes)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n == 1 {\n\t\treturn a\n\t}\n\tif n%2 == 1 {\n\t\treturn pow((a*a), n/2) * a\n\t}\n\treturn pow((a * a), n/2)\n}\nfunc pow5(a int, memo map[int]int) int {\n\tv, ok := memo[a]\n\tif ok {\n\t\treturn v\n\t}\n\n\tb := a * a\n\tc := b * b\n\tmemo[a] = c * 5\n\treturn memo[a]\n}\nfunc powMod(a, n, mod int) int {\n\tif n == 0 {\n\t\treturn 1 % mod\n\t}\n\tif n == 1 {\n\t\treturn a % mod\n\t}\n\tif n%2 == 1 {\n\t\treturn powMod((a*a)%mod, n/2, mod) * a % mod\n\t}\n\treturn powMod((a*a)%mod, n/2, mod)\n}\n\nfunc factoricalMod(n, count, mod int) int {\n\tif count == 1 {\n\t\treturn n % mod\n\t}\n\treturn (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod\n}\n\nfunc combinationMod(n, a, mod int) int {\n\tx := factoricalMod(n, a, mod)\n\ty := factoricalMod(a, a, mod)\n\ty = powMod(y, mod-2, mod)\n\treturn ((x % mod) * (y % mod)) % mod\n}\nfunc countBitOfOn(i, numbits int) int {\n\tcount := 0\n\tvar bit uint64\n\tfor bit = 0; bit < uint64(numbits); bit++ {\n\t\tt := 1 << bit\n\t\tif i&t > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\ntype ints []int\n\nfunc ToString(slice []int) string {\n\tformat := fmt.Sprint(slice)\n\treturn fmt.Sprint(format[1 : len(format)-1])\n}\n\ntype String string\n\nfunc reverseS(s []int) {\n\tfor i := 0; i < len(s)/2; i++ {\n\t\ts[i], s[len(s)-1-i] = s[len(s)-1-i], s[i]\n\t}\n}\n\nfunc (s String) revese() string {\n\tb := []byte(s)\n\tfor i := 0; i < len(b)/2; i++ {\n\t\tb[i], b[len(b)-1-i] = b[len(b)-1-i], b[i]\n\t}\n\treturn string(b)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3745, "cpu_time_ms": 2, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s329422744", "group_id": "codeNet:p02641", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc lib_CountInt(values []int) map[int]int {\n\tm := map[int]int{}\n\tfor _, value := range values {\n\t\tm[value]++\n\t}\n\treturn m\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar X int\n\tscanner.Scan()\n\tX, _ = strconv.Atoi(scanner.Text())\n\tvar N int\n\tscanner.Scan()\n\tN, _ = strconv.Atoi(scanner.Text())\n\tp := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tscanner.Scan()\n\t\tp[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\tfmt.Println(solve(X, N, p))\n}\nfunc solve(X int, N int, p []int) int {\n\tcounts := lib_CountInt(p)\n\tfor i := 0; ; i++ {\n\t\tif _, ok := counts[X-i]; !ok {\n\t\t\treturn X - i\n\t\t}\n\t\tif _, ok := counts[X+i]; !ok {\n\t\t\treturn X + i\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592183795, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02641/input.txt", "sample_output_relpath": "derived/input_output/data/p02641/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02641/Go/s329422744.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s329422744", "user_id": "u562039972"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc lib_CountInt(values []int) map[int]int {\n\tm := map[int]int{}\n\tfor _, value := range values {\n\t\tm[value]++\n\t}\n\treturn m\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar X int\n\tscanner.Scan()\n\tX, _ = strconv.Atoi(scanner.Text())\n\tvar N int\n\tscanner.Scan()\n\tN, _ = strconv.Atoi(scanner.Text())\n\tp := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tscanner.Scan()\n\t\tp[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\tfmt.Println(solve(X, N, p))\n}\nfunc solve(X int, N int, p []int) int {\n\tcounts := lib_CountInt(p)\n\tfor i := 0; ; i++ {\n\t\tif _, ok := counts[X-i]; !ok {\n\t\t\treturn X - i\n\t\t}\n\t\tif _, ok := counts[X+i]; !ok {\n\t\t\treturn X + i\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 851, "cpu_time_ms": 5, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s699502906", "group_id": "codeNet:p02644", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\textra := 0\n\tif os.Getenv(\"I\") == \"IronMan\" {\n\t\tfp, _ = os.Open(os.Getenv(\"END_GAME\"))\n\t\textra = 100\n\t}\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n\tfor i := 0; i < extra; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\th := getNextInt(scanner)\n\tw := getNextInt(scanner)\n\tk := getNextInt64(scanner)\n\txx := make([]int, 2)\n\tyy := make([]int, 2)\n\tfor i := 0; i < 2; i++ {\n\t\txx[i] = getNextInt(scanner) - 1\n\t\tyy[i] = getNextInt(scanner) - 1\n\t}\n\tss := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tss[i] = getNextString(scanner)\n\t}\n\tdd := makeGrid(h, w)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tfor d := 0; d < 4; d++ {\n\t\t\t\tdd[i][j][d] = math.MaxInt64\n\t\t\t}\n\t\t}\n\t}\n\tdk := &daikes{}\n\tfor i := 0; i < 4; i++ {\n\t\theap.Push(dk, newDaike(xx[0], yy[0], i, 0))\n\t}\n\tdy := [4]int{-1, 0, 0, 1}\n\tdx := [4]int{0, -1, 1, 0}\n\tfor dk.Len() > 0 {\n\t\tp := heap.Pop(dk).(daike)\n\t\tif dd[p.x][p.y][p.d] <= p.c {\n\t\t\tcontinue\n\t\t}\n\t\tdd[p.x][p.y][p.d] = p.c\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tx := p.x + dx[i]\n\t\t\ty := p.y + dy[i]\n\t\t\tif x < 0 || x >= h {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif y < 0 || y >= w {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ss[x][y] == '@' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif p.d == i {\n\t\t\t\theap.Push(dk, newDaike(x, y, i, p.c+1))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\theap.Push(dk, newDaike(x, y, i, p.c/k*k+k))\n\t\t}\n\t}\n\tvar ans int64\n\tans = math.MaxInt64\n\tfor i := 0; i < 4; i++ {\n\t\tif ans > dd[xx[1]][yy[1]][i] {\n\t\t\tans = dd[xx[1]][yy[1]][i]\n\t\t}\n\t}\n\tif ans == math.MaxInt64 {\n\t\tfmt.Fprintln(writer, -1)\n\t\treturn\n\t}\n\tfmt.Fprintln(writer, (ans+k-1)/k)\n}\n\ntype daike struct {\n\tx, y, d int\n\tc int64\n}\n\nfunc newDaike(x, y, d int, c int64) daike {\n\treturn daike{x: x, y: y, d: d, c: c}\n}\n\ntype daikes []daike\n\nfunc (h daikes) Len() int { return len(h) }\nfunc (h daikes) Less(i, j int) bool {\n\treturn h[i].c < h[j].c\n}\nfunc (h daikes) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *daikes) Push(x interface{}) {\n\t*h = append(*h, x.(daike))\n}\nfunc (h *daikes) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\ntype direction [4]int64\n\nfunc makeGrid(h, w int) [][]direction {\n\tindex := make([][]direction, h, h)\n\tdata := make([]direction, h*w, h*w)\n\tfor i := 0; i < h; i++ {\n\t\tindex[i] = data[i*w : (i+1)*w]\n\t}\n\treturn index\n}\n", "language": "Go", "metadata": {"date": 1596505462, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02644.html", "problem_id": "p02644", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02644/input.txt", "sample_output_relpath": "derived/input_output/data/p02644/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02644/Go/s699502906.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s699502906", "user_id": "u150542210"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\textra := 0\n\tif os.Getenv(\"I\") == \"IronMan\" {\n\t\tfp, _ = os.Open(os.Getenv(\"END_GAME\"))\n\t\textra = 100\n\t}\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n\tfor i := 0; i < extra; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\th := getNextInt(scanner)\n\tw := getNextInt(scanner)\n\tk := getNextInt64(scanner)\n\txx := make([]int, 2)\n\tyy := make([]int, 2)\n\tfor i := 0; i < 2; i++ {\n\t\txx[i] = getNextInt(scanner) - 1\n\t\tyy[i] = getNextInt(scanner) - 1\n\t}\n\tss := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tss[i] = getNextString(scanner)\n\t}\n\tdd := makeGrid(h, w)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tfor d := 0; d < 4; d++ {\n\t\t\t\tdd[i][j][d] = math.MaxInt64\n\t\t\t}\n\t\t}\n\t}\n\tdk := &daikes{}\n\tfor i := 0; i < 4; i++ {\n\t\theap.Push(dk, newDaike(xx[0], yy[0], i, 0))\n\t}\n\tdy := [4]int{-1, 0, 0, 1}\n\tdx := [4]int{0, -1, 1, 0}\n\tfor dk.Len() > 0 {\n\t\tp := heap.Pop(dk).(daike)\n\t\tif dd[p.x][p.y][p.d] <= p.c {\n\t\t\tcontinue\n\t\t}\n\t\tdd[p.x][p.y][p.d] = p.c\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tx := p.x + dx[i]\n\t\t\ty := p.y + dy[i]\n\t\t\tif x < 0 || x >= h {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif y < 0 || y >= w {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ss[x][y] == '@' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif p.d == i {\n\t\t\t\theap.Push(dk, newDaike(x, y, i, p.c+1))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\theap.Push(dk, newDaike(x, y, i, p.c/k*k+k))\n\t\t}\n\t}\n\tvar ans int64\n\tans = math.MaxInt64\n\tfor i := 0; i < 4; i++ {\n\t\tif ans > dd[xx[1]][yy[1]][i] {\n\t\t\tans = dd[xx[1]][yy[1]][i]\n\t\t}\n\t}\n\tif ans == math.MaxInt64 {\n\t\tfmt.Fprintln(writer, -1)\n\t\treturn\n\t}\n\tfmt.Fprintln(writer, (ans+k-1)/k)\n}\n\ntype daike struct {\n\tx, y, d int\n\tc int64\n}\n\nfunc newDaike(x, y, d int, c int64) daike {\n\treturn daike{x: x, y: y, d: d, c: c}\n}\n\ntype daikes []daike\n\nfunc (h daikes) Len() int { return len(h) }\nfunc (h daikes) Less(i, j int) bool {\n\treturn h[i].c < h[j].c\n}\nfunc (h daikes) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *daikes) Push(x interface{}) {\n\t*h = append(*h, x.(daike))\n}\nfunc (h *daikes) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\ntype direction [4]int64\n\nfunc makeGrid(h, w int) [][]direction {\n\tindex := make([][]direction, h, h)\n\tdata := make([]direction, h*w, h*w)\n\tfor i := 0; i < h; i++ {\n\t\tindex[i] = data[i*w : (i+1)*w]\n\t}\n\treturn index\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west.\n\nSome of the squares have a lotus leaf on it and cannot be entered.\nThe square (i,j) has a lotus leaf on it if c_{ij} is @, and it does not if c_{ij} is ..\n\nIn one stroke, Snuke can move between 1 and K squares (inclusive) toward one of the four directions: north, east, south, and west.\nThe move may not pass through a square with a lotus leaf. Moving to such a square or out of the pond is also forbidden.\n\nFind the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2).\nIf the travel from (x_1,y_1) to (x_2,y_2) is impossible, point out that fact.\n\nConstraints\n\n1 \\leq H,W,K \\leq 10^6\n\nH \\times W \\leq 10^6\n\n1 \\leq x_1,x_2 \\leq H\n\n1 \\leq y_1,y_2 \\leq W\n\nx_1 \\neq x_2 or y_1 \\neq y_2.\n\nc_{i,j} is . or @.\n\nc_{x_1,y_1} = .\n\nc_{x_2,y_2} = .\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\nx_1 y_1 x_2 y_2\nc_{1,1}c_{1,2} .. c_{1,W}\nc_{2,1}c_{2,2} .. c_{2,W}\n:\nc_{H,1}c_{H,2} .. c_{H,W}\n\nOutput\n\nPrint the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2), or print -1 if the travel is impossible.\n\nSample Input 1\n\n3 5 2\n3 2 3 4\n.....\n.@..@\n..@..\n\nSample Output 1\n\n5\n\nInitially, Snuke is at the square (3,2).\nHe can reach the square (3, 4) by making five strokes as follows:\n\nFrom (3, 2), go west one square to (3, 1).\n\nFrom (3, 1), go north two squares to (1, 1).\n\nFrom (1, 1), go east two squares to (1, 3).\n\nFrom (1, 3), go east one square to (1, 4).\n\nFrom (1, 4), go south two squares to (3, 4).\n\nSample Input 2\n\n1 6 4\n1 1 1 6\n......\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 1\n2 1 2 3\n.@.\n.@.\n.@.\n\nSample Output 3\n\n-1", "sample_input": "3 5 2\n3 2 3 4\n.....\n.@..@\n..@..\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02644", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west.\n\nSome of the squares have a lotus leaf on it and cannot be entered.\nThe square (i,j) has a lotus leaf on it if c_{ij} is @, and it does not if c_{ij} is ..\n\nIn one stroke, Snuke can move between 1 and K squares (inclusive) toward one of the four directions: north, east, south, and west.\nThe move may not pass through a square with a lotus leaf. Moving to such a square or out of the pond is also forbidden.\n\nFind the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2).\nIf the travel from (x_1,y_1) to (x_2,y_2) is impossible, point out that fact.\n\nConstraints\n\n1 \\leq H,W,K \\leq 10^6\n\nH \\times W \\leq 10^6\n\n1 \\leq x_1,x_2 \\leq H\n\n1 \\leq y_1,y_2 \\leq W\n\nx_1 \\neq x_2 or y_1 \\neq y_2.\n\nc_{i,j} is . or @.\n\nc_{x_1,y_1} = .\n\nc_{x_2,y_2} = .\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\nx_1 y_1 x_2 y_2\nc_{1,1}c_{1,2} .. c_{1,W}\nc_{2,1}c_{2,2} .. c_{2,W}\n:\nc_{H,1}c_{H,2} .. c_{H,W}\n\nOutput\n\nPrint the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2), or print -1 if the travel is impossible.\n\nSample Input 1\n\n3 5 2\n3 2 3 4\n.....\n.@..@\n..@..\n\nSample Output 1\n\n5\n\nInitially, Snuke is at the square (3,2).\nHe can reach the square (3, 4) by making five strokes as follows:\n\nFrom (3, 2), go west one square to (3, 1).\n\nFrom (3, 1), go north two squares to (1, 1).\n\nFrom (1, 1), go east two squares to (1, 3).\n\nFrom (1, 3), go east one square to (1, 4).\n\nFrom (1, 4), go south two squares to (3, 4).\n\nSample Input 2\n\n1 6 4\n1 1 1 6\n......\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 1\n2 1 2 3\n.@.\n.@.\n.@.\n\nSample Output 3\n\n-1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3246, "cpu_time_ms": 2702, "memory_kb": 150596}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s144358203", "group_id": "codeNet:p02644", "input_text": "package main\n \nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n \nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\th, _ := sc.NextInt()\n\tw, _ := sc.NextInt()\n\tk, _ := sc.NextInt()\n\tx1, _ := sc.NextInt()\n\ty1, _ := sc.NextInt()\n\tx2, _ := sc.NextInt()\n\ty2, _ := sc.NextInt()\n\tstage := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tsc.Scan()\n\t\tstage[i] = sc.Text()\n\t}\n\tans := solve(h, w, k, x1-1, y1-1, x2-1, y2-1, stage)\n\tfmt.Println(ans)\n}\n \ntype state struct {\n\tx, y, dist int\n}\n \nvar inf = math.MaxInt64\nvar dxs, dys = []int{0, 0, -1, 1}, []int{-1, 1, 0, 0}\n \nfunc solve(h, w, k, x1, y1, x2, y2 int, stage []string) int {\n\tdists := make([][]int, h)\n\tfor x := range dists {\n\t\tdists[x] = make([]int, w)\n\t\tfor y := range dists[x] {\n\t\t\tdists[x][y] = inf\n\t\t}\n\t}\n \n\tdists[x1][y1] = 0\n\t// q := priorityQueue{}\n\tq := []*state{}\n\ts := &state{x1, y1, 0}\n\t// heap.Push(&q, s)\n\tq = append(q, s)\n\t//for len(q) > 0 {\n\tfor idx := 0; idx < len(q); idx++ {\n\t\t//fmt.Println(q.String())\n\t\t// p := heap.Pop(&q).(*state)\n\t\tp := q[idx]\n\t\t//if p.x == x2 && p.y == y2 {\n\t\t//\treturn p.dist\n\t\t//}\n\t\tfor d := range dxs {\n\t\t\tfor i := 1; i <= k; i++ {\n\t\t\t\tx, y := p.x+i*dxs[d], p.y+i*dys[d]\n\t\t\t\tif x < 0 || h <= x || y < 0 || w <= y {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif stage[x][y] == '@' {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdist := p.dist + 1\n\t\t\t\tif dist > dists[x][y] {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif dist == dists[x][y] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdists[x][y] = dist\n\t\t\t\ts := &state{x, y, dist}\n\t\t\t\tq = append(q, s)\n\t\t\t}\n \n\t\t}\n\t}\n\tif dists[x2][y2] == inf {\n\t\treturn -1\n\t}\n\treturn dists[x2][y2]\n}\n \n// Scanner is a wrapper of bufio.Scanner which is customized for competitive programing.\ntype Scanner struct {\n\tbufio.Scanner\n}\n \n// NewScanner is a constructor for Scanner.\nfunc NewScanner(r io.Reader) *Scanner {\n\tsc := Scanner{*bufio.NewScanner(r)}\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\n\treturn &sc\n}\n \n// NextInt reads a integer from io stream.\nfunc (sc *Scanner) NextInt() (int, error) {\n\tif !sc.Scan() {\n\t\treturn -1, errors.New(\"failed to scan\")\n\t}\n\treturn strconv.Atoi(sc.Text())\n}", "language": "Go", "metadata": {"date": 1592441589, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02644.html", "problem_id": "p02644", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02644/input.txt", "sample_output_relpath": "derived/input_output/data/p02644/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02644/Go/s144358203.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s144358203", "user_id": "u914096063"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n \nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n \nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\th, _ := sc.NextInt()\n\tw, _ := sc.NextInt()\n\tk, _ := sc.NextInt()\n\tx1, _ := sc.NextInt()\n\ty1, _ := sc.NextInt()\n\tx2, _ := sc.NextInt()\n\ty2, _ := sc.NextInt()\n\tstage := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tsc.Scan()\n\t\tstage[i] = sc.Text()\n\t}\n\tans := solve(h, w, k, x1-1, y1-1, x2-1, y2-1, stage)\n\tfmt.Println(ans)\n}\n \ntype state struct {\n\tx, y, dist int\n}\n \nvar inf = math.MaxInt64\nvar dxs, dys = []int{0, 0, -1, 1}, []int{-1, 1, 0, 0}\n \nfunc solve(h, w, k, x1, y1, x2, y2 int, stage []string) int {\n\tdists := make([][]int, h)\n\tfor x := range dists {\n\t\tdists[x] = make([]int, w)\n\t\tfor y := range dists[x] {\n\t\t\tdists[x][y] = inf\n\t\t}\n\t}\n \n\tdists[x1][y1] = 0\n\t// q := priorityQueue{}\n\tq := []*state{}\n\ts := &state{x1, y1, 0}\n\t// heap.Push(&q, s)\n\tq = append(q, s)\n\t//for len(q) > 0 {\n\tfor idx := 0; idx < len(q); idx++ {\n\t\t//fmt.Println(q.String())\n\t\t// p := heap.Pop(&q).(*state)\n\t\tp := q[idx]\n\t\t//if p.x == x2 && p.y == y2 {\n\t\t//\treturn p.dist\n\t\t//}\n\t\tfor d := range dxs {\n\t\t\tfor i := 1; i <= k; i++ {\n\t\t\t\tx, y := p.x+i*dxs[d], p.y+i*dys[d]\n\t\t\t\tif x < 0 || h <= x || y < 0 || w <= y {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif stage[x][y] == '@' {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdist := p.dist + 1\n\t\t\t\tif dist > dists[x][y] {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif dist == dists[x][y] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdists[x][y] = dist\n\t\t\t\ts := &state{x, y, dist}\n\t\t\t\tq = append(q, s)\n\t\t\t}\n \n\t\t}\n\t}\n\tif dists[x2][y2] == inf {\n\t\treturn -1\n\t}\n\treturn dists[x2][y2]\n}\n \n// Scanner is a wrapper of bufio.Scanner which is customized for competitive programing.\ntype Scanner struct {\n\tbufio.Scanner\n}\n \n// NewScanner is a constructor for Scanner.\nfunc NewScanner(r io.Reader) *Scanner {\n\tsc := Scanner{*bufio.NewScanner(r)}\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\n\treturn &sc\n}\n \n// NextInt reads a integer from io stream.\nfunc (sc *Scanner) NextInt() (int, error) {\n\tif !sc.Scan() {\n\t\treturn -1, errors.New(\"failed to scan\")\n\t}\n\treturn strconv.Atoi(sc.Text())\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west.\n\nSome of the squares have a lotus leaf on it and cannot be entered.\nThe square (i,j) has a lotus leaf on it if c_{ij} is @, and it does not if c_{ij} is ..\n\nIn one stroke, Snuke can move between 1 and K squares (inclusive) toward one of the four directions: north, east, south, and west.\nThe move may not pass through a square with a lotus leaf. Moving to such a square or out of the pond is also forbidden.\n\nFind the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2).\nIf the travel from (x_1,y_1) to (x_2,y_2) is impossible, point out that fact.\n\nConstraints\n\n1 \\leq H,W,K \\leq 10^6\n\nH \\times W \\leq 10^6\n\n1 \\leq x_1,x_2 \\leq H\n\n1 \\leq y_1,y_2 \\leq W\n\nx_1 \\neq x_2 or y_1 \\neq y_2.\n\nc_{i,j} is . or @.\n\nc_{x_1,y_1} = .\n\nc_{x_2,y_2} = .\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\nx_1 y_1 x_2 y_2\nc_{1,1}c_{1,2} .. c_{1,W}\nc_{2,1}c_{2,2} .. c_{2,W}\n:\nc_{H,1}c_{H,2} .. c_{H,W}\n\nOutput\n\nPrint the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2), or print -1 if the travel is impossible.\n\nSample Input 1\n\n3 5 2\n3 2 3 4\n.....\n.@..@\n..@..\n\nSample Output 1\n\n5\n\nInitially, Snuke is at the square (3,2).\nHe can reach the square (3, 4) by making five strokes as follows:\n\nFrom (3, 2), go west one square to (3, 1).\n\nFrom (3, 1), go north two squares to (1, 1).\n\nFrom (1, 1), go east two squares to (1, 3).\n\nFrom (1, 3), go east one square to (1, 4).\n\nFrom (1, 4), go south two squares to (3, 4).\n\nSample Input 2\n\n1 6 4\n1 1 1 6\n......\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 1\n2 1 2 3\n.@.\n.@.\n.@.\n\nSample Output 3\n\n-1", "sample_input": "3 5 2\n3 2 3 4\n.....\n.@..@\n..@..\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02644", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west.\n\nSome of the squares have a lotus leaf on it and cannot be entered.\nThe square (i,j) has a lotus leaf on it if c_{ij} is @, and it does not if c_{ij} is ..\n\nIn one stroke, Snuke can move between 1 and K squares (inclusive) toward one of the four directions: north, east, south, and west.\nThe move may not pass through a square with a lotus leaf. Moving to such a square or out of the pond is also forbidden.\n\nFind the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2).\nIf the travel from (x_1,y_1) to (x_2,y_2) is impossible, point out that fact.\n\nConstraints\n\n1 \\leq H,W,K \\leq 10^6\n\nH \\times W \\leq 10^6\n\n1 \\leq x_1,x_2 \\leq H\n\n1 \\leq y_1,y_2 \\leq W\n\nx_1 \\neq x_2 or y_1 \\neq y_2.\n\nc_{i,j} is . or @.\n\nc_{x_1,y_1} = .\n\nc_{x_2,y_2} = .\n\nAll numbers in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\nx_1 y_1 x_2 y_2\nc_{1,1}c_{1,2} .. c_{1,W}\nc_{2,1}c_{2,2} .. c_{2,W}\n:\nc_{H,1}c_{H,2} .. c_{H,W}\n\nOutput\n\nPrint the minimum number of strokes Snuke takes to travel from the square (x_1,y_1) to (x_2,y_2), or print -1 if the travel is impossible.\n\nSample Input 1\n\n3 5 2\n3 2 3 4\n.....\n.@..@\n..@..\n\nSample Output 1\n\n5\n\nInitially, Snuke is at the square (3,2).\nHe can reach the square (3, 4) by making five strokes as follows:\n\nFrom (3, 2), go west one square to (3, 1).\n\nFrom (3, 1), go north two squares to (1, 1).\n\nFrom (1, 1), go east two squares to (1, 3).\n\nFrom (1, 3), go east one square to (1, 4).\n\nFrom (1, 4), go south two squares to (3, 4).\n\nSample Input 2\n\n1 6 4\n1 1 1 6\n......\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 1\n2 1 2 3\n.@.\n.@.\n.@.\n\nSample Output 3\n\n-1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2064, "cpu_time_ms": 158, "memory_kb": 56344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s757633789", "group_id": "codeNet:p02645", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tS := readString()\n\tfmt.Println(S[0:3])\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1592114429, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02645.html", "problem_id": "p02645", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02645/input.txt", "sample_output_relpath": "derived/input_output/data/p02645/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02645/Go/s757633789.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s757633789", "user_id": "u967669872"}, "prompt_components": {"gold_output": "tak\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tS := readString()\n\tfmt.Println(S[0:3])\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWhen you asked some guy in your class his name, he called himself S, where S is a string of length between 3 and 20 (inclusive) consisting of lowercase English letters.\nYou have decided to choose some three consecutive characters from S and make it his nickname. Print a string that is a valid nickname for him.\n\nConstraints\n\n3 \\leq |S| \\leq 20\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint your answer.\n\nSample Input 1\n\ntakahashi\n\nSample Output 1\n\ntak\n\nSample Input 2\n\nnaohiro\n\nSample Output 2\n\nnao", "sample_input": "takahashi\n"}, "reference_outputs": ["tak\n"], "source_document_id": "p02645", "source_text": "Score : 100 points\n\nProblem Statement\n\nWhen you asked some guy in your class his name, he called himself S, where S is a string of length between 3 and 20 (inclusive) consisting of lowercase English letters.\nYou have decided to choose some three consecutive characters from S and make it his nickname. Print a string that is a valid nickname for him.\n\nConstraints\n\n3 \\leq |S| \\leq 20\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint your answer.\n\nSample Input 1\n\ntakahashi\n\nSample Output 1\n\ntak\n\nSample Input 2\n\nnaohiro\n\nSample Output 2\n\nnao", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5603, "cpu_time_ms": 3, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s591954789", "group_id": "codeNet:p02646", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tlist1 := getStdinIntArr64()\n\tlist2 := getStdinIntArr64()\n\tlist3 := getStdinIntArr64()\n\tA := list1[0]\n\tV := list1[1]\n\tB := list2[0]\n\tW := list2[1]\n\tT := list3[0]\n\n\tvar a uint64 = 0\n\tvar b uint64 = 0\n\tvar v uint64 = 0\n\tvar w uint64 = 0\n\tvar t uint64 = 0\n\ta = uint64(A)\n\tb = uint64(B)\n\tv = uint64(V)\n\tw = uint64(W)\n\tt = uint64(T)\n\n\t/*\n\t\tif A < B {\n\t\t\tv = V\n\t\t\tw = W\n\t\t} else {\n\t\t\tv = -V\n\t\t\tw = -W\n\t\t}\n\t*/\n\tvar acnt uint64 = 0\n\tvar bcnt uint64 = 0\n\tvar i1 uint64 = 0\n\tvar i2 uint64 = 0\n\t//var l uint64 = 0\n\t//var cnt1 uint64 = 0\n\t//var cnt2 uint64 = 0\n\t//l = lcm(v, w)\n\t//cnt1 = l / v\n\t//cnt2 = l / w\n\n\tif A < B {\n\t\tfor i1 <= t && i2 <= t {\n\t\t\tacnt += v\n\t\t\tbcnt += w\n\t\t\tif acnt > 1000000007 || bcnt > 1000000007 {\n\t\t\t\tacnt -= 1000000007\n\t\t\t\tbcnt -= 1000000007\n\t\t\t}\n\t\t\tif a+acnt == b+bcnt {\n\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif acnt == bcnt {\n\t\t\t\tfmt.Printf(\"NO\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti1++\n\t\t\ti2++\n\t\t}\n\t} else {\n\t\tb = a - b\n\t\ta = 0\n\t\tfor i1 <= t && i2 <= t {\n\t\t\tacnt += v\n\t\t\tbcnt += w\n\t\t\tif acnt > 1000000007 || bcnt > 1000000007 {\n\t\t\t\tacnt -= 1000000007\n\t\t\t\tbcnt -= 1000000007\n\t\t\t}\n\t\t\tif a+acnt == b+bcnt {\n\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif acnt == bcnt {\n\t\t\t\tfmt.Printf(\"NO\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti1++\n\t\t\ti2++\n\t\t}\n\t}\n\n\t//l := lcm(V, W)\n\t/*\n\t\tif A+T* > 0 {\n\t\t\tfmt.Printf(\"Yes\\n\")\n\t\t\treturn\n\t\t}\n\t*/\n\tfmt.Printf(\"NO\\n\")\n\n\t/*\n\t\tlist1 := getStdinIntArr64()\n\t\tlist2 := getStdinIntArr64()\n\t\tlist3 := getStdinIntArr64()\n\t\tA := list1[0]\n\t\tV := list1[1]\n\t\tB := list2[0]\n\t\tW := list2[1]\n\t\tT := list3[0]\n\n\t\tAbig := big.NewInt(A)\n\t\tVbig := big.NewInt(V)\n\t\tBbig := big.NewInt(B)\n\t\tWbig := big.NewInt(W)\n\n\t\tvar i int64 = 0\n\n\t\tif A < B {\n\t\t\tfor i = 0; i <= T; i++ {\n\t\t\t\tAbig.Add(Abig, Vbig)\n\t\t\t\tBbig.Add(Bbig, Wbig)\n\t\t\t\tif Abig.Cmp(Bbig) == 0 {\n\t\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor i = 0; i <= T; i++ {\n\t\t\t\tAbig.Sub(Abig, Vbig)\n\t\t\t\tBbig.Sub(Bbig, Wbig)\n\t\t\t\tif Abig.Cmp(Bbig) == 0 {\n\t\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"NO\\n\")\n\t*/\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc gcd(a, b uint64) uint64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\nfunc lcm(a, b uint64) uint64 {\n\treturn a * b / gcd(a, b)\n}\n", "language": "Go", "metadata": {"date": 1592103534, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02646/input.txt", "sample_output_relpath": "derived/input_output/data/p02646/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02646/Go/s591954789.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s591954789", "user_id": "u149861487"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tlist1 := getStdinIntArr64()\n\tlist2 := getStdinIntArr64()\n\tlist3 := getStdinIntArr64()\n\tA := list1[0]\n\tV := list1[1]\n\tB := list2[0]\n\tW := list2[1]\n\tT := list3[0]\n\n\tvar a uint64 = 0\n\tvar b uint64 = 0\n\tvar v uint64 = 0\n\tvar w uint64 = 0\n\tvar t uint64 = 0\n\ta = uint64(A)\n\tb = uint64(B)\n\tv = uint64(V)\n\tw = uint64(W)\n\tt = uint64(T)\n\n\t/*\n\t\tif A < B {\n\t\t\tv = V\n\t\t\tw = W\n\t\t} else {\n\t\t\tv = -V\n\t\t\tw = -W\n\t\t}\n\t*/\n\tvar acnt uint64 = 0\n\tvar bcnt uint64 = 0\n\tvar i1 uint64 = 0\n\tvar i2 uint64 = 0\n\t//var l uint64 = 0\n\t//var cnt1 uint64 = 0\n\t//var cnt2 uint64 = 0\n\t//l = lcm(v, w)\n\t//cnt1 = l / v\n\t//cnt2 = l / w\n\n\tif A < B {\n\t\tfor i1 <= t && i2 <= t {\n\t\t\tacnt += v\n\t\t\tbcnt += w\n\t\t\tif acnt > 1000000007 || bcnt > 1000000007 {\n\t\t\t\tacnt -= 1000000007\n\t\t\t\tbcnt -= 1000000007\n\t\t\t}\n\t\t\tif a+acnt == b+bcnt {\n\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif acnt == bcnt {\n\t\t\t\tfmt.Printf(\"NO\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti1++\n\t\t\ti2++\n\t\t}\n\t} else {\n\t\tb = a - b\n\t\ta = 0\n\t\tfor i1 <= t && i2 <= t {\n\t\t\tacnt += v\n\t\t\tbcnt += w\n\t\t\tif acnt > 1000000007 || bcnt > 1000000007 {\n\t\t\t\tacnt -= 1000000007\n\t\t\t\tbcnt -= 1000000007\n\t\t\t}\n\t\t\tif a+acnt == b+bcnt {\n\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif acnt == bcnt {\n\t\t\t\tfmt.Printf(\"NO\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti1++\n\t\t\ti2++\n\t\t}\n\t}\n\n\t//l := lcm(V, W)\n\t/*\n\t\tif A+T* > 0 {\n\t\t\tfmt.Printf(\"Yes\\n\")\n\t\t\treturn\n\t\t}\n\t*/\n\tfmt.Printf(\"NO\\n\")\n\n\t/*\n\t\tlist1 := getStdinIntArr64()\n\t\tlist2 := getStdinIntArr64()\n\t\tlist3 := getStdinIntArr64()\n\t\tA := list1[0]\n\t\tV := list1[1]\n\t\tB := list2[0]\n\t\tW := list2[1]\n\t\tT := list3[0]\n\n\t\tAbig := big.NewInt(A)\n\t\tVbig := big.NewInt(V)\n\t\tBbig := big.NewInt(B)\n\t\tWbig := big.NewInt(W)\n\n\t\tvar i int64 = 0\n\n\t\tif A < B {\n\t\t\tfor i = 0; i <= T; i++ {\n\t\t\t\tAbig.Add(Abig, Vbig)\n\t\t\t\tBbig.Add(Bbig, Wbig)\n\t\t\t\tif Abig.Cmp(Bbig) == 0 {\n\t\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor i = 0; i <= T; i++ {\n\t\t\t\tAbig.Sub(Abig, Vbig)\n\t\t\t\tBbig.Sub(Bbig, Wbig)\n\t\t\t\tif Abig.Cmp(Bbig) == 0 {\n\t\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"NO\\n\")\n\t*/\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc gcd(a, b uint64) uint64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\nfunc lcm(a, b uint64) uint64 {\n\treturn a * b / gcd(a, b)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "sample_input": "1 2\n3 1\n3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02646", "source_text": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3005, "cpu_time_ms": 1483, "memory_kb": 2148}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s926100433", "group_id": "codeNet:p02646", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tA := sc.i()\n\tV := sc.i()\n\tB := sc.i()\n\tW := sc.i()\n\tT := sc.i()\n\n\tif A > B {\n\t\tA, B = B, A\n\t\tV, W = W, V\n\t}\n\n\tfor i := 1; i <= T; i++ {\n\t\t// fmt.Println(\"A=\", V*i+A, \"B=\", W*i+B)\n\t\tif V*i+A == W*i+B {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn 0\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1592100288, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02646/input.txt", "sample_output_relpath": "derived/input_output/data/p02646/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02646/Go/s926100433.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s926100433", "user_id": "u737368452"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tA := sc.i()\n\tV := sc.i()\n\tB := sc.i()\n\tW := sc.i()\n\tT := sc.i()\n\n\tif A > B {\n\t\tA, B = B, A\n\t\tV, W = W, V\n\t}\n\n\tfor i := 1; i <= T; i++ {\n\t\t// fmt.Println(\"A=\", V*i+A, \"B=\", W*i+B)\n\t\tif V*i+A == W*i+B {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn 0\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "sample_input": "1 2\n3 1\n3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02646", "source_text": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1336, "cpu_time_ms": 1190, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s956098594", "group_id": "codeNet:p02646", "input_text": "package main\n\nimport(\n\tf \"fmt\"\n)\n\nfunc main() {\n\tvar a_place, a_v int\n\tf.Scan(&a_place, &a_v)\n\n\tvar b_place, b_v int\n\tf.Scan(&b_place, &b_v)\n\n\tvar time int\n\tf.Scan(&time)\n\n\ta := a_v * time + a_place\n\tb := b_v * time + b_place\n\n\tif a >= b {\n\t\tf.Println(\"YES\")\n\t} else {\n\t\tf.Println(\"NO\")\n\t}\n}", "language": "Go", "metadata": {"date": 1592097548, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02646/input.txt", "sample_output_relpath": "derived/input_output/data/p02646/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02646/Go/s956098594.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s956098594", "user_id": "u844364521"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport(\n\tf \"fmt\"\n)\n\nfunc main() {\n\tvar a_place, a_v int\n\tf.Scan(&a_place, &a_v)\n\n\tvar b_place, b_v int\n\tf.Scan(&b_place, &b_v)\n\n\tvar time int\n\tf.Scan(&time)\n\n\ta := a_v * time + a_place\n\tb := b_v * time + b_place\n\n\tif a >= b {\n\t\tf.Println(\"YES\")\n\t} else {\n\t\tf.Println(\"NO\")\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "sample_input": "1 2\n3 1\n3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02646", "source_text": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 291, "cpu_time_ms": 2, "memory_kb": 1812}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s000793960", "group_id": "codeNet:p02657", "input_text": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar a, b int\n \n \tfmt.Scan(&a, &b)\n \n \tfmt.Println(a * b)\n}", "language": "Go", "metadata": {"date": 1590973285, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02657.html", "problem_id": "p02657", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02657/input.txt", "sample_output_relpath": "derived/input_output/data/p02657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02657/Go/s000793960.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s000793960", "user_id": "u888376810"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar a, b int\n \n \tfmt.Scan(&a, &b)\n \n \tfmt.Println(a * b)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 106, "cpu_time_ms": 3, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s275911415", "group_id": "codeNet:p02660", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tvar memo map[int]int\n\tmemo = map[int]int{}\n\tsosu := true\n\titi := false\n\tif N == 1 {\n\t\titi = true\n\t}\n\t// fmt.Println(N)\n\tfor i:=2; i * i <= N; i++ {\n\t\tif N % i == 0{\n\t\t\ttarget := i\n\t\t\tcheck := true\n\t\t\tfor check {\n\t\t\t\tcheck = false\n\t\t\t\tfor j, value := range memo {\n\t\t\t\t\tif target%j == 0 {\n\t\t\t\t\t\ttarget = target / j\n\t\t\t\t\t\tmemo [j] = value + 1\n\t\t\t\t\t\tcheck = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif target != 1 {\n\t\t\t\t// fmt.Println(target)\n\t\t\t\tmemo[target] = 1\n\t\t\t\tsosu = false\n\t\t\t}\n\t\t\tN = N/i\n\t\t}\n\t}\n\ttarget := N\n\tcheck := true\n\tfor check {\n\t\tcheck = false\n\t\t// fmt.Println(memo,target)\n\t\tfor j, value := range memo {\n\t\t\t// fmt.Println(j,value,target)\n\t\t\tif target%j == 0 {\n\t\t\t\ttarget = target / j\n\t\t\t\tmemo [j] = value + 1\n\t\t\t\tcheck = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif target != 1 {\n\t\t// fmt.Println(\"check\",target)\n\t\tmemo[target] = 1\n\t}\n\tif sosu {\n\t\tif iti {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(1)\n\t\t}\n\t} else {\n\t\tsum := 0\n\t\tfor _,value := range memo {\n\t\t\tcount := value\n\t\t\tfor i:=1; i<=value; i++ {\n\t\t\t\tif count-i >= 0 {\n\t\t\t\t\tcount -= i\n\t\t\t\t\tsum += 1\n\t\t\t\t\t// fmt.Println(sum,count,j)\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(sum)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1591175078, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02660.html", "problem_id": "p02660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02660/input.txt", "sample_output_relpath": "derived/input_output/data/p02660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02660/Go/s275911415.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s275911415", "user_id": "u184577857"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tvar memo map[int]int\n\tmemo = map[int]int{}\n\tsosu := true\n\titi := false\n\tif N == 1 {\n\t\titi = true\n\t}\n\t// fmt.Println(N)\n\tfor i:=2; i * i <= N; i++ {\n\t\tif N % i == 0{\n\t\t\ttarget := i\n\t\t\tcheck := true\n\t\t\tfor check {\n\t\t\t\tcheck = false\n\t\t\t\tfor j, value := range memo {\n\t\t\t\t\tif target%j == 0 {\n\t\t\t\t\t\ttarget = target / j\n\t\t\t\t\t\tmemo [j] = value + 1\n\t\t\t\t\t\tcheck = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif target != 1 {\n\t\t\t\t// fmt.Println(target)\n\t\t\t\tmemo[target] = 1\n\t\t\t\tsosu = false\n\t\t\t}\n\t\t\tN = N/i\n\t\t}\n\t}\n\ttarget := N\n\tcheck := true\n\tfor check {\n\t\tcheck = false\n\t\t// fmt.Println(memo,target)\n\t\tfor j, value := range memo {\n\t\t\t// fmt.Println(j,value,target)\n\t\t\tif target%j == 0 {\n\t\t\t\ttarget = target / j\n\t\t\t\tmemo [j] = value + 1\n\t\t\t\tcheck = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif target != 1 {\n\t\t// fmt.Println(\"check\",target)\n\t\tmemo[target] = 1\n\t}\n\tif sosu {\n\t\tif iti {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(1)\n\t\t}\n\t} else {\n\t\tsum := 0\n\t\tfor _,value := range memo {\n\t\t\tcount := value\n\t\t\tfor i:=1; i<=value; i++ {\n\t\t\t\tif count-i >= 0 {\n\t\t\t\t\tcount -= i\n\t\t\t\t\tsum += 1\n\t\t\t\t\t// fmt.Println(sum,count,j)\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(sum)\n\t}\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "sample_input": "24\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02660", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1220, "cpu_time_ms": 21, "memory_kb": 1848}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s994084265", "group_id": "codeNet:p02660", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc PrimeFactorization(n int) (pfs map[int]int) {\n\tpfs = make(map[int]int)\n\n\tfor n%2 == 0 {\n\t\tif _, ok := pfs[2]; ok {\n\t\t\tpfs[2]++\n\t\t} else {\n\t\t\tpfs[2] = 1\n\t\t}\n\t\tn = n / 2\n\t}\n\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tif _, ok := pfs[i]; ok {\n\t\t\t\tpfs[i]++\n\t\t\t} else {\n\t\t\t\tpfs[i] = 1\n\t\t\t}\n\t\t\tn = n / i\n\t\t}\n\t}\n\tif n > 2 {\n\t\tpfs[n] = 1\n\t}\n\n\treturn\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tpfs := PrimeFactorization(n)\n\n\tcnt := 0\n\tfor _, exp := range pfs {\n\t\td := 1\n\t\tfor d <= exp {\n\t\t\texp -= d\n\t\t\tcnt++\n\t\t\td++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}", "language": "Go", "metadata": {"date": 1591046463, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02660.html", "problem_id": "p02660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02660/input.txt", "sample_output_relpath": "derived/input_output/data/p02660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02660/Go/s994084265.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s994084265", "user_id": "u655410252"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc PrimeFactorization(n int) (pfs map[int]int) {\n\tpfs = make(map[int]int)\n\n\tfor n%2 == 0 {\n\t\tif _, ok := pfs[2]; ok {\n\t\t\tpfs[2]++\n\t\t} else {\n\t\t\tpfs[2] = 1\n\t\t}\n\t\tn = n / 2\n\t}\n\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tif _, ok := pfs[i]; ok {\n\t\t\t\tpfs[i]++\n\t\t\t} else {\n\t\t\t\tpfs[i] = 1\n\t\t\t}\n\t\t\tn = n / i\n\t\t}\n\t}\n\tif n > 2 {\n\t\tpfs[n] = 1\n\t}\n\n\treturn\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tpfs := PrimeFactorization(n)\n\n\tcnt := 0\n\tfor _, exp := range pfs {\n\t\td := 1\n\t\tfor d <= exp {\n\t\t\texp -= d\n\t\t\tcnt++\n\t\t\td++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "sample_input": "24\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02660", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 590, "cpu_time_ms": 15, "memory_kb": 1824}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s282001642", "group_id": "codeNet:p02660", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)\n\nfunc main() {\n\tN := getStdinInt()\n\tNori := N\n\tarr := make([]bool, int(math.Sqrt(float64(N)))+1)\n\n\t// 初期化\n\tfor i := 2; i < len(arr); i++ {\n\t\tarr[i] = true\n\t}\n\t// 素数を求める\n\tarr[0] = false\n\tarr[1] = false\n\tfor i := 2; i < len(arr); i++ {\n\t\tif arr[i] {\n\t\t\tfor j := i * 2; j < len(arr); j += i {\n\t\t\t\tarr[j] = false\n\t\t\t}\n\t\t}\n\t}\n\t// 割り切れるか判別(素因数分解)\n\tcnt := 0\n\tfor i := 2; i < len(arr); i++ {\n\t\tif arr[i] && (N%i) == 0 {\n\t\t\tmul := i\n\t\t\tfor {\n\t\t\t\tif N%mul == 0 {\n\t\t\t\t\tcnt++\n\t\t\t\t\tN /= mul\n\t\t\t\t\tmul += mul\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif N == 1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif cnt == 0 && (Nori == 0 || Nori == 1) {\n\t\tfmt.Printf(\"%d\\n\", 0)\n\t} else if cnt == 0 {\n\t\tfmt.Printf(\"1\\n\")\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", cnt)\n\t}\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "language": "Go", "metadata": {"date": 1591040559, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02660.html", "problem_id": "p02660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02660/input.txt", "sample_output_relpath": "derived/input_output/data/p02660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02660/Go/s282001642.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s282001642", "user_id": "u149861487"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)\n\nfunc main() {\n\tN := getStdinInt()\n\tNori := N\n\tarr := make([]bool, int(math.Sqrt(float64(N)))+1)\n\n\t// 初期化\n\tfor i := 2; i < len(arr); i++ {\n\t\tarr[i] = true\n\t}\n\t// 素数を求める\n\tarr[0] = false\n\tarr[1] = false\n\tfor i := 2; i < len(arr); i++ {\n\t\tif arr[i] {\n\t\t\tfor j := i * 2; j < len(arr); j += i {\n\t\t\t\tarr[j] = false\n\t\t\t}\n\t\t}\n\t}\n\t// 割り切れるか判別(素因数分解)\n\tcnt := 0\n\tfor i := 2; i < len(arr); i++ {\n\t\tif arr[i] && (N%i) == 0 {\n\t\t\tmul := i\n\t\t\tfor {\n\t\t\t\tif N%mul == 0 {\n\t\t\t\t\tcnt++\n\t\t\t\t\tN /= mul\n\t\t\t\t\tmul += mul\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif N == 1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif cnt == 0 && (Nori == 0 || Nori == 1) {\n\t\tfmt.Printf(\"%d\\n\", 0)\n\t} else if cnt == 0 {\n\t\tfmt.Printf(\"1\\n\")\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", cnt)\n\t}\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "sample_input": "24\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02660", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1629, "cpu_time_ms": 21, "memory_kb": 2832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s038782178", "group_id": "codeNet:p02660", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\n\tm := make(map[int]int)\n\tfor N%2 == 0 {\n\t\tm[2]++\n\t\tN /= 2\n\t}\n\tfor d := 3; d*d <= N; d += 2 {\n\t\tfor N%d == 0 {\n\t\t\tm[d]++\n\t\t\tN /= d\n\t\t}\n\t}\n\n\tif N != 1 {\n\t\tm[N]++\n\t}\n\n\tvar ans int\n\tfor _, v := range m {\n\t\t//dbg(\"==========\")\n\t\t//dbg(p, v)\n\n\t\tfor c := 1; c <= v; c++ {\n\t\t\t//dbg(c, v, ans)\n\t\t\tv -= c\n\t\t\tans++\n\t\t\t//dbg(c, v, ans)\n\t\t\t//dbg(\"...........\")\n\t\t}\n\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "language": "Go", "metadata": {"date": 1590975790, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02660.html", "problem_id": "p02660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02660/input.txt", "sample_output_relpath": "derived/input_output/data/p02660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02660/Go/s038782178.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s038782178", "user_id": "u705974985"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\n\tm := make(map[int]int)\n\tfor N%2 == 0 {\n\t\tm[2]++\n\t\tN /= 2\n\t}\n\tfor d := 3; d*d <= N; d += 2 {\n\t\tfor N%d == 0 {\n\t\t\tm[d]++\n\t\t\tN /= d\n\t\t}\n\t}\n\n\tif N != 1 {\n\t\tm[N]++\n\t}\n\n\tvar ans int\n\tfor _, v := range m {\n\t\t//dbg(\"==========\")\n\t\t//dbg(p, v)\n\n\t\tfor c := 1; c <= v; c++ {\n\t\t\t//dbg(c, v, ans)\n\t\t\tv -= c\n\t\t\tans++\n\t\t\t//dbg(c, v, ans)\n\t\t\t//dbg(\"...........\")\n\t\t}\n\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "sample_input": "24\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02660", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N. Consider repeatedly applying the operation below on N:\n\nFirst, choose a positive integer z satisfying all of the conditions below:\n\nz can be represented as z=p^e, where p is a prime number and e is a positive integer;\n\nz divides N;\n\nz is different from all integers chosen in previous operations.\n\nThen, replace N with N/z.\n\nFind the maximum number of times the operation can be applied.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum number of times the operation can be applied.\n\nSample Input 1\n\n24\n\nSample Output 1\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=12.)\n\nChoose z=3 (=3^1). (Now we have N=4.)\n\nChoose z=4 (=2^2). (Now we have N=1.)\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0\n\nWe cannot apply the operation at all.\n\nSample Input 3\n\n64\n\nSample Output 3\n\n3\n\nWe can apply the operation three times by, for example, making the following choices:\n\nChoose z=2 (=2^1). (Now we have N=32.)\n\nChoose z=4 (=2^2). (Now we have N=8.)\n\nChoose z=8 (=2^3). (Now we have N=1.)\n\nSample Input 4\n\n1000000007\n\nSample Output 4\n\n1\n\nWe can apply the operation once by, for example, making the following choice:\n\nz=1000000007 (=1000000007^1). (Now we have N=1.)\n\nSample Input 5\n\n997764507000\n\nSample Output 5\n\n7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7026, "cpu_time_ms": 16, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s647090342", "group_id": "codeNet:p02661", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn, _ := sc.NextInt()\n\ta, b := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], _ = sc.NextInt()\n\t\tb[i], _ = sc.NextInt()\n\t}\n\tans := solve(n, a, b)\n\tfmt.Println(ans)\n}\n\nfunc solve(n int, a []int, b []int) int {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\tsort.Slice(b, func(i, j int) bool { return b[i] < b[j] })\n\tif n%2 == 0 {\n\t\tm1 := b[n/2-1] - a[n/2-1] + 1\n\t\tm2 := b[n/2] - a[n/2] + 1\n\t\treturn m1 + m2 - 1\n\t}\n\treturn b[n/2] - a[n/2] + 1\n}\n\n// Scanner is a wrapper of bufio.Scanner which is customized for competitive programing.\ntype Scanner struct {\n\tbufio.Scanner\n}\n\n// NewScanner is a constructor for Scanner.\nfunc NewScanner(r io.Reader) *Scanner {\n\tsc := Scanner{*bufio.NewScanner(r)}\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\n\treturn &sc\n}\n\n// NextInt reads a integer from io stream.\nfunc (sc *Scanner) NextInt() (int, error) {\n\tif !sc.Scan() {\n\t\treturn -1, errors.New(\"failed to scan\")\n\t}\n\treturn strconv.Atoi(sc.Text())\n}\n", "language": "Go", "metadata": {"date": 1592525137, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02661.html", "problem_id": "p02661", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02661/input.txt", "sample_output_relpath": "derived/input_output/data/p02661/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02661/Go/s647090342.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s647090342", "user_id": "u914096063"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn, _ := sc.NextInt()\n\ta, b := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], _ = sc.NextInt()\n\t\tb[i], _ = sc.NextInt()\n\t}\n\tans := solve(n, a, b)\n\tfmt.Println(ans)\n}\n\nfunc solve(n int, a []int, b []int) int {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\tsort.Slice(b, func(i, j int) bool { return b[i] < b[j] })\n\tif n%2 == 0 {\n\t\tm1 := b[n/2-1] - a[n/2-1] + 1\n\t\tm2 := b[n/2] - a[n/2] + 1\n\t\treturn m1 + m2 - 1\n\t}\n\treturn b[n/2] - a[n/2] + 1\n}\n\n// Scanner is a wrapper of bufio.Scanner which is customized for competitive programing.\ntype Scanner struct {\n\tbufio.Scanner\n}\n\n// NewScanner is a constructor for Scanner.\nfunc NewScanner(r io.Reader) *Scanner {\n\tsc := Scanner{*bufio.NewScanner(r)}\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\n\treturn &sc\n}\n\n// NextInt reads a integer from io stream.\nfunc (sc *Scanner) NextInt() (int, error) {\n\tif !sc.Scan() {\n\t\treturn -1, errors.New(\"failed to scan\")\n\t}\n\treturn strconv.Atoi(sc.Text())\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N integers X_1, X_2, \\cdots, X_N, and we know that A_i \\leq X_i \\leq B_i.\nFind the number of different values that the median of X_1, X_2, \\cdots, X_N can take.\n\nNotes\n\nThe median of X_1, X_2, \\cdots, X_N is defined as follows. Let x_1, x_2, \\cdots, x_N be the result of sorting X_1, X_2, \\cdots, X_N in ascending order.\n\nIf N is odd, the median is x_{(N+1)/2};\n\nif N is even, the median is (x_{N/2} + x_{N/2+1}) / 2.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq B_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\nA_2 B_2\n:\nA_N B_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2\n1 2\n2 3\n\nSample Output 1\n\n3\n\nIf X_1 = 1 and X_2 = 2, the median is \\frac{3}{2};\n\nif X_1 = 1 and X_2 = 3, the median is 2;\n\nif X_1 = 2 and X_2 = 2, the median is 2;\n\nif X_1 = 2 and X_2 = 3, the median is \\frac{5}{2}.\n\nThus, the median can take three values: \\frac{3}{2}, 2, and \\frac{5}{2}.\n\nSample Input 2\n\n3\n100 100\n10 10000\n1 1000000000\n\nSample Output 2\n\n9991", "sample_input": "2\n1 2\n2 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02661", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N integers X_1, X_2, \\cdots, X_N, and we know that A_i \\leq X_i \\leq B_i.\nFind the number of different values that the median of X_1, X_2, \\cdots, X_N can take.\n\nNotes\n\nThe median of X_1, X_2, \\cdots, X_N is defined as follows. Let x_1, x_2, \\cdots, x_N be the result of sorting X_1, X_2, \\cdots, X_N in ascending order.\n\nIf N is odd, the median is x_{(N+1)/2};\n\nif N is even, the median is (x_{N/2} + x_{N/2+1}) / 2.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq B_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\nA_2 B_2\n:\nA_N B_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2\n1 2\n2 3\n\nSample Output 1\n\n3\n\nIf X_1 = 1 and X_2 = 2, the median is \\frac{3}{2};\n\nif X_1 = 1 and X_2 = 3, the median is 2;\n\nif X_1 = 2 and X_2 = 2, the median is 2;\n\nif X_1 = 2 and X_2 = 3, the median is \\frac{5}{2}.\n\nThus, the median can take three values: \\frac{3}{2}, 2, and \\frac{5}{2}.\n\nSample Input 2\n\n3\n100 100\n10 10000\n1 1000000000\n\nSample Output 2\n\n9991", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1119, "cpu_time_ms": 126, "memory_kb": 8352}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s613776781", "group_id": "codeNet:p02665", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc min(nums ...int) int {\n\tret := nums[0]\n\tfor _, v := range nums {\n\t\tif v < ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn := nextInt()\n\ta := nextInts(n + 1)\n\n\tl, r := make([]int, n+1), make([]int, n+1)\n\tl[n], r[n] = a[n], a[n]\n\tfor i := n - 1; i >= 0; i-- {\n\t\tl[i] = a[i] + (l[i+1]+1)/2\n\t\tr[i] = a[i] + r[i+1]\n\t}\n\tif l[0] > 1 {\n\t\tputs(-1)\n\t\treturn\n\t}\n\n\tans, cur := 0, 1\n\tfor i := 0; i <= n; i++ {\n\t\tans += cur\n\t\tif i < n {\n\t\t\tcur = min((cur-a[i])*2, r[i+1])\n\t\t}\n\t}\n\tputs(ans)\n}\n", "language": "Go", "metadata": {"date": 1593486606, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02665.html", "problem_id": "p02665", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02665/input.txt", "sample_output_relpath": "derived/input_output/data/p02665/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02665/Go/s613776781.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s613776781", "user_id": "u502813058"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc min(nums ...int) int {\n\tret := nums[0]\n\tfor _, v := range nums {\n\t\tif v < ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn := nextInt()\n\ta := nextInts(n + 1)\n\n\tl, r := make([]int, n+1), make([]int, n+1)\n\tl[n], r[n] = a[n], a[n]\n\tfor i := n - 1; i >= 0; i-- {\n\t\tl[i] = a[i] + (l[i+1]+1)/2\n\t\tr[i] = a[i] + r[i+1]\n\t}\n\tif l[0] > 1 {\n\t\tputs(-1)\n\t\treturn\n\t}\n\n\tans, cur := 0, 1\n\tfor i := 0; i <= n; i++ {\n\t\tans += cur\n\t\tif i < n {\n\t\t\tcur = min((cur-a[i])*2, r[i+1])\n\t\t}\n\t}\n\tputs(ans)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "sample_input": "3\n0 1 1 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02665", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1084, "cpu_time_ms": 26, "memory_kb": 5136}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s881281172", "group_id": "codeNet:p02665", "input_text": "package main\n\nimport \"fmt\"\n\nfunc mini(x int64, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc main(){\n\tvar n,ans,t,temp int64\n\tfmt.Scan(&n)\n\ta := make([]int64,n+1)\n\tcapa := make([]int64,n)\n\ttemp = 1\n\tflag := true\n\t//k := 1\n\tvar i int64\n\tfor i=0 ; i= k*/{\n\t\t\tflag = false\n\t\t}\n\t\t//k *= 2\n\t}\n\tfmt.Scan(&ans)\n\tif n==0 && ans != 1{\n\t\tflag = false\n\t}\n\tp := make([]int64,n)\n\tif !flag{\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tchild := ans\n\t\tfor i=n-1 ; i>=0 ; i-- {\n\t\t\tt = child - capa[i]*2\n\t\t\tif t > 0 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttemp = mini(child,capa[i]) + a[i]\n\t\t\tans += temp\n\t\t\tchild = temp\n\t\t\tp[i] = temp\n\t\t}\n\t\tif flag {\n\t\t\tchild = 1\n\t\t\tfor i=0 ; i child {\n\t\t\t\t\tflag = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tchild = (child-a[i])*2\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tfmt.Println(ans)\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"-1\")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590940955, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02665.html", "problem_id": "p02665", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02665/input.txt", "sample_output_relpath": "derived/input_output/data/p02665/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02665/Go/s881281172.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s881281172", "user_id": "u145635628"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc mini(x int64, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc main(){\n\tvar n,ans,t,temp int64\n\tfmt.Scan(&n)\n\ta := make([]int64,n+1)\n\tcapa := make([]int64,n)\n\ttemp = 1\n\tflag := true\n\t//k := 1\n\tvar i int64\n\tfor i=0 ; i= k*/{\n\t\t\tflag = false\n\t\t}\n\t\t//k *= 2\n\t}\n\tfmt.Scan(&ans)\n\tif n==0 && ans != 1{\n\t\tflag = false\n\t}\n\tp := make([]int64,n)\n\tif !flag{\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tchild := ans\n\t\tfor i=n-1 ; i>=0 ; i-- {\n\t\t\tt = child - capa[i]*2\n\t\t\tif t > 0 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttemp = mini(child,capa[i]) + a[i]\n\t\t\tans += temp\n\t\t\tchild = temp\n\t\t\tp[i] = temp\n\t\t}\n\t\tif flag {\n\t\t\tchild = 1\n\t\t\tfor i=0 ; i child {\n\t\t\t\t\tflag = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tchild = (child-a[i])*2\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tfmt.Println(ans)\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"-1\")\n\t\t}\n\t}\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "sample_input": "3\n0 1 1 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02665", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 987, "cpu_time_ms": 673, "memory_kb": 6520}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s845963065", "group_id": "codeNet:p02665", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tA := getIntArray(N+1)\n\n\tif N == 0 {\n\t\tif A[0] == 1 {\n\t\t\tfmt.Println(1)\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t\treturn\n\t}\n\n\ttotal := 0\n\tfor _, a := range A {\n\t\ttotal += a\n\t}\n\n\tresult := 1\n\trest := 1\n\tfor i := 1; i <= N; i++ {\n\t\t//fmt.Println(\"Before: \", result, rest, total)\n\n\t\tnum := 0\n\t\tif 2 * rest <= total {\n\t\t\tnum = 2 * rest\n\t\t} else {\n\t\t\tnum = total\n\t\t}\n\n\t\tresult += num\n\t\trest = num - A[i]\n\t\ttotal -= A[i]\n\n\t\t//fmt.Println(\"After: \", result, rest, total)\n\n\t\tif rest < 0 {\n\t\t\tresult = -1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1590891025, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02665.html", "problem_id": "p02665", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02665/input.txt", "sample_output_relpath": "derived/input_output/data/p02665/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02665/Go/s845963065.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s845963065", "user_id": "u964273035"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tA := getIntArray(N+1)\n\n\tif N == 0 {\n\t\tif A[0] == 1 {\n\t\t\tfmt.Println(1)\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t\treturn\n\t}\n\n\ttotal := 0\n\tfor _, a := range A {\n\t\ttotal += a\n\t}\n\n\tresult := 1\n\trest := 1\n\tfor i := 1; i <= N; i++ {\n\t\t//fmt.Println(\"Before: \", result, rest, total)\n\n\t\tnum := 0\n\t\tif 2 * rest <= total {\n\t\t\tnum = 2 * rest\n\t\t} else {\n\t\t\tnum = total\n\t\t}\n\n\t\tresult += num\n\t\trest = num - A[i]\n\t\ttotal -= A[i]\n\n\t\t//fmt.Println(\"After: \", result, rest, total)\n\n\t\tif rest < 0 {\n\t\t\tresult = -1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "sample_input": "3\n0 1 1 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02665", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven is an integer sequence of length N+1: A_0, A_1, A_2, \\ldots, A_N. Is there a binary tree of depth N such that, for each d = 0, 1, \\ldots, N, there are exactly A_d leaves at depth d? If such a tree exists, print the maximum possible number of vertices in such a tree; otherwise, print -1.\n\nNotes\n\nA binary tree is a rooted tree such that each vertex has at most two direct children.\n\nA leaf in a binary tree is a vertex with zero children.\n\nThe depth of a vertex v in a binary tree is the distance from the tree's root to v. (The root has the depth of 0.)\n\nThe depth of a binary tree is the maximum depth of a vertex in the tree.\n\nConstraints\n\n0 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^{8} (0 \\leq i \\leq N)\n\nA_N \\geq 1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_0 A_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n3\n0 1 1 2\n\nSample Output 1\n\n7\n\nBelow is the tree with the maximum possible number of vertices. It has seven vertices, so we should print 7.\n\nSample Input 2\n\n4\n0 0 1 0 2\n\nSample Output 2\n\n10\n\nSample Input 3\n\n2\n0 3 1\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n1\n1 1\n\nSample Output 4\n\n-1\n\nSample Input 5\n\n10\n0 0 1 1 2 3 5 8 13 21 34\n\nSample Output 5\n\n264", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6257, "cpu_time_ms": 21, "memory_kb": 3396}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s304026991", "group_id": "codeNet:p02669", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nconst inf = math.MaxInt64\nconst size = 100000000\n\nvar a, b, c, d int\nvar dp map[int]int\n\nfunc solve(n int) int {\n\tif n == 0 {\n\t\treturn 0\n\t}\n\tif n == 1 {\n\t\treturn d\n\t}\n\t// out(n)\n\tif dp[n] != 0 {\n\t\treturn dp[n]\n\t}\n\t// out(n)\n\tvar r, x int\n\tr = n % 5\n\tx = n - r\n\tret := solve(x/5) + c + d*r\n\tif x != n && x != 0 {\n\t\tx += 5\n\t\tret = min(ret, solve(x/5)+c+(5-r)*d)\n\t}\n\n\tr = n % 3\n\tx = n - r\n\tret = min(ret, solve(x/3)+b+d*r)\n\tif x != n && x != 0 {\n\t\tx += 3\n\t\tret = min(ret, solve(x/3)+b+(3-r)*d)\n\t}\n\tr = n % 2\n\tx = n - r\n\tret = min(ret, solve(x/2)+a+d*r)\n\tif x != n && x != 0 {\n\t\tx += 2\n\t\tret = min(ret, solve(x/2)+a+(2-r)*d)\n\t}\n\n\tif n*d/d == n {\n\t\tret = min(ret, n*d)\n\t}\n\tdp[n] = ret\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tT := getInt()\n\tfor i := 0; i < T; i++ {\n\t\tn := getInt()\n\t\ta, b, c, d = getInt(), getInt(), getInt(), getInt()\n\t\tdp = make(map[int]int)\n\t\tout(solve(n))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592964057, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02669.html", "problem_id": "p02669", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02669/input.txt", "sample_output_relpath": "derived/input_output/data/p02669/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02669/Go/s304026991.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304026991", "user_id": "u814575783"}, "prompt_components": {"gold_output": "20\n19\n26\n3821859835\n23441258666\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nconst inf = math.MaxInt64\nconst size = 100000000\n\nvar a, b, c, d int\nvar dp map[int]int\n\nfunc solve(n int) int {\n\tif n == 0 {\n\t\treturn 0\n\t}\n\tif n == 1 {\n\t\treturn d\n\t}\n\t// out(n)\n\tif dp[n] != 0 {\n\t\treturn dp[n]\n\t}\n\t// out(n)\n\tvar r, x int\n\tr = n % 5\n\tx = n - r\n\tret := solve(x/5) + c + d*r\n\tif x != n && x != 0 {\n\t\tx += 5\n\t\tret = min(ret, solve(x/5)+c+(5-r)*d)\n\t}\n\n\tr = n % 3\n\tx = n - r\n\tret = min(ret, solve(x/3)+b+d*r)\n\tif x != n && x != 0 {\n\t\tx += 3\n\t\tret = min(ret, solve(x/3)+b+(3-r)*d)\n\t}\n\tr = n % 2\n\tx = n - r\n\tret = min(ret, solve(x/2)+a+d*r)\n\tif x != n && x != 0 {\n\t\tx += 2\n\t\tret = min(ret, solve(x/2)+a+(2-r)*d)\n\t}\n\n\tif n*d/d == n {\n\t\tret = min(ret, n*d)\n\t}\n\tdp[n] = ret\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tT := getInt()\n\tfor i := 0; i < T; i++ {\n\t\tn := getInt()\n\t\ta, b, c, d = getInt(), getInt(), getInt(), getInt()\n\t\tdp = make(map[int]int)\n\t\tout(solve(n))\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou start with the number 0 and you want to reach the number N.\n\nYou can change the number, paying a certain amount of coins, with the following operations:\n\nMultiply the number by 2, paying A coins.\n\nMultiply the number by 3, paying B coins.\n\nMultiply the number by 5, paying C coins.\n\nIncrease or decrease the number by 1, paying D coins.\n\nYou can perform these operations in arbitrary order and an arbitrary number of times.\n\nWhat is the minimum number of coins you need to reach N?\n\nYou have to solve T testcases.\n\nConstraints\n\n1 \\le T \\le 10\n\n1 \\le N \\le 10^{18}\n\n1 \\le A, B, C, D \\le 10^9\n\nAll numbers N, A, B, C, D are integers.\n\nInput\n\nThe input is given from Standard Input. The first line of the input is\n\nT\n\nThen, T lines follow describing the T testcases.\nEach of the T lines has the format\n\nN A B C D\n\nOutput\n\nFor each testcase, print the answer on Standard Output followed by a newline.\n\nSample Input 1\n\n5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n\nSample Output 1\n\n20\n19\n26\n3821859835\n23441258666\n\nFor the first testcase, a sequence of moves that achieves the minimum cost of 20 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 1 to multiply by 2 (x = 4).\n\nPay 2 to multiply by 3 (x = 12).\n\nPay 8 to decrease by 1 (x = 11).\n\nFor the second testcase, a sequence of moves that achieves the minimum cost of 19 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 2 to multiply by 5 (x = 10).\n\nPay 8 to increase by 1 (x = 11).", "sample_input": "5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n"}, "reference_outputs": ["20\n19\n26\n3821859835\n23441258666\n"], "source_document_id": "p02669", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou start with the number 0 and you want to reach the number N.\n\nYou can change the number, paying a certain amount of coins, with the following operations:\n\nMultiply the number by 2, paying A coins.\n\nMultiply the number by 3, paying B coins.\n\nMultiply the number by 5, paying C coins.\n\nIncrease or decrease the number by 1, paying D coins.\n\nYou can perform these operations in arbitrary order and an arbitrary number of times.\n\nWhat is the minimum number of coins you need to reach N?\n\nYou have to solve T testcases.\n\nConstraints\n\n1 \\le T \\le 10\n\n1 \\le N \\le 10^{18}\n\n1 \\le A, B, C, D \\le 10^9\n\nAll numbers N, A, B, C, D are integers.\n\nInput\n\nThe input is given from Standard Input. The first line of the input is\n\nT\n\nThen, T lines follow describing the T testcases.\nEach of the T lines has the format\n\nN A B C D\n\nOutput\n\nFor each testcase, print the answer on Standard Output followed by a newline.\n\nSample Input 1\n\n5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n\nSample Output 1\n\n20\n19\n26\n3821859835\n23441258666\n\nFor the first testcase, a sequence of moves that achieves the minimum cost of 20 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 1 to multiply by 2 (x = 4).\n\nPay 2 to multiply by 3 (x = 12).\n\nPay 8 to decrease by 1 (x = 11).\n\nFor the second testcase, a sequence of moves that achieves the minimum cost of 19 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 2 to multiply by 5 (x = 10).\n\nPay 8 to increase by 1 (x = 11).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1885, "cpu_time_ms": 51, "memory_kb": 6424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s113448522", "group_id": "codeNet:p02669", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nvar memo map[int]int\n\nvar A, B, C, D int\n\nfunc solve(N int) int {\n\tif N == 0 {\n\t\treturn 0\n\t}\n\tif N == 1 {\n\t\treturn D\n\t}\n\tif v, ok := memo[N]; ok {\n\t\t// log.Println(N, v, ok)\n\t\treturn v\n\t}\n\tl2 := (N / 2) * 2\n\tr2 := ((N + 1) / 2) * 2\n\tl3 := (N / 3) * 3\n\tr3 := ((N + 2) / 3) * 3\n\tl5 := (N / 5) * 5\n\tr5 := ((N + 4) / 5) * 5\n\tres := int(1e18)\n\tif N < res/D {\n\t\tres = N * D\n\t}\n\tres = min(res, abs(l2-N)*D+A+solve(l2/2))\n\tres = min(res, abs(r2-N)*D+A+solve(r2/2))\n\tres = min(res, abs(l3-N)*D+B+solve(l3/3))\n\tres = min(res, abs(r3-N)*D+B+solve(r3/3))\n\tres = min(res, abs(l5-N)*D+C+solve(l5/5))\n\tres = min(res, abs(r5-N)*D+C+solve(r5/5))\n\tmemo[N] = res\n\treturn res\n}\n\nfunc main() {\n\tT := nextInt()\n\tfor i := 0; i < T; i++ {\n\t\tmemo = map[int]int{}\n\t\tN := nextInt()\n\t\tA = nextInt()\n\t\tB = nextInt()\n\t\tC = nextInt()\n\t\tD = nextInt()\n\t\tfmt.Println(solve(N))\n\t}\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1590356565, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02669.html", "problem_id": "p02669", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02669/input.txt", "sample_output_relpath": "derived/input_output/data/p02669/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02669/Go/s113448522.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s113448522", "user_id": "u696272993"}, "prompt_components": {"gold_output": "20\n19\n26\n3821859835\n23441258666\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nvar memo map[int]int\n\nvar A, B, C, D int\n\nfunc solve(N int) int {\n\tif N == 0 {\n\t\treturn 0\n\t}\n\tif N == 1 {\n\t\treturn D\n\t}\n\tif v, ok := memo[N]; ok {\n\t\t// log.Println(N, v, ok)\n\t\treturn v\n\t}\n\tl2 := (N / 2) * 2\n\tr2 := ((N + 1) / 2) * 2\n\tl3 := (N / 3) * 3\n\tr3 := ((N + 2) / 3) * 3\n\tl5 := (N / 5) * 5\n\tr5 := ((N + 4) / 5) * 5\n\tres := int(1e18)\n\tif N < res/D {\n\t\tres = N * D\n\t}\n\tres = min(res, abs(l2-N)*D+A+solve(l2/2))\n\tres = min(res, abs(r2-N)*D+A+solve(r2/2))\n\tres = min(res, abs(l3-N)*D+B+solve(l3/3))\n\tres = min(res, abs(r3-N)*D+B+solve(r3/3))\n\tres = min(res, abs(l5-N)*D+C+solve(l5/5))\n\tres = min(res, abs(r5-N)*D+C+solve(r5/5))\n\tmemo[N] = res\n\treturn res\n}\n\nfunc main() {\n\tT := nextInt()\n\tfor i := 0; i < T; i++ {\n\t\tmemo = map[int]int{}\n\t\tN := nextInt()\n\t\tA = nextInt()\n\t\tB = nextInt()\n\t\tC = nextInt()\n\t\tD = nextInt()\n\t\tfmt.Println(solve(N))\n\t}\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou start with the number 0 and you want to reach the number N.\n\nYou can change the number, paying a certain amount of coins, with the following operations:\n\nMultiply the number by 2, paying A coins.\n\nMultiply the number by 3, paying B coins.\n\nMultiply the number by 5, paying C coins.\n\nIncrease or decrease the number by 1, paying D coins.\n\nYou can perform these operations in arbitrary order and an arbitrary number of times.\n\nWhat is the minimum number of coins you need to reach N?\n\nYou have to solve T testcases.\n\nConstraints\n\n1 \\le T \\le 10\n\n1 \\le N \\le 10^{18}\n\n1 \\le A, B, C, D \\le 10^9\n\nAll numbers N, A, B, C, D are integers.\n\nInput\n\nThe input is given from Standard Input. The first line of the input is\n\nT\n\nThen, T lines follow describing the T testcases.\nEach of the T lines has the format\n\nN A B C D\n\nOutput\n\nFor each testcase, print the answer on Standard Output followed by a newline.\n\nSample Input 1\n\n5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n\nSample Output 1\n\n20\n19\n26\n3821859835\n23441258666\n\nFor the first testcase, a sequence of moves that achieves the minimum cost of 20 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 1 to multiply by 2 (x = 4).\n\nPay 2 to multiply by 3 (x = 12).\n\nPay 8 to decrease by 1 (x = 11).\n\nFor the second testcase, a sequence of moves that achieves the minimum cost of 19 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 2 to multiply by 5 (x = 10).\n\nPay 8 to increase by 1 (x = 11).", "sample_input": "5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n"}, "reference_outputs": ["20\n19\n26\n3821859835\n23441258666\n"], "source_document_id": "p02669", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou start with the number 0 and you want to reach the number N.\n\nYou can change the number, paying a certain amount of coins, with the following operations:\n\nMultiply the number by 2, paying A coins.\n\nMultiply the number by 3, paying B coins.\n\nMultiply the number by 5, paying C coins.\n\nIncrease or decrease the number by 1, paying D coins.\n\nYou can perform these operations in arbitrary order and an arbitrary number of times.\n\nWhat is the minimum number of coins you need to reach N?\n\nYou have to solve T testcases.\n\nConstraints\n\n1 \\le T \\le 10\n\n1 \\le N \\le 10^{18}\n\n1 \\le A, B, C, D \\le 10^9\n\nAll numbers N, A, B, C, D are integers.\n\nInput\n\nThe input is given from Standard Input. The first line of the input is\n\nT\n\nThen, T lines follow describing the T testcases.\nEach of the T lines has the format\n\nN A B C D\n\nOutput\n\nFor each testcase, print the answer on Standard Output followed by a newline.\n\nSample Input 1\n\n5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n\nSample Output 1\n\n20\n19\n26\n3821859835\n23441258666\n\nFor the first testcase, a sequence of moves that achieves the minimum cost of 20 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 1 to multiply by 2 (x = 4).\n\nPay 2 to multiply by 3 (x = 12).\n\nPay 8 to decrease by 1 (x = 11).\n\nFor the second testcase, a sequence of moves that achieves the minimum cost of 19 is:\n\nInitially x = 0.\n\nPay 8 to increase by 1 (x = 1).\n\nPay 1 to multiply by 2 (x = 2).\n\nPay 2 to multiply by 5 (x = 10).\n\nPay 8 to increase by 1 (x = 11).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2454, "cpu_time_ms": 48, "memory_kb": 6392}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s286131179", "group_id": "codeNet:p02675", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar N, ans int;\n\tfmt.Scan(&N);\n\n\tif N < 10 {\n\t\tans = N;\n\t}else if N < 100{\n\t\tans = N % 10;\n\t}else {\n\t\tans = N % 100;\n\t\tans = ans % 10;\n\t}\n\tif ans == 3 {\n\t\tfmt.Println(\"bon\");\n\t}else if ans == 0 || ans == 1 || ans == 6 || ans == 8{\n\t\tfmt.Println(\"pon\");\n\t}else{\n\t\tfmt.Println(\"hon\");\n\t}\n\t// fmt.Println(ans);\n}", "language": "Go", "metadata": {"date": 1589764404, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02675.html", "problem_id": "p02675", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02675/input.txt", "sample_output_relpath": "derived/input_output/data/p02675/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02675/Go/s286131179.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s286131179", "user_id": "u283295031"}, "prompt_components": {"gold_output": "pon\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar N, ans int;\n\tfmt.Scan(&N);\n\n\tif N < 10 {\n\t\tans = N;\n\t}else if N < 100{\n\t\tans = N % 10;\n\t}else {\n\t\tans = N % 100;\n\t\tans = ans % 10;\n\t}\n\tif ans == 3 {\n\t\tfmt.Println(\"bon\");\n\t}else if ans == 0 || ans == 1 || ans == 6 || ans == 8{\n\t\tfmt.Println(\"pon\");\n\t}else{\n\t\tfmt.Println(\"hon\");\n\t}\n\t// fmt.Println(ans);\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "sample_input": "16\n"}, "reference_outputs": ["pon\n"], "source_document_id": "p02675", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 351, "cpu_time_ms": 6, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s233390086", "group_id": "codeNet:p02676", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&k)\n\tvar s string\n\tfmt.Scan(&s)\n\tif len(s) > k {\n\t\tfmt.Print(s[:k])\n\t\tfmt.Print(\"...\")\n\t} else {\n\t\tfmt.Print(s)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592103233, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02676/input.txt", "sample_output_relpath": "derived/input_output/data/p02676/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02676/Go/s233390086.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s233390086", "user_id": "u770423799"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&k)\n\tvar s string\n\tfmt.Scan(&s)\n\tif len(s) > k {\n\t\tfmt.Print(s[:k])\n\t\tfmt.Print(\"...\")\n\t} else {\n\t\tfmt.Print(s)\n\t}\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "sample_input": "7\nnikoandsolstice\n"}, "reference_outputs": ["nikoand...\n"], "source_document_id": "p02676", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s735424900", "group_id": "codeNet:p02676", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar K int;\n\tvar S string;\n\n\tfmt.Scan(&K, &S);\n\n\tif len(S) < K {\n\t\tfmt.Println(S);\n\t}else{\n\t\tfmt.Println(S[:K]+\"...\");\n\t}\n\n}", "language": "Go", "metadata": {"date": 1589764990, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02676/input.txt", "sample_output_relpath": "derived/input_output/data/p02676/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02676/Go/s735424900.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s735424900", "user_id": "u283295031"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar K int;\n\tvar S string;\n\n\tfmt.Scan(&K, &S);\n\n\tif len(S) < K {\n\t\tfmt.Println(S);\n\t}else{\n\t\tfmt.Println(S[:K]+\"...\");\n\t}\n\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "sample_input": "7\nnikoandsolstice\n"}, "reference_outputs": ["nikoand...\n"], "source_document_id": "p02676", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 165, "cpu_time_ms": 2, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s006032362", "group_id": "codeNet:p02676", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&k)\n\tvar bs []byte\n\tfmt.Scan(&bs)\n\tfmt.Print(string(bs[0:min(k, len(bs))]))\n\tif len(bs) > k {\n\t\tfmt.Print(\"...\")\n\t}\n\tfmt.Println()\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1589764720, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02676.html", "problem_id": "p02676", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02676/input.txt", "sample_output_relpath": "derived/input_output/data/p02676/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02676/Go/s006032362.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s006032362", "user_id": "u282164747"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&k)\n\tvar bs []byte\n\tfmt.Scan(&bs)\n\tfmt.Print(string(bs[0:min(k, len(bs))]))\n\tif len(bs) > k {\n\t\tfmt.Print(\"...\")\n\t}\n\tfmt.Println()\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "sample_input": "7\nnikoandsolstice\n"}, "reference_outputs": ["nikoand...\n"], "source_document_id": "p02676", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have a string S consisting of lowercase English letters.\n\nIf the length of S is at most K, print S without change.\n\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.\n\nConstraints\n\nK is an integer between 1 and 100 (inclusive).\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nS\n\nOutput\n\nPrint a string as stated in Problem Statement.\n\nSample Input 1\n\n7\nnikoandsolstice\n\nSample Output 1\n\nnikoand...\n\nnikoandsolstice has a length of 15, which exceeds K=7.\n\nWe should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....\n\nSample Input 2\n\n40\nferelibenterhominesidquodvoluntcredunt\n\nSample Output 2\n\nferelibenterhominesidquodvoluntcredunt\n\nThe famous quote from Gaius Julius Caesar.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 391, "cpu_time_ms": 2, "memory_kb": 1816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s662626547", "group_id": "codeNet:p02678", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\n//Edge is\ntype Edge struct {\n\tnode *Node\n\tBridge *Bridge\n}\n\n//Node is\ntype Node struct {\n\tid int\n\tedges []*Edge\n\tpreid int\n}\n\n//Bridge is\ntype Bridge struct {\n\tedges [2]Edge\n}\n\n//NewBridge is\nfunc NewBridge(a, b *Node) (bridge *Bridge) {\n\tbridge = &Bridge{}\n\tbridge.edges = [...]Edge{{node: a, Bridge: bridge}, {node: b, Bridge: bridge}}\n\ta.edges = append(a.edges, &bridge.edges[1])\n\tb.edges = append(b.edges, &bridge.edges[0])\n\treturn\n}\n\n//Another is\nfunc (edge *Edge) Another() (another *Edge) {\n\tBridge := edge.Bridge\n\tif &Bridge.edges[0] == edge {\n\t\tanother = &Bridge.edges[1]\n\t} else {\n\t\tanother = &Bridge.edges[0]\n\t}\n\treturn\n}\n\nfunc nodeRead() {\n\t// for i := 1; i <= n; i++ {\n\t// \tnodes[i] = Node{id: i}\n\t// }\n\n\t// for i, end := 1, n-1; i <= end; i++ {\n\t// \tr.Scan(true)\n\t// \tNewBridge(&nodes[r.nextInt()], &nodes[r.nextInt()])\n\t// }\n\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn, m := r.nextInt(), r.nextInt()\n\n\tnodes := make([]*Node, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tnodes[i] = &Node{id: i, preid: -1}\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tr.Scan(true)\n\t\ta, b := r.nextInt(), r.nextInt()\n\t\tNewBridge(nodes[a], nodes[b])\n\t}\n\n\ttype stackInfo struct {\n\t\tnode *Node\n\t}\n\tstack := make([]*stackInfo, 0, n)\n\tnodes[1].preid = 0\n\tstack = append(stack, &stackInfo{node: nodes[1]})\n\tfor len(stack) > 0 {\n\t\tcur := stack[len(stack)-1]\n\t\tstack = stack[:len(stack)-1]\n\n\t\tfor _, neither := range cur.node.edges {\n\t\t\tif neither.node.preid < 0 {\n\t\t\t\tneither.node.preid = cur.node.id\n\t\t\t\tstack = append(stack, &stackInfo{node: neither.node})\n\t\t\t}\n\t\t}\n\t}\n\tans := \"Yes\"\n\tfor i := 2; i <= n; i++ {\n\t\tif nodes[i].preid <= 0 {\n\t\t\tans = \"No\"\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, ans)\n\tfor i := 2; i <= n; i++ {\n\t\tfmt.Fprintln(stdout, nodes[i].preid)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593971327, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02678.html", "problem_id": "p02678", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02678/input.txt", "sample_output_relpath": "derived/input_output/data/p02678/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02678/Go/s662626547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s662626547", "user_id": "u463655976"}, "prompt_components": {"gold_output": "Yes\n1\n2\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\n//Edge is\ntype Edge struct {\n\tnode *Node\n\tBridge *Bridge\n}\n\n//Node is\ntype Node struct {\n\tid int\n\tedges []*Edge\n\tpreid int\n}\n\n//Bridge is\ntype Bridge struct {\n\tedges [2]Edge\n}\n\n//NewBridge is\nfunc NewBridge(a, b *Node) (bridge *Bridge) {\n\tbridge = &Bridge{}\n\tbridge.edges = [...]Edge{{node: a, Bridge: bridge}, {node: b, Bridge: bridge}}\n\ta.edges = append(a.edges, &bridge.edges[1])\n\tb.edges = append(b.edges, &bridge.edges[0])\n\treturn\n}\n\n//Another is\nfunc (edge *Edge) Another() (another *Edge) {\n\tBridge := edge.Bridge\n\tif &Bridge.edges[0] == edge {\n\t\tanother = &Bridge.edges[1]\n\t} else {\n\t\tanother = &Bridge.edges[0]\n\t}\n\treturn\n}\n\nfunc nodeRead() {\n\t// for i := 1; i <= n; i++ {\n\t// \tnodes[i] = Node{id: i}\n\t// }\n\n\t// for i, end := 1, n-1; i <= end; i++ {\n\t// \tr.Scan(true)\n\t// \tNewBridge(&nodes[r.nextInt()], &nodes[r.nextInt()])\n\t// }\n\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn, m := r.nextInt(), r.nextInt()\n\n\tnodes := make([]*Node, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tnodes[i] = &Node{id: i, preid: -1}\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tr.Scan(true)\n\t\ta, b := r.nextInt(), r.nextInt()\n\t\tNewBridge(nodes[a], nodes[b])\n\t}\n\n\ttype stackInfo struct {\n\t\tnode *Node\n\t}\n\tstack := make([]*stackInfo, 0, n)\n\tnodes[1].preid = 0\n\tstack = append(stack, &stackInfo{node: nodes[1]})\n\tfor len(stack) > 0 {\n\t\tcur := stack[len(stack)-1]\n\t\tstack = stack[:len(stack)-1]\n\n\t\tfor _, neither := range cur.node.edges {\n\t\t\tif neither.node.preid < 0 {\n\t\t\t\tneither.node.preid = cur.node.id\n\t\t\t\tstack = append(stack, &stackInfo{node: neither.node})\n\t\t\t}\n\t\t}\n\t}\n\tans := \"Yes\"\n\tfor i := 2; i <= n; i++ {\n\t\tif nodes[i].preid <= 0 {\n\t\t\tans = \"No\"\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, ans)\n\tfor i := 2; i <= n; i++ {\n\t\tfmt.Fprintln(stdout, nodes[i].preid)\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "sample_input": "4 4\n1 2\n2 3\n3 4\n4 2\n"}, "reference_outputs": ["Yes\n1\n2\n2\n"], "source_document_id": "p02678", "source_text": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4355, "cpu_time_ms": 398, "memory_kb": 30160}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s838694976", "group_id": "codeNet:p02678", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tvar node [][]int = make([][]int, m)\n\tfor i := range node {\n\t\tnode[i] = make([]int, 0, n)\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\tnode[a-1] = append(node[a-1], b-1)\n\t\tnode[b-1] = append(node[b-1], a-1)\n\t}\n\tq := []int{0}\n\tans := make([]int, n)\n\tfor i := range ans {\n\t\tans[i] = -1\n\t}\n\tfor len(q) > 0 {\n\t\tlist := q\n\t\tq = []int{}\n\t\tfor _, x := range list {\n\t\t\tfor _, dist := range node[x] {\n\t\t\t\tif ans[dist] == -1 {\n\t\t\t\t\tans[dist] = x\n\t\t\t\t\tq = append(q, dist)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n\tfor _, a := range ans[1:] {\n\t\tfmt.Println(a + 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590260170, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02678.html", "problem_id": "p02678", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02678/input.txt", "sample_output_relpath": "derived/input_output/data/p02678/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02678/Go/s838694976.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s838694976", "user_id": "u130295323"}, "prompt_components": {"gold_output": "Yes\n1\n2\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tvar node [][]int = make([][]int, m)\n\tfor i := range node {\n\t\tnode[i] = make([]int, 0, n)\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\tnode[a-1] = append(node[a-1], b-1)\n\t\tnode[b-1] = append(node[b-1], a-1)\n\t}\n\tq := []int{0}\n\tans := make([]int, n)\n\tfor i := range ans {\n\t\tans[i] = -1\n\t}\n\tfor len(q) > 0 {\n\t\tlist := q\n\t\tq = []int{}\n\t\tfor _, x := range list {\n\t\t\tfor _, dist := range node[x] {\n\t\t\t\tif ans[dist] == -1 {\n\t\t\t\t\tans[dist] = x\n\t\t\t\t\tq = append(q, dist)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n\tfor _, a := range ans[1:] {\n\t\tfmt.Println(a + 1)\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "sample_input": "4 4\n1 2\n2 3\n3 4\n4 2\n"}, "reference_outputs": ["Yes\n1\n2\n2\n"], "source_document_id": "p02678", "source_text": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 653, "cpu_time_ms": 2320, "memory_kb": 3377184}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s970721879", "group_id": "codeNet:p02678", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\n\tg := NewGraph(N)\n\tfor i := 0; i < M; i++ {\n\t\tA := getInt() - 1\n\t\tB := getInt() - 1\n\t\tg.AddEdge(A, B)\n\t}\n\n\tbfs(0, g)\n\n\t//fmt.Println(g.distances)\n\t//fmt.Println(g.directions)\n\n\tfmt.Println(\"Yes\")\n\tfor i := 1; i < N; i++ {\n\t\tfmt.Println(g.directions[i] + 1)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n\tdistances []int\n\tdirections []int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t\tdistances: make([]int, n),\n\t\tdirections: make([]int, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\t\t\tif graph.distances[v] == 0 || graph.distances[u] + 1 < graph.distances[v] {\n\t\t\t\tgraph.distances[v] = graph.distances[u] + 1\n\t\t\t\tgraph.directions[v] = u\n\t\t\t}\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n%2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x%y)\n\t} else {\n\t\treturn calcGcd(x, y%x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod-2)\n\tfactNKR := powMod(factNK, mod-2)\n\treturn calcMod(factN * calcMod(factKR*factNKR))\n}\n\nfunc primeFactors(n int) []int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i*i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1589766420, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02678.html", "problem_id": "p02678", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02678/input.txt", "sample_output_relpath": "derived/input_output/data/p02678/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02678/Go/s970721879.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s970721879", "user_id": "u964273035"}, "prompt_components": {"gold_output": "Yes\n1\n2\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\n\tg := NewGraph(N)\n\tfor i := 0; i < M; i++ {\n\t\tA := getInt() - 1\n\t\tB := getInt() - 1\n\t\tg.AddEdge(A, B)\n\t}\n\n\tbfs(0, g)\n\n\t//fmt.Println(g.distances)\n\t//fmt.Println(g.directions)\n\n\tfmt.Println(\"Yes\")\n\tfor i := 1; i < N; i++ {\n\t\tfmt.Println(g.directions[i] + 1)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n\tdistances []int\n\tdirections []int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t\tdistances: make([]int, n),\n\t\tdirections: make([]int, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\t\t\tif graph.distances[v] == 0 || graph.distances[u] + 1 < graph.distances[v] {\n\t\t\t\tgraph.distances[v] = graph.distances[u] + 1\n\t\t\t\tgraph.directions[v] = u\n\t\t\t}\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n%2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x%y)\n\t} else {\n\t\treturn calcGcd(x, y%x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod-2)\n\tfactNKR := powMod(factNK, mod-2)\n\treturn calcMod(factN * calcMod(factKR*factNKR))\n}\n\nfunc primeFactors(n int) []int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i*i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "sample_input": "4 4\n1 2\n2 3\n3 4\n4 2\n"}, "reference_outputs": ["Yes\n1\n2\n2\n"], "source_document_id": "p02678", "source_text": "Score: 400 points\n\nProblem Statement\n\nThere is a cave.\n\nThe cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.\n\nIt is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.\n\nSince it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.\n\nIf you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.\n\nDetermine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq N\\ (1 \\leq i \\leq M)\n\nA_i \\neq B_i\\ (1 \\leq i \\leq M)\n\nOne can travel between any two rooms by traversing passages.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf there is no way to place signposts satisfying the objective, print No.\n\nOtherwise, print N lines. The first line should contain Yes, and the i-th line (2 \\leq i \\leq N) should contain the integer representing the room indicated by the signpost in Room i.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 2\n\nSample Output 1\n\nYes\n1\n2\n2\n\nIf we place the signposts as described in the sample output, the following happens:\n\nStarting in Room 2, you will reach Room 1 after traversing one passage: (2) \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 3, you will reach Room 1 after traversing two passages: (3) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nStarting in Room 4, you will reach Room 1 after traversing two passages: (4) \\to 2 \\to 1. This is the minimum number of passages possible.\n\nThus, the objective is satisfied.\n\nSample Input 2\n\n6 9\n3 4\n6 1\n2 4\n5 3\n4 6\n1 5\n6 2\n4 5\n5 6\n\nSample Output 2\n\nYes\n6\n5\n5\n1\n1\n\nIf there are multiple solutions, any of them will be accepted.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6123, "cpu_time_ms": 2210, "memory_kb": 194368}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s859416640", "group_id": "codeNet:p02681", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tS := scanner.Text()\n\tscanner.Scan()\n\tT := scanner.Text()\n\n\tif len(S)+1 == len(T) && S[:] == T[:len(S)] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1595280268, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02681/input.txt", "sample_output_relpath": "derived/input_output/data/p02681/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02681/Go/s859416640.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s859416640", "user_id": "u785064577"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tS := scanner.Text()\n\tscanner.Scan()\n\tT := scanner.Text()\n\n\tif len(S)+1 == len(T) && S[:] == T[:len(S)] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "sample_input": "chokudai\nchokudaiz\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02681", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 280, "cpu_time_ms": 3, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s452214990", "group_id": "codeNet:p02681", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tS := readString()\n\tT := readString()\n\tif T == S+string(T[len(T)-1]) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1589650339, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02681/input.txt", "sample_output_relpath": "derived/input_output/data/p02681/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02681/Go/s452214990.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s452214990", "user_id": "u967669872"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tS := readString()\n\tT := readString()\n\tif T == S+string(T[len(T)-1]) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "sample_input": "chokudai\nchokudaiz\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02681", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5688, "cpu_time_ms": 3, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s830442903", "group_id": "codeNet:p02681", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S)\n\tfmt.Scan(&T)\n\tif len(S)+1 == len(T) && S == T[:len(T)-1] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589160098, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02681/input.txt", "sample_output_relpath": "derived/input_output/data/p02681/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02681/Go/s830442903.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s830442903", "user_id": "u104108026"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S)\n\tfmt.Scan(&T)\n\tif len(S)+1 == len(T) && S == T[:len(T)-1] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "sample_input": "chokudai\nchokudaiz\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02681", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 189, "cpu_time_ms": 5, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s689320834", "group_id": "codeNet:p02681", "input_text": "package main\n\nimport(\n\"fmt\"\n)\n\nfunc main() {\n var s string\n var t string\n fmt.Scan(&s,&t)\n \n length := len(s)\n if s[0:length] == t[0:len(t)-1] {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1589160095, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02681/input.txt", "sample_output_relpath": "derived/input_output/data/p02681/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02681/Go/s689320834.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s689320834", "user_id": "u905276896"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport(\n\"fmt\"\n)\n\nfunc main() {\n var s string\n var t string\n fmt.Scan(&s,&t)\n \n length := len(s)\n if s[0:length] == t[0:len(t)-1] {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "sample_input": "chokudai\nchokudaiz\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02681", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 209, "cpu_time_ms": 8, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s007567808", "group_id": "codeNet:p02682", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar A,B,C,K int\n\tfmt.Scan(&A,&B,&C,&K)\n if A >= K {\n fmt.Println(K)\n return\n } else if(A+B >= K) {\n fmt.Println(A)\n return\n }else if(A+B+C >= K) {\n fmt.Println(A - (K - A - B))\n return\n }\n\n}\n", "language": "Go", "metadata": {"date": 1589640171, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/Go/s007567808.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s007567808", "user_id": "u398639240"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar A,B,C,K int\n\tfmt.Scan(&A,&B,&C,&K)\n if A >= K {\n fmt.Println(K)\n return\n } else if(A+B >= K) {\n fmt.Println(A)\n return\n }else if(A+B+C >= K) {\n fmt.Println(A - (K - A - B))\n return\n }\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 292, "cpu_time_ms": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s632431820", "group_id": "codeNet:p02682", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tparams := strings.Split(scanner.Text(), \" \")\n\tparamA, _ := strconv.Atoi(params[0])\n\tparamB, _ := strconv.Atoi(params[1])\n\tparamC, _ := strconv.Atoi(params[2])\n\tparamK, _ := strconv.Atoi(params[3])\n\tresult := math.Min(float64(paramA), float64(paramK))\n\tparamK -= paramA\n\tparamK -= paramB\n\tif paramK > 0 {\n\t\tresult -= math.Min(float64(paramC), float64(paramK))\n\t}\n\tprint(result)\n}\n", "language": "Go", "metadata": {"date": 1589200525, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/Go/s632431820.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s632431820", "user_id": "u689701565"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tparams := strings.Split(scanner.Text(), \" \")\n\tparamA, _ := strconv.Atoi(params[0])\n\tparamB, _ := strconv.Atoi(params[1])\n\tparamC, _ := strconv.Atoi(params[2])\n\tparamK, _ := strconv.Atoi(params[3])\n\tresult := math.Min(float64(paramA), float64(paramK))\n\tparamK -= paramA\n\tparamK -= paramB\n\tif paramK > 0 {\n\t\tresult -= math.Min(float64(paramC), float64(paramK))\n\t}\n\tprint(result)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 520, "cpu_time_ms": 3, "memory_kb": 1452}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s914030495", "group_id": "codeNet:p02682", "input_text": "package main\n \nimport \"fmt\"\n \nfunc main() {\n var a,b,c,k int\n fmt.Scan(&a,&b,&c,&k)\n switch {\n case a >= k:\n fmt.Println(k)\n case a+b >= k && a < k:\n fmt.Println(a)\n case k > a+b:\n fmt.Println(a-(k-a-b))\n }\n}", "language": "Go", "metadata": {"date": 1589160253, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/Go/s914030495.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s914030495", "user_id": "u167292194"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n \nimport \"fmt\"\n \nfunc main() {\n var a,b,c,k int\n fmt.Scan(&a,&b,&c,&k)\n switch {\n case a >= k:\n fmt.Println(k)\n case a+b >= k && a < k:\n fmt.Println(a)\n case k > a+b:\n fmt.Println(a-(k-a-b))\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 230, "cpu_time_ms": 6, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s491878021", "group_id": "codeNet:p02682", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\ta := readi() // 1\n\tb := readi() // 0\n\t_ = readi() // -1\n\tk := readi()\n\tif a + b >= k {\n\t\tfmt.Println(a)\n\t\treturn\n\t} else {\n\t\tfmt.Println(a - (k-(a+b)))\n\t}\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\n\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1589159302, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/Go/s491878021.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s491878021", "user_id": "u963686413"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\ta := readi() // 1\n\tb := readi() // 0\n\t_ = readi() // -1\n\tk := readi()\n\tif a + b >= k {\n\t\tfmt.Println(a)\n\t\treturn\n\t} else {\n\t\tfmt.Println(a - (k-(a+b)))\n\t}\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\n\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2437, "cpu_time_ms": 3, "memory_kb": 1860}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s604386161", "group_id": "codeNet:p02682", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a,b,c,k int\n\tfmt.Scan(&a,&b,&c,&k)\n\tif k <= a {\n\t\tfmt.Println(k)\n\t} else if k <= a+b {\n\t\tfmt.Println(a)\n\t} else if k <= a+b+c {\n\t\tfmt.Println(a-(k-(a+b)))\n\t} else {\n\t\tfmt.Println(a-c)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589159142, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/Go/s604386161.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s604386161", "user_id": "u145635628"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a,b,c,k int\n\tfmt.Scan(&a,&b,&c,&k)\n\tif k <= a {\n\t\tfmt.Println(k)\n\t} else if k <= a+b {\n\t\tfmt.Println(a)\n\t} else if k <= a+b+c {\n\t\tfmt.Println(a-(k-(a+b)))\n\t} else {\n\t\tfmt.Println(a-c)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 235, "cpu_time_ms": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s314298260", "group_id": "codeNet:p02682", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, k int\n\tfmt.Scan(&a, &b, &c, &k)\n\n\tvar ans int\n\tfor i := 1; i <= k; i++ {\n\t\tif i <= a {\n\t\t\tans++\n\t\t} else if i > a+b {\n\t\t\tans--\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1589159141, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/Go/s314298260.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s314298260", "user_id": "u367908963"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, k int\n\tfmt.Scan(&a, &b, &c, &k)\n\n\tvar ans int\n\tfor i := 1; i <= k; i++ {\n\t\tif i <= a {\n\t\t\tans++\n\t\t} else if i > a+b {\n\t\t\tans--\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 1797, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s347452518", "group_id": "codeNet:p02685", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/abc167/tasks/abc167_e\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, m, k int\n)\n\nfunc main() {\n\tn, m, k = ReadInt3()\n\n\tcf := NewCombFactorial(500000)\n\n\tans := 0\n\tfor i := 0; i <= k; i++ {\n\t\ttmp := cf.modpow(m-1, n-1-i)\n\t\ttmp %= MOD\n\t\ttmp *= m\n\t\ttmp %= MOD\n\t\ttmp *= cf.C(n-1, i)\n\t\ttmp %= MOD\n\n\t\tans += tmp\n\t\tans %= MOD\n\t}\n\tfmt.Println(ans)\n}\n\n// cf := NewCombFactorial(500000) // maxNum == \"maximum n\" * 2 (for H(n,r))\n// res := cf.C(n, r) \t// 組み合わせ\n// res := cf.H(n, r) \t// 重複組合せ\n// res := cf.P(n, r) \t// 順列\n\ntype CombFactorial struct {\n\tfactorial, invFactorial []int\n\tmaxNum int\n}\n\nfunc NewCombFactorial(maxNum int) *CombFactorial {\n\tcf := new(CombFactorial)\n\tcf.maxNum = maxNum\n\tcf.factorial = make([]int, maxNum+50)\n\tcf.invFactorial = make([]int, maxNum+50)\n\tcf.initCF()\n\n\treturn cf\n}\nfunc (c *CombFactorial) modInv(a int) int {\n\treturn c.modpow(a, MOD-2)\n}\nfunc (c *CombFactorial) modpow(a, e int) int {\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := c.modpow(a, halfE)\n\t\treturn half * half % MOD\n\t}\n\n\treturn a * c.modpow(a, e-1) % MOD\n}\nfunc (c *CombFactorial) initCF() {\n\tfor i := 0; i <= c.maxNum; i++ {\n\t\tif i == 0 {\n\t\t\tc.factorial[i] = 1\n\t\t\tc.invFactorial[i] = c.modInv(c.factorial[i])\n\t\t\tcontinue\n\t\t}\n\n\t\tnum := i * c.factorial[i-1]\n\t\tnum %= MOD\n\t\tc.factorial[i] = num\n\t\tc.invFactorial[i] = c.modInv(c.factorial[i])\n\t}\n}\nfunc (c *CombFactorial) C(n, r int) int {\n\tres := 1\n\tres *= c.factorial[n]\n\tres %= MOD\n\tres *= c.invFactorial[r]\n\tres %= MOD\n\tres *= c.invFactorial[n-r]\n\tres %= MOD\n\n\treturn res\n}\nfunc (c *CombFactorial) P(n, r int) int {\n\tres := 1\n\tres *= c.factorial[n]\n\tres %= MOD\n\tres *= c.invFactorial[n-r]\n\tres %= MOD\n\n\treturn res\n}\nfunc (c *CombFactorial) H(n, r int) int {\n\treturn c.C(n-1+r, r)\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1589162555, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02685.html", "problem_id": "p02685", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02685/input.txt", "sample_output_relpath": "derived/input_output/data/p02685/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02685/Go/s347452518.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s347452518", "user_id": "u103600314"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc167/tasks/abc167_e\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, m, k int\n)\n\nfunc main() {\n\tn, m, k = ReadInt3()\n\n\tcf := NewCombFactorial(500000)\n\n\tans := 0\n\tfor i := 0; i <= k; i++ {\n\t\ttmp := cf.modpow(m-1, n-1-i)\n\t\ttmp %= MOD\n\t\ttmp *= m\n\t\ttmp %= MOD\n\t\ttmp *= cf.C(n-1, i)\n\t\ttmp %= MOD\n\n\t\tans += tmp\n\t\tans %= MOD\n\t}\n\tfmt.Println(ans)\n}\n\n// cf := NewCombFactorial(500000) // maxNum == \"maximum n\" * 2 (for H(n,r))\n// res := cf.C(n, r) \t// 組み合わせ\n// res := cf.H(n, r) \t// 重複組合せ\n// res := cf.P(n, r) \t// 順列\n\ntype CombFactorial struct {\n\tfactorial, invFactorial []int\n\tmaxNum int\n}\n\nfunc NewCombFactorial(maxNum int) *CombFactorial {\n\tcf := new(CombFactorial)\n\tcf.maxNum = maxNum\n\tcf.factorial = make([]int, maxNum+50)\n\tcf.invFactorial = make([]int, maxNum+50)\n\tcf.initCF()\n\n\treturn cf\n}\nfunc (c *CombFactorial) modInv(a int) int {\n\treturn c.modpow(a, MOD-2)\n}\nfunc (c *CombFactorial) modpow(a, e int) int {\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := c.modpow(a, halfE)\n\t\treturn half * half % MOD\n\t}\n\n\treturn a * c.modpow(a, e-1) % MOD\n}\nfunc (c *CombFactorial) initCF() {\n\tfor i := 0; i <= c.maxNum; i++ {\n\t\tif i == 0 {\n\t\t\tc.factorial[i] = 1\n\t\t\tc.invFactorial[i] = c.modInv(c.factorial[i])\n\t\t\tcontinue\n\t\t}\n\n\t\tnum := i * c.factorial[i-1]\n\t\tnum %= MOD\n\t\tc.factorial[i] = num\n\t\tc.invFactorial[i] = c.modInv(c.factorial[i])\n\t}\n}\nfunc (c *CombFactorial) C(n, r int) int {\n\tres := 1\n\tres *= c.factorial[n]\n\tres %= MOD\n\tres *= c.invFactorial[r]\n\tres %= MOD\n\tres *= c.invFactorial[n-r]\n\tres %= MOD\n\n\treturn res\n}\nfunc (c *CombFactorial) P(n, r int) int {\n\tres := 1\n\tres *= c.factorial[n]\n\tres %= MOD\n\tres *= c.invFactorial[n-r]\n\tres %= MOD\n\n\treturn res\n}\nfunc (c *CombFactorial) H(n, r int) int {\n\treturn c.C(n-1+r, r)\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N blocks arranged in a row. Let us paint these blocks.\n\nWe will consider two ways to paint the blocks different if and only if there is a block painted in different colors in those two ways.\n\nFind the number of ways to paint the blocks under the following conditions:\n\nFor each block, use one of the M colors, Color 1 through Color M, to paint it. It is not mandatory to use all the colors.\n\nThere may be at most K pairs of adjacent blocks that are painted in the same color.\n\nSince the count may be enormous, print it modulo 998244353.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 2 \\times 10^5\n\n0 \\leq K \\leq N - 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2 1\n\nSample Output 1\n\n6\n\nThe following ways to paint the blocks satisfy the conditions: 112, 121, 122, 211, 212, and 221. Here, digits represent the colors of the blocks.\n\nSample Input 2\n\n100 100 0\n\nSample Output 2\n\n73074801\n\nSample Input 3\n\n60522 114575 7559\n\nSample Output 3\n\n479519525", "sample_input": "3 2 1\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02685", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N blocks arranged in a row. Let us paint these blocks.\n\nWe will consider two ways to paint the blocks different if and only if there is a block painted in different colors in those two ways.\n\nFind the number of ways to paint the blocks under the following conditions:\n\nFor each block, use one of the M colors, Color 1 through Color M, to paint it. It is not mandatory to use all the colors.\n\nThere may be at most K pairs of adjacent blocks that are painted in the same color.\n\nSince the count may be enormous, print it modulo 998244353.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 2 \\times 10^5\n\n0 \\leq K \\leq N - 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2 1\n\nSample Output 1\n\n6\n\nThe following ways to paint the blocks satisfy the conditions: 112, 121, 122, 211, 212, and 221. Here, digits represent the colors of the blocks.\n\nSample Input 2\n\n100 100 0\n\nSample Output 2\n\n73074801\n\nSample Input 3\n\n60522 114575 7559\n\nSample Output 3\n\n479519525", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6684, "cpu_time_ms": 254, "memory_kb": 9900}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s639653135", "group_id": "codeNet:p02686", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN := sc.i()\n\tfirstHarf := make([]Bar, 0, N)\n\tsecondHarf := make([]Bar, 0, N)\n\tup := '('\n\tdown := ')'\n\tfor i := 0; i < N; i++ {\n\t\ts := sc.s()\n\t\tm := 0\n\t\tp := 0\n\t\t//b := 0\n\t\tfor _, r := range s {\n\t\t\tif r == up {\n\t\t\t\tp += 1\n\t\t\t} else if r == down {\n\t\t\t\tp -= 1\n\t\t\t}\n\t\t\tm = min(p, m)\n\t\t}\n\n\t\tif p == 0 && m == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif p >= 0 {\n\t\t\tb := Bar{-1 * m, p - m}\n\t\t\tfirstHarf = append(firstHarf, b)\n\t\t} else {\n\t\t\tb := Bar{-1 * m, p - m}\n\t\t\tsecondHarf = append(secondHarf, b)\n\t\t}\n\t}\n\t// sort\n\tsort.Slice(firstHarf, func(i, j int) bool {\n\t\treturn firstHarf[i].A < firstHarf[j].A\n\t})\n\tsort.Slice(secondHarf, func(i, j int) bool {\n\t\treturn secondHarf[i].B > secondHarf[j].B\n\t})\n\ttotal := 0\n\tfor len(firstHarf) > 0 {\n\t\tbar := firstHarf[0]\n\t\tfirstHarf = firstHarf[1:]\n\t\ttotal += bar.B - bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor len(secondHarf) > 0 {\n\t\tbar := secondHarf[0]\n\t\tsecondHarf = secondHarf[1:]\n\t\ttotal += bar.B - bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tif total != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n}\n\ntype Bar struct {\n\tA int // -\n\tB int // +\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1590866864, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02686.html", "problem_id": "p02686", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02686/input.txt", "sample_output_relpath": "derived/input_output/data/p02686/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02686/Go/s639653135.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s639653135", "user_id": "u130295323"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN := sc.i()\n\tfirstHarf := make([]Bar, 0, N)\n\tsecondHarf := make([]Bar, 0, N)\n\tup := '('\n\tdown := ')'\n\tfor i := 0; i < N; i++ {\n\t\ts := sc.s()\n\t\tm := 0\n\t\tp := 0\n\t\t//b := 0\n\t\tfor _, r := range s {\n\t\t\tif r == up {\n\t\t\t\tp += 1\n\t\t\t} else if r == down {\n\t\t\t\tp -= 1\n\t\t\t}\n\t\t\tm = min(p, m)\n\t\t}\n\n\t\tif p == 0 && m == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif p >= 0 {\n\t\t\tb := Bar{-1 * m, p - m}\n\t\t\tfirstHarf = append(firstHarf, b)\n\t\t} else {\n\t\t\tb := Bar{-1 * m, p - m}\n\t\t\tsecondHarf = append(secondHarf, b)\n\t\t}\n\t}\n\t// sort\n\tsort.Slice(firstHarf, func(i, j int) bool {\n\t\treturn firstHarf[i].A < firstHarf[j].A\n\t})\n\tsort.Slice(secondHarf, func(i, j int) bool {\n\t\treturn secondHarf[i].B > secondHarf[j].B\n\t})\n\ttotal := 0\n\tfor len(firstHarf) > 0 {\n\t\tbar := firstHarf[0]\n\t\tfirstHarf = firstHarf[1:]\n\t\ttotal += bar.B - bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor len(secondHarf) > 0 {\n\t\tbar := secondHarf[0]\n\t\tsecondHarf = secondHarf[1:]\n\t\ttotal += bar.B - bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tif total != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n}\n\ntype Bar struct {\n\tA int // -\n\tB int // +\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "sample_input": "2\n)\n(()\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02686", "source_text": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3067, "cpu_time_ms": 66, "memory_kb": 18492}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s833709383", "group_id": "codeNet:p02686", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN := sc.i()\n\tfirstHarf := make([]Bar, 0, N)\n\tsecondHarf := make([]Bar, 0, N)\n\tup := '('\n\tdown := ')'\n\tfor i := 0; i < N; i++ {\n\t\ts := sc.s()\n\t\tm := 0\n\t\tp := 0\n\t\t//b := 0\n\t\tfor _, r := range s {\n\t\t\tif r == up {\n\t\t\t\tp += 1\n\t\t\t} else if r == down {\n\t\t\t\tp -= 1\n\t\t\t\tif p < m {\n\t\t\t\t\tm = p\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif p == 0 && m == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif p >= 0 {\n\t\t\tb := Bar{-1 * m, p - m}\n\t\t\tfirstHarf = append(firstHarf, b)\n\t\t} else {\n\t\t\tb := Bar{m, p - m}\n\t\t\tsecondHarf = append(secondHarf, b)\n\t\t}\n\t}\n\t// sort\n\tsort.Slice(firstHarf, func(i, j int) bool {\n\t\treturn firstHarf[i].A < firstHarf[j].A\n\t})\n\tsort.Slice(secondHarf, func(i, j int) bool {\n\t\treturn secondHarf[i].B > secondHarf[j].B\n\t})\n\ttotal := 0\n\tfor len(firstHarf) > 0 {\n\t\tbar := firstHarf[0]\n\t\tfirstHarf = firstHarf[1:]\n\t\ttotal += bar.B + bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor len(secondHarf) > 0 {\n\t\tbar := secondHarf[0]\n\t\tsecondHarf = secondHarf[1:]\n\t\ttotal += bar.B + bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tif total != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n}\n\ntype Bar struct {\n\tA int // -\n\tB int // +\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1590865868, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02686.html", "problem_id": "p02686", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02686/input.txt", "sample_output_relpath": "derived/input_output/data/p02686/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02686/Go/s833709383.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s833709383", "user_id": "u130295323"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN := sc.i()\n\tfirstHarf := make([]Bar, 0, N)\n\tsecondHarf := make([]Bar, 0, N)\n\tup := '('\n\tdown := ')'\n\tfor i := 0; i < N; i++ {\n\t\ts := sc.s()\n\t\tm := 0\n\t\tp := 0\n\t\t//b := 0\n\t\tfor _, r := range s {\n\t\t\tif r == up {\n\t\t\t\tp += 1\n\t\t\t} else if r == down {\n\t\t\t\tp -= 1\n\t\t\t\tif p < m {\n\t\t\t\t\tm = p\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif p == 0 && m == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif p >= 0 {\n\t\t\tb := Bar{-1 * m, p - m}\n\t\t\tfirstHarf = append(firstHarf, b)\n\t\t} else {\n\t\t\tb := Bar{m, p - m}\n\t\t\tsecondHarf = append(secondHarf, b)\n\t\t}\n\t}\n\t// sort\n\tsort.Slice(firstHarf, func(i, j int) bool {\n\t\treturn firstHarf[i].A < firstHarf[j].A\n\t})\n\tsort.Slice(secondHarf, func(i, j int) bool {\n\t\treturn secondHarf[i].B > secondHarf[j].B\n\t})\n\ttotal := 0\n\tfor len(firstHarf) > 0 {\n\t\tbar := firstHarf[0]\n\t\tfirstHarf = firstHarf[1:]\n\t\ttotal += bar.B + bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor len(secondHarf) > 0 {\n\t\tbar := secondHarf[0]\n\t\tsecondHarf = secondHarf[1:]\n\t\ttotal += bar.B + bar.A\n\t\tif total < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tif total != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n}\n\ntype Bar struct {\n\tA int // -\n\tB int // +\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "sample_input": "2\n)\n(()\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02686", "source_text": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3076, "cpu_time_ms": 71, "memory_kb": 18488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s089184904", "group_id": "codeNet:p02687", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tS := getStdin()\n\tif S[1] == 'B' {\n\t\tfmt.Printf(\"ARC\\n\")\n\t} else if S[1] == 'R' {\n\t\tfmt.Printf(\"ABC\\n\")\n\t}\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1024*1024*10)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "language": "Go", "metadata": {"date": 1590421478, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02687.html", "problem_id": "p02687", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02687/input.txt", "sample_output_relpath": "derived/input_output/data/p02687/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02687/Go/s089184904.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s089184904", "user_id": "u149861487"}, "prompt_components": {"gold_output": "ARC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tS := getStdin()\n\tif S[1] == 'B' {\n\t\tfmt.Printf(\"ARC\\n\")\n\t} else if S[1] == 'R' {\n\t\tfmt.Printf(\"ABC\\n\")\n\t}\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1024*1024*10)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "sample_input": "ABC\n"}, "reference_outputs": ["ARC\n"], "source_document_id": "p02687", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 992, "cpu_time_ms": 3, "memory_kb": 2500}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s167649009", "group_id": "codeNet:p02687", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var str string\n fmt.Scanf(\"%s\", &str)\n \n if str == \"ABC\" {\n fmt.Println(\"ARC\")\n }else{\n fmt.Println(\"ABC\")\n }\n}\n", "language": "Go", "metadata": {"date": 1588554144, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02687.html", "problem_id": "p02687", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02687/input.txt", "sample_output_relpath": "derived/input_output/data/p02687/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02687/Go/s167649009.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s167649009", "user_id": "u115650170"}, "prompt_components": {"gold_output": "ARC\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var str string\n fmt.Scanf(\"%s\", &str)\n \n if str == \"ABC\" {\n fmt.Println(\"ARC\")\n }else{\n fmt.Println(\"ABC\")\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "sample_input": "ABC\n"}, "reference_outputs": ["ARC\n"], "source_document_id": "p02687", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 167, "cpu_time_ms": 7, "memory_kb": 1816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s433807404", "group_id": "codeNet:p02688", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := scanInt(), scanInt()\n\ta := map[int]int{}\n\tfor i := 0; i < k; i++ {\n\t\td := scanInt()\n\t\tfor j := 0; j < d; j++ {\n\t\t\tp := scanInt()\n\t\t\ta[p] = 1\n\t\t}\n\t}\n\tfmt.Println(n - len(a))\n}\n", "language": "Go", "metadata": {"date": 1591925303, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02688.html", "problem_id": "p02688", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02688/input.txt", "sample_output_relpath": "derived/input_output/data/p02688/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02688/Go/s433807404.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s433807404", "user_id": "u475329018"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := scanInt(), scanInt()\n\ta := map[int]int{}\n\tfor i := 0; i < k; i++ {\n\t\td := scanInt()\n\t\tfor j := 0; j < d; j++ {\n\t\t\tp := scanInt()\n\t\t\ta[p] = 1\n\t\t}\n\t}\n\tfmt.Println(n - len(a))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "sample_input": "3 2\n2\n1 3\n1\n3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02688", "source_text": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 832, "cpu_time_ms": 2, "memory_kb": 1796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s104239067", "group_id": "codeNet:p02688", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar sunuke, okashi int\n\tfmt.Scanf(\"%d %d\", &sunuke, &okashi)\n\tsunuke_arr := make([] bool, sunuke)\n\n\tfor i := 0; i < okashi; i++ {\n\t\tvar okashi_num int\n\t\tfmt.Scanf(\"%d\", &okashi_num)\n\t\tvar sunuke_info string\n\t\tfmt.Scanf(\"%s\", &sunuke_info)\n\t\tslice := strings.Split(sunuke_info, \" \")\n\t\tfor _, str := range slice {\n\t\t\tvar sint int\n\t\t\tsint, _ = strconv.Atoi(str)\n\t\t\tsunuke_arr[sint - 1] = true\n\t\t}\n\t}\n\n\tvar counter = 0\n\n\tfor _, sunu := range sunuke_arr {\n\t\tif sunu {\n\t\t\tcounter++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\" ,counter)\n}\n", "language": "Go", "metadata": {"date": 1589154987, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02688.html", "problem_id": "p02688", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02688/input.txt", "sample_output_relpath": "derived/input_output/data/p02688/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02688/Go/s104239067.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s104239067", "user_id": "u155757809"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar sunuke, okashi int\n\tfmt.Scanf(\"%d %d\", &sunuke, &okashi)\n\tsunuke_arr := make([] bool, sunuke)\n\n\tfor i := 0; i < okashi; i++ {\n\t\tvar okashi_num int\n\t\tfmt.Scanf(\"%d\", &okashi_num)\n\t\tvar sunuke_info string\n\t\tfmt.Scanf(\"%s\", &sunuke_info)\n\t\tslice := strings.Split(sunuke_info, \" \")\n\t\tfor _, str := range slice {\n\t\t\tvar sint int\n\t\t\tsint, _ = strconv.Atoi(str)\n\t\t\tsunuke_arr[sint - 1] = true\n\t\t}\n\t}\n\n\tvar counter = 0\n\n\tfor _, sunu := range sunuke_arr {\n\t\tif sunu {\n\t\t\tcounter++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\" ,counter)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "sample_input": "3 2\n2\n1 3\n1\n3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02688", "source_text": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 585, "cpu_time_ms": 3, "memory_kb": 1824}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s614811786", "group_id": "codeNet:p02689", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\t_, m := r.nextInt(), r.nextInt()\n\tr.Scan(true)\n\th := append([]int{0}, r.nextStringArray().toInts()...)\n\tpt := make([]int, len(h))\n\tfor i := 0; i < m; i++ {\n\t\tr.Scan(true)\n\t\trt := r.nextStringArray().toInts()\n\n\t\tif h[rt[0]] <= h[rt[1]] {\n\t\t\tpt[rt[0]]--\n\t\t}\n\t\tif h[rt[1]] <= h[rt[0]] {\n\t\t\tpt[rt[1]]--\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range pt[1:] {\n\t\tif v == 0 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, ans)\n}\n", "language": "Go", "metadata": {"date": 1593955909, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/Go/s614811786.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s614811786", "user_id": "u463655976"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\t_, m := r.nextInt(), r.nextInt()\n\tr.Scan(true)\n\th := append([]int{0}, r.nextStringArray().toInts()...)\n\tpt := make([]int, len(h))\n\tfor i := 0; i < m; i++ {\n\t\tr.Scan(true)\n\t\trt := r.nextStringArray().toInts()\n\n\t\tif h[rt[0]] <= h[rt[1]] {\n\t\t\tpt[rt[0]]--\n\t\t}\n\t\tif h[rt[1]] <= h[rt[0]] {\n\t\t\tpt[rt[1]]--\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range pt[1:] {\n\t\tif v == 0 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3061, "cpu_time_ms": 51, "memory_kb": 13088}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s896834389", "group_id": "codeNet:p02689", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, M := readInt(), readInt()\n\tH := make([]int64, N)\n\tNg := make([]bool, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tH[i] = readInt()\n\t}\n\tfor i := int64(0); i < M; i++ {\n\t\tA, B := readInt(), readInt()\n\t\tif H[A-1] < H[B-1] {\n\t\t\tNg[A-1] = true\n\t\t}\n\t\tif H[A-1] > H[B-1] {\n\t\t\tNg[B-1] = true\n\t\t}\n\t\tif H[A-1] == H[B-1] {\n\t\t\tNg[A-1] = true\n\t\t\tNg[B-1] = true\n\t\t}\n\t}\n\tans := int64(0)\n\tfor i := int64(0); i < N; i++ {\n\t\tif !Ng[i] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1589748700, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/Go/s896834389.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s896834389", "user_id": "u967669872"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, M := readInt(), readInt()\n\tH := make([]int64, N)\n\tNg := make([]bool, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tH[i] = readInt()\n\t}\n\tfor i := int64(0); i < M; i++ {\n\t\tA, B := readInt(), readInt()\n\t\tif H[A-1] < H[B-1] {\n\t\t\tNg[A-1] = true\n\t\t}\n\t\tif H[A-1] > H[B-1] {\n\t\t\tNg[B-1] = true\n\t\t}\n\t\tif H[A-1] == H[B-1] {\n\t\t\tNg[A-1] = true\n\t\t\tNg[B-1] = true\n\t\t}\n\t}\n\tans := int64(0)\n\tfor i := int64(0); i < N; i++ {\n\t\tif !Ng[i] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6013, "cpu_time_ms": 46, "memory_kb": 5540}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s039632174", "group_id": "codeNet:p02689", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []byte {\n\treturn []byte(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif x%y != 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn y\n}\n\nfunc run(input io.Reader, output io.Writer) int {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\tM := sc.nextInt()\n\tH := make([]int, N+1)\n\tgood := make(map[int]struct{}, 0)\n\tfor i := 1; i <= N; i++ {\n\t\tH[i] = sc.nextInt()\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\ta := sc.nextInt()\n\t\tb := sc.nextInt()\n\t\tswitch {\n\t\tcase H[a] > H[b]:\n\t\t\tgood[b] = struct{}{}\n\t\tcase H[a] < H[b]:\n\t\t\tgood[a] = struct{}{}\n\t\tdefault:\n\t\t\tgood[a] = struct{}{}\n\t\t\tgood[b] = struct{}{}\n\t\t}\n\t}\n\n\tfmt.Println(N - len(good))\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run(os.Stdin, os.Stdout))\n}\n", "language": "Go", "metadata": {"date": 1588561685, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/Go/s039632174.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s039632174", "user_id": "u737368452"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []byte {\n\treturn []byte(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif x%y != 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn y\n}\n\nfunc run(input io.Reader, output io.Writer) int {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\tM := sc.nextInt()\n\tH := make([]int, N+1)\n\tgood := make(map[int]struct{}, 0)\n\tfor i := 1; i <= N; i++ {\n\t\tH[i] = sc.nextInt()\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\ta := sc.nextInt()\n\t\tb := sc.nextInt()\n\t\tswitch {\n\t\tcase H[a] > H[b]:\n\t\t\tgood[b] = struct{}{}\n\t\tcase H[a] < H[b]:\n\t\t\tgood[a] = struct{}{}\n\t\tdefault:\n\t\t\tgood[a] = struct{}{}\n\t\t\tgood[b] = struct{}{}\n\t\t}\n\t}\n\n\tfmt.Println(N - len(good))\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run(os.Stdin, os.Stdout))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1579, "cpu_time_ms": 56, "memory_kb": 7572}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s200587941", "group_id": "codeNet:p02690", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, a, b int64\n\tfmt.Scan(&x)\n\n\tfor a = -x; a <= x; a++ {\n\t\tfor b = -x; b <= x; b++ {\n\t\t\tif a == b || x%(a-b) != 0 {\n\t\t\t\tcontinue\n\t\t\t} else if (a*a*a*a*a - b*b*b*b*b) == x {\n\t\t\t\tfmt.Println(a, b)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588995191, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02690.html", "problem_id": "p02690", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02690/input.txt", "sample_output_relpath": "derived/input_output/data/p02690/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02690/Go/s200587941.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s200587941", "user_id": "u302074323"}, "prompt_components": {"gold_output": "2 -1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, a, b int64\n\tfmt.Scan(&x)\n\n\tfor a = -x; a <= x; a++ {\n\t\tfor b = -x; b <= x; b++ {\n\t\t\tif a == b || x%(a-b) != 0 {\n\t\t\t\tcontinue\n\t\t\t} else if (a*a*a*a*a - b*b*b*b*b) == x {\n\t\t\t\tfmt.Println(a, b)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "sample_input": "33\n"}, "reference_outputs": ["2 -1\n"], "source_document_id": "p02690", "source_text": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 266, "cpu_time_ms": 2205, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s044922155", "group_id": "codeNet:p02690", "input_text": "package main\n\nimport(\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar X, ans1, ans2 int\n fmt.Scan(&X)\n\tN:=1000\n\tfindFlag:=false\n\tfor ans1 =-N; ans1= X {\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfmt.Println(i);\n}", "language": "Go", "metadata": {"date": 1588469228, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02694.html", "problem_id": "p02694", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02694/input.txt", "sample_output_relpath": "derived/input_output/data/p02694/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02694/Go/s689219857.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s689219857", "user_id": "u283295031"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar X int64;\n\tvar in int64 ;\n\n\tin = 100;\n\n\tfmt.Scan(&X);\n\tvar i int64;\n\ti = 0;\n\tfor i = 1 ; i < 10000 ; i++{\n\t\tin = int64(float64(in) * 1.01);\n\n\t\tif in >= X {\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfmt.Println(i);\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "sample_input": "103\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02694", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 238, "cpu_time_ms": 6, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s094097099", "group_id": "codeNet:p02694", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tX := nextInt64()\n\tc := int64(100)\n\ti := 0\n\n\tfor c < X {\n\t\tc = int64(float64(c) * 1.01)\n\t\ti++\n\t}\n\tfmt.Println(i)\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1588468772, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02694.html", "problem_id": "p02694", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02694/input.txt", "sample_output_relpath": "derived/input_output/data/p02694/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02694/Go/s094097099.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s094097099", "user_id": "u578274732"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tX := nextInt64()\n\tc := int64(100)\n\ti := 0\n\n\tfor c < X {\n\t\tc = int64(float64(c) * 1.01)\n\t\ti++\n\t}\n\tfmt.Println(i)\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "sample_input": "103\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02694", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 702, "cpu_time_ms": 3, "memory_kb": 1788}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s783889021", "group_id": "codeNet:p02694", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x float64\n\tfmt.Scan(&x)\n\n\ti := 0\n\ty := float64(100)\n\tfor ; y < x; i++ {\n\t\ty = math.Floor(y * 1.01)\n\t}\n\tfmt.Println(i)\n}\n", "language": "Go", "metadata": {"date": 1588468601, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02694.html", "problem_id": "p02694", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02694/input.txt", "sample_output_relpath": "derived/input_output/data/p02694/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02694/Go/s783889021.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s783889021", "user_id": "u902409225"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x float64\n\tfmt.Scan(&x)\n\n\ti := 0\n\ty := float64(100)\n\tfor ; y < x; i++ {\n\t\ty = math.Floor(y * 1.01)\n\t}\n\tfmt.Println(i)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "sample_input": "103\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02694", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\n\nThe bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)\n\nAssuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?\n\nConstraints\n\n101 \\le X \\le 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the number of years it takes for Takahashi's balance to reach X yen or above for the first time.\n\nSample Input 1\n\n103\n\nSample Output 1\n\n3\n\nThe balance after one year is 101 yen.\n\nThe balance after two years is 102 yen.\n\nThe balance after three years is 103 yen.\n\nThus, it takes three years for the balance to reach 103 yen or above.\n\nSample Input 2\n\n1000000000000000000\n\nSample Output 2\n\n3760\n\nSample Input 3\n\n1333333333\n\nSample Output 3\n\n1706", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 2, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s930591616", "group_id": "codeNet:p02695", "input_text": "// なんだこれ Aを決め打ちするのか?まにあうんかそれ\npackage main\n\nimport \"fmt\"\n\nvar N, M, Q int\nvar AS [][]int\n\nfunc main() {\n\tfmt.Scan(&N, &M, &Q)\n\tAS = [][]int{}\n\tfor i := 1; i <= M; i++ {\n\t\ta := []int{i}\n\t\tcreateAS(a)\n\t}\n\tqueries := make([][]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tvar a, b, c, d int\n\t\tfmt.Scan(&a, &b, &c, &d)\n\t\tqueries[i] = []int{a, b, c, d}\n\t}\n\tans := 0\n\tfor _, a := range AS {\n\t\ttmp_ans := 0\n\t\tfor _, q := range queries {\n\t\t\tif a[q[1]-1]-a[q[0]-1] == q[2] {\n\t\t\t\ttmp_ans += q[3]\n\t\t\t}\n\t\t}\n\t\tans = max(ans, tmp_ans)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc createAS(arr []int) {\n\tif len(arr) == N {\n\t\ttes := append([]int{}, arr...)\n\t\tAS = append(AS, tes)\n\t} else {\n\t\tlimit := arr[len(arr)-1]\n\t\ttmp_arr := append([]int{}, arr...)\n\t\tfor i := limit; i <= M; i++ {\n\t\t\ttmp_arr = append(tmp_arr, i)\n\t\t\tcreateAS(tmp_arr)\n\t\t\ttmp_arr = tmp_arr[:len(tmp_arr)-1]\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1588471887, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02695.html", "problem_id": "p02695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02695/input.txt", "sample_output_relpath": "derived/input_output/data/p02695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02695/Go/s930591616.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s930591616", "user_id": "u445624660"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "// なんだこれ Aを決め打ちするのか?まにあうんかそれ\npackage main\n\nimport \"fmt\"\n\nvar N, M, Q int\nvar AS [][]int\n\nfunc main() {\n\tfmt.Scan(&N, &M, &Q)\n\tAS = [][]int{}\n\tfor i := 1; i <= M; i++ {\n\t\ta := []int{i}\n\t\tcreateAS(a)\n\t}\n\tqueries := make([][]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tvar a, b, c, d int\n\t\tfmt.Scan(&a, &b, &c, &d)\n\t\tqueries[i] = []int{a, b, c, d}\n\t}\n\tans := 0\n\tfor _, a := range AS {\n\t\ttmp_ans := 0\n\t\tfor _, q := range queries {\n\t\t\tif a[q[1]-1]-a[q[0]-1] == q[2] {\n\t\t\t\ttmp_ans += q[3]\n\t\t\t}\n\t\t}\n\t\tans = max(ans, tmp_ans)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc createAS(arr []int) {\n\tif len(arr) == N {\n\t\ttes := append([]int{}, arr...)\n\t\tAS = append(AS, tes)\n\t} else {\n\t\tlimit := arr[len(arr)-1]\n\t\ttmp_arr := append([]int{}, arr...)\n\t\tfor i := limit; i <= M; i++ {\n\t\t\ttmp_arr = append(tmp_arr, i)\n\t\t\tcreateAS(tmp_arr)\n\t\t\ttmp_arr = tmp_arr[:len(tmp_arr)-1]\n\t\t}\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "sample_input": "3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n"}, "reference_outputs": ["110\n"], "source_document_id": "p02695", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 954, "cpu_time_ms": 58, "memory_kb": 19956}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s936988281", "group_id": "codeNet:p02696", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &n)\n\tanswer := maxFloor(a, b, n)\n\tfmt.Println(answer)\n}\n\nfunc maxFloor(a, b, n int) int {\n\tmaxFloor := 0\n\ttarget := n - 500000000\n\tif target < 1 {\n\t\ttarget = 1\n\t}\n\tfor i := n; i >= target; i-- {\n\t\tx := a * i / b\n\t\ty := a * (i / b)\n\t\tdiff := x - y\n\t\tif maxFloor < diff {\n\t\t\tmaxFloor = diff\n\t\t}\n\t}\n\treturn maxFloor\n}\n", "language": "Go", "metadata": {"date": 1588474160, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/Go/s936988281.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s936988281", "user_id": "u238461782"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &n)\n\tanswer := maxFloor(a, b, n)\n\tfmt.Println(answer)\n}\n\nfunc maxFloor(a, b, n int) int {\n\tmaxFloor := 0\n\ttarget := n - 500000000\n\tif target < 1 {\n\t\ttarget = 1\n\t}\n\tfor i := n; i >= target; i-- {\n\t\tx := a * i / b\n\t\ty := a * (i / b)\n\t\tdiff := x - y\n\t\tif maxFloor < diff {\n\t\t\tmaxFloor = diff\n\t\t}\n\t}\n\treturn maxFloor\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 410, "cpu_time_ms": 2205, "memory_kb": 1848}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s136092624", "group_id": "codeNet:p02696", "input_text": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc solution(a, b, n int) int {\n ans := -1 << 31\n\n for i := 1; i <= n; i++ {\n ans = max(ans, int(math.Floor(float64(a)*float64(i)/float64(b))-float64(a)*math.Floor(float64(i)/float64(b))))\n }\n return ans\n}\n\nfunc max(x, y int) int {\n if x > y {\n return x\n\n }\n return y\n}\n\nfunc main() {\n var a, b, n int\n fmt.Scan(&a, &b, &n)\n fmt.Println(solution(a, b, n))\n}", "language": "Go", "metadata": {"date": 1588472377, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/Go/s136092624.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s136092624", "user_id": "u568763892"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc solution(a, b, n int) int {\n ans := -1 << 31\n\n for i := 1; i <= n; i++ {\n ans = max(ans, int(math.Floor(float64(a)*float64(i)/float64(b))-float64(a)*math.Floor(float64(i)/float64(b))))\n }\n return ans\n}\n\nfunc max(x, y int) int {\n if x > y {\n return x\n\n }\n return y\n}\n\nfunc main() {\n var a, b, n int\n fmt.Scan(&a, &b, &n)\n fmt.Println(solution(a, b, n))\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 513, "cpu_time_ms": 2205, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s927209616", "group_id": "codeNet:p02696", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scan(&a, &b, &n)\n\tx := min(b-1, n)\n\tfmt.Println(int(a*x/b) - a*int(x/b))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1588470423, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/Go/s927209616.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s927209616", "user_id": "u282164747"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scan(&a, &b, &n)\n\tx := min(b-1, n)\n\tfmt.Println(int(a*x/b) - a*int(x/b))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 208, "cpu_time_ms": 1, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s830079768", "group_id": "codeNet:p02697", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN, M := sc.i(), sc.i()\n\tharf := N / 2\n\tbattleRooms := make([][]int, 0, M)\n\tfor i := 0; i < M; i++ {\n\t\tfirst := harf - i\n\t\tsecond := harf + 1 + i\n\t\tbattleRooms = append(battleRooms, []int{first, second})\n\t}\n\tfor _, room := range battleRooms {\n\t\tfmt.Printf(\"%d %d\\n\", room[0], room[1])\n\t}\n}\n\n// fmt.Println(\"Yes\")\n// fmt.Println(\"No\")\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1590892353, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02697.html", "problem_id": "p02697", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02697/input.txt", "sample_output_relpath": "derived/input_output/data/p02697/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02697/Go/s830079768.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s830079768", "user_id": "u130295323"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN, M := sc.i(), sc.i()\n\tharf := N / 2\n\tbattleRooms := make([][]int, 0, M)\n\tfor i := 0; i < M; i++ {\n\t\tfirst := harf - i\n\t\tsecond := harf + 1 + i\n\t\tbattleRooms = append(battleRooms, []int{first, second})\n\t}\n\tfor _, room := range battleRooms {\n\t\tfmt.Printf(\"%d %d\\n\", room[0], room[1])\n\t}\n}\n\n// fmt.Println(\"Yes\")\n// fmt.Println(\"No\")\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "sample_input": "4 1\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02697", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2335, "cpu_time_ms": 161, "memory_kb": 6620}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063260206", "group_id": "codeNet:p02697", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tfor i := 1; i <= m; i++ {\n\t\tFprintln(out, i, n+1-i)\n\t}\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "language": "Go", "metadata": {"date": 1589146496, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02697.html", "problem_id": "p02697", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02697/input.txt", "sample_output_relpath": "derived/input_output/data/p02697/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02697/Go/s063260206.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s063260206", "user_id": "u235132324"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tfor i := 1; i <= m; i++ {\n\t\tFprintln(out, i, n+1-i)\n\t}\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "sample_input": "4 1\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02697", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 344, "cpu_time_ms": 25, "memory_kb": 3340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s940642810", "group_id": "codeNet:p02699", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, w int\n\tfmt.Scan(&s, &w)\n\n\tif w >= s{\n\t\tfmt.Println(\"unsafe\")\n\t}else{\n\t\tfmt.Println(\"safe\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591314789, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/Go/s940642810.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s940642810", "user_id": "u223172005"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, w int\n\tfmt.Scan(&s, &w)\n\n\tif w >= s{\n\t\tfmt.Println(\"unsafe\")\n\t}else{\n\t\tfmt.Println(\"safe\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 146, "cpu_time_ms": 4, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s008620048", "group_id": "codeNet:p02699", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\treturn i\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextInt()\n\tw := nextInt()\n\n\tif s > w {\n\t\tfmt.Println(\"safe\")\n\t} else {\n\t\tfmt.Println(\"unsafe\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1590121693, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/Go/s008620048.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s008620048", "user_id": "u756000295"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\treturn i\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextInt()\n\tw := nextInt()\n\n\tif s > w {\n\t\tfmt.Println(\"safe\")\n\t} else {\n\t\tfmt.Println(\"unsafe\")\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 351, "cpu_time_ms": 4, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s539794399", "group_id": "codeNet:p02699", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar S, W int\n\tnextInt(&S, &W)\n\tif W >= S {\n\t\tfmt.Printf(\"unsafe\")\n\t} else {\n\t\tfmt.Printf(\"safe\")\n\t}\n}\n\nconst MAX_INT int = 1_000_000_000\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc nextInt(A ...*int) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.Atoi(L[i])\n\t}\n}\nfunc nextInts(A *[]int) {\n\tL := strings.Split(nextLine(), \" \")\n\t(*A) = make([]int, len(L))\n\tfor i, l := range L {\n\t\t(*A)[i], _ = strconv.Atoi(l)\n\t}\n}\n\nfunc nextInt64(A ...*int64) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.ParseInt(L[i], 0, 64)\n\t}\n}\n\nfunc max(a int, b int) int {\n\tif a >= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n", "language": "Go", "metadata": {"date": 1588718495, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/Go/s539794399.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s539794399", "user_id": "u024821820"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar S, W int\n\tnextInt(&S, &W)\n\tif W >= S {\n\t\tfmt.Printf(\"unsafe\")\n\t} else {\n\t\tfmt.Printf(\"safe\")\n\t}\n}\n\nconst MAX_INT int = 1_000_000_000\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc nextInt(A ...*int) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.Atoi(L[i])\n\t}\n}\nfunc nextInts(A *[]int) {\n\tL := strings.Split(nextLine(), \" \")\n\t(*A) = make([]int, len(L))\n\tfor i, l := range L {\n\t\t(*A)[i], _ = strconv.Atoi(l)\n\t}\n}\n\nfunc nextInt64(A ...*int64) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.ParseInt(L[i], 0, 64)\n\t}\n}\n\nfunc max(a int, b int) int {\n\tif a >= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1093, "cpu_time_ms": 2, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s801678684", "group_id": "codeNet:p02699", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\nvar memo = map[int]int{}\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\tmemo[len(S)] = 0\n\tvar res int\n\tfor i := len(S); i >= 0; i-- {\n\t\tfor j := i - 3; j >= 0; j-- {\n\t\t\tt1 := calc(j)\n\t\t\tt2 := calc(i)\n\t\t\tif (t1-t2)%2019 == 0 {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n\nfunc calc(i int) int {\n\tif v, ok := memo[i]; ok {\n\t\treturn v\n\t}\n\ta, _ := strconv.Atoi(string(S[i]))\n\tp := len(S) - i\n\tmemo[i] = ((a * int(math.Pow10(p-1))) + calc(i+1)) % 2019\n\treturn memo[i]\n}\n", "language": "Go", "metadata": {"date": 1587958655, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/Go/s801678684.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s801678684", "user_id": "u686302771"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\nvar memo = map[int]int{}\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\tmemo[len(S)] = 0\n\tvar res int\n\tfor i := len(S); i >= 0; i-- {\n\t\tfor j := i - 3; j >= 0; j-- {\n\t\t\tt1 := calc(j)\n\t\t\tt2 := calc(i)\n\t\t\tif (t1-t2)%2019 == 0 {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n\nfunc calc(i int) int {\n\tif v, ok := memo[i]; ok {\n\t\treturn v\n\t}\n\ta, _ := strconv.Atoi(string(S[i]))\n\tp := len(S) - i\n\tmemo[i] = ((a * int(math.Pow10(p-1))) + calc(i+1)) % 2019\n\treturn memo[i]\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 512, "cpu_time_ms": 4, "memory_kb": 1828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s334770780", "group_id": "codeNet:p02706", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := getInt()\n\tm := getInt()\n\tfor i := 0; i < m; i++ {\n\t\tn -= getInt()\n\t}\n\tif n >= 0 {\n\t\tout(n)\n\t} else {\n\t\tout(-1)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1588201028, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02706.html", "problem_id": "p02706", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02706/input.txt", "sample_output_relpath": "derived/input_output/data/p02706/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02706/Go/s334770780.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s334770780", "user_id": "u663830728"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := getInt()\n\tm := getInt()\n\tfor i := 0; i < m; i++ {\n\t\tn -= getInt()\n\t}\n\tif n >= 0 {\n\t\tout(n)\n\t} else {\n\t\tout(-1)\n\t}\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "sample_input": "41 2\n5 6\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02706", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 560, "cpu_time_ms": 4, "memory_kb": 1856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s878463889", "group_id": "codeNet:p02706", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc main() {\n\tn := nextInt()\n\tm := nextInt()\n\ta := nextInts(m)\n\tfmt.Println(n - sum(a))\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1587344799, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02706.html", "problem_id": "p02706", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02706/input.txt", "sample_output_relpath": "derived/input_output/data/p02706/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02706/Go/s878463889.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s878463889", "user_id": "u696272993"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc main() {\n\tn := nextInt()\n\tm := nextInt()\n\ta := nextInts(m)\n\tfmt.Println(n - sum(a))\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "sample_input": "41 2\n5 6\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02706", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1697, "cpu_time_ms": 5, "memory_kb": 1876}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s523357382", "group_id": "codeNet:p02707", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tmanagers := scanIntSlice(n - 1)\n\n\tsubs := map[int]int{}\n\tfor _, m := range managers {\n\t\tsubs[m-1] = subs[m-1] + 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Printf(\"%d\\n\", subs[i])\n\t}\n}\n\nfunc scanIntSlice(size int) []int {\n\tinput := []int{}\n\tfor i := 0; i < size; i++ {\n\t\tvar in int\n\t\tfmt.Scanf(\"%d\", &in)\n\t\tinput = append(input, in)\n\t}\n\treturn input\n}\n", "language": "Go", "metadata": {"date": 1587345794, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02707.html", "problem_id": "p02707", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02707/input.txt", "sample_output_relpath": "derived/input_output/data/p02707/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02707/Go/s523357382.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s523357382", "user_id": "u131131890"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tmanagers := scanIntSlice(n - 1)\n\n\tsubs := map[int]int{}\n\tfor _, m := range managers {\n\t\tsubs[m-1] = subs[m-1] + 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Printf(\"%d\\n\", subs[i])\n\t}\n}\n\nfunc scanIntSlice(size int) []int {\n\tinput := []int{}\n\tfor i := 0; i < size; i++ {\n\t\tvar in int\n\t\tfmt.Scanf(\"%d\", &in)\n\t\tinput = append(input, in)\n\t}\n\treturn input\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "sample_input": "5\n1 1 2 2\n"}, "reference_outputs": ["2\n2\n0\n0\n0\n"], "source_document_id": "p02707", "source_text": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 427, "cpu_time_ms": 1352, "memory_kb": 15872}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s482992809", "group_id": "codeNet:p02712", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tfsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif (i%3 != 0) && (i%5 != 0) {\n\t\t\tfsum += i\n\t\t}\n\t}\n\n\tfmt.Println(fsum)\n}\n\n// ---- readfunc\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1591328555, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02712/input.txt", "sample_output_relpath": "derived/input_output/data/p02712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02712/Go/s482992809.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s482992809", "user_id": "u756000295"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tfsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif (i%3 != 0) && (i%5 != 0) {\n\t\t\tfsum += i\n\t\t}\n\t}\n\n\tfmt.Println(fsum)\n}\n\n// ---- readfunc\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "sample_input": "15\n"}, "reference_outputs": ["60\n"], "source_document_id": "p02712", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 444, "cpu_time_ms": 8, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s969194116", "group_id": "codeNet:p02719", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\n\tvar X int = N - K*(N/K)\n\tvar min int = 5 * int(math.Pow10(18))\n\tfor {\n\t\tflag := int(math.Abs(float64(X) - float64(K)))\n\t\tif flag < int(math.Abs(float64(min))) {\n\t\t\tX = flag\n\t\t\tmin = flag\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\n\t}\n\tfmt.Println(min)\n\n}\n", "language": "Go", "metadata": {"date": 1596509381, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02719.html", "problem_id": "p02719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02719/input.txt", "sample_output_relpath": "derived/input_output/data/p02719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02719/Go/s969194116.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s969194116", "user_id": "u128015095"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\n\tvar X int = N - K*(N/K)\n\tvar min int = 5 * int(math.Pow10(18))\n\tfor {\n\t\tflag := int(math.Abs(float64(X) - float64(K)))\n\t\tif flag < int(math.Abs(float64(min))) {\n\t\t\tX = flag\n\t\t\tmin = flag\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\n\t}\n\tfmt.Println(min)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "sample_input": "7 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02719", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 335, "cpu_time_ms": 2, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s542951330", "group_id": "codeNet:p02719", "input_text": "package main\nimport \"fmt\"\nfunc main(){\n // Your code here!\n var n, k int64\n fmt.Scan(&n, &k)\n var t = n\n n = n - ((n / k) * k)\n for ;;{\n n = abs((n-k))\n if n >= t{\n fmt.Println(t)\n return\n }\n t = n\n \n }\n \n}\n\nfunc abs(v int64) int64{\n if v < 0{\n return -v\n }else{\n return v\n }\n}\n", "language": "Go", "metadata": {"date": 1586050726, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02719.html", "problem_id": "p02719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02719/input.txt", "sample_output_relpath": "derived/input_output/data/p02719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02719/Go/s542951330.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s542951330", "user_id": "u167020125"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\nimport \"fmt\"\nfunc main(){\n // Your code here!\n var n, k int64\n fmt.Scan(&n, &k)\n var t = n\n n = n - ((n / k) * k)\n for ;;{\n n = abs((n-k))\n if n >= t{\n fmt.Println(t)\n return\n }\n t = n\n \n }\n \n}\n\nfunc abs(v int64) int64{\n if v < 0{\n return -v\n }else{\n return v\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "sample_input": "7 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02719", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 381, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s271115798", "group_id": "codeNet:p02719", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K int\n\n\tfmt.Scanf(\"%d %d\\n\", &N, &K)\n\tif N%K == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tx1 := N % K\n\tx2 := x1 - K\n\tif x2 < 0 {\n\t\tx2 = -x2\n\t}\n\n\tif x1 > x2 {\n\t\tfmt.Println(x2)\n\t} else {\n\t\tfmt.Println(x1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586049491, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02719.html", "problem_id": "p02719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02719/input.txt", "sample_output_relpath": "derived/input_output/data/p02719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02719/Go/s271115798.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s271115798", "user_id": "u534481484"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K int\n\n\tfmt.Scanf(\"%d %d\\n\", &N, &K)\n\tif N%K == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tx1 := N % K\n\tx2 := x1 - K\n\tif x2 < 0 {\n\t\tx2 = -x2\n\t}\n\n\tif x1 > x2 {\n\t\tfmt.Println(x2)\n\t} else {\n\t\tfmt.Println(x1)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "sample_input": "7 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02719", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven any integer x, Aoki can do the operation below.\n\nOperation: Replace x with the absolute difference of x and K.\n\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nConstraints\n\n0 ≤ N ≤ 10^{18}\n\n1 ≤ K ≤ 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible value taken by N after Aoki does the operation zero or more times.\n\nSample Input 1\n\n7 4\n\nSample Output 1\n\n1\n\nInitially, N=7.\n\nAfter one operation, N becomes |7-4| = 3.\n\nAfter two operations, N becomes |3-4| = 1, which is the minimum value taken by N.\n\nSample Input 2\n\n2 6\n\nSample Output 2\n\n2\n\nN=2 after zero operations is the minimum.\n\nSample Input 3\n\n1000000000000000000 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 256, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s768206624", "group_id": "codeNet:p02721", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc bOut(f bool, x string, y string) {\n\tif f {\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(y)\n\t}\n}\nfunc mod(x, d int) int {\n\tx %= d\n\tif x < 0 {\n\t\tx += d\n\t}\n\treturn d\n}\n\nvar lp int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, lp)\n\tsc.Split(bufio.ScanWords)\n\tn, k, c := iScan(), iScan(), iScan()\n\ts := Scan()\n\tr := 0\n\tp, q := make([]int, 0, k), make([]int, 0, k)\n\tfor i := 0; i < n && len(p) != k; i++ {\n\t\tif r <= 0 && string(s[i]) != \"x\" {\n\t\t\tp = append(p, i)\n\t\t\tr = c\n\t\t} else {\n\t\t\tr--\n\t\t}\n\t}\n\tr = 0\n\tfor i := n - 1; i >= 0 && len(q) != k; i-- {\n\t\tif r <= 0 && string(s[i]) != \"x\" {\n\t\t\tq = append(q, i)\n\t\t\tr = c\n\t\t} else {\n\t\t\tr--\n\t\t}\n\t}\n\tfor i := 0; i < k; i++ {\n\t\tif p[i] == q[k-i-1] {\n\t\t\tfmt.Println(p[i] + 1)\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1599589481, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02721.html", "problem_id": "p02721", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02721/input.txt", "sample_output_relpath": "derived/input_output/data/p02721/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02721/Go/s768206624.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s768206624", "user_id": "u843722521"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc bOut(f bool, x string, y string) {\n\tif f {\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(y)\n\t}\n}\nfunc mod(x, d int) int {\n\tx %= d\n\tif x < 0 {\n\t\tx += d\n\t}\n\treturn d\n}\n\nvar lp int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, lp)\n\tsc.Split(bufio.ScanWords)\n\tn, k, c := iScan(), iScan(), iScan()\n\ts := Scan()\n\tr := 0\n\tp, q := make([]int, 0, k), make([]int, 0, k)\n\tfor i := 0; i < n && len(p) != k; i++ {\n\t\tif r <= 0 && string(s[i]) != \"x\" {\n\t\t\tp = append(p, i)\n\t\t\tr = c\n\t\t} else {\n\t\t\tr--\n\t\t}\n\t}\n\tr = 0\n\tfor i := n - 1; i >= 0 && len(q) != k; i-- {\n\t\tif r <= 0 && string(s[i]) != \"x\" {\n\t\t\tq = append(q, i)\n\t\t\tr = c\n\t\t} else {\n\t\t\tr--\n\t\t}\n\t}\n\tfor i := 0; i < k; i++ {\n\t\tif p[i] == q[k-i-1] {\n\t\t\tfmt.Println(p[i] + 1)\n\t\t}\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi has decided to work on K days of his choice from the N days starting with tomorrow.\n\nYou are given an integer C and a string S. Takahashi will choose his workdays as follows:\n\nAfter working for a day, he will refrain from working on the subsequent C days.\n\nIf the i-th character of S is x, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.\n\nFind all days on which Takahashi is bound to work.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq N\n\n0 \\leq C \\leq N\n\nThe length of S is N.\n\nEach character of S is o or x.\n\nTakahashi can choose his workdays so that the conditions in Problem Statement are satisfied.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K C\nS\n\nOutput\n\nPrint all days on which Takahashi is bound to work in ascending order, one per line.\n\nSample Input 1\n\n11 3 2\nooxxxoxxxoo\n\nSample Output 1\n\n6\n\nTakahashi is going to work on 3 days out of the 11 days. After working for a day, he will refrain from working on the subsequent 2 days.\n\nThere are four possible choices for his workdays: Day 1,6,10, Day 1,6,11, Day 2,6,10, and Day 2,6,11.\n\nThus, he is bound to work on Day 6.\n\nSample Input 2\n\n5 2 3\nooxoo\n\nSample Output 2\n\n1\n5\n\nThere is only one possible choice for his workdays: Day 1,5.\n\nSample Input 3\n\n5 1 0\nooooo\n\nSample Output 3\n\nThere may be no days on which he is bound to work.\n\nSample Input 4\n\n16 4 3\nooxxoxoxxxoxoxxo\n\nSample Output 4\n\n11\n16", "sample_input": "11 3 2\nooxxxoxxxoo\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02721", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi has decided to work on K days of his choice from the N days starting with tomorrow.\n\nYou are given an integer C and a string S. Takahashi will choose his workdays as follows:\n\nAfter working for a day, he will refrain from working on the subsequent C days.\n\nIf the i-th character of S is x, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.\n\nFind all days on which Takahashi is bound to work.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq N\n\n0 \\leq C \\leq N\n\nThe length of S is N.\n\nEach character of S is o or x.\n\nTakahashi can choose his workdays so that the conditions in Problem Statement are satisfied.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K C\nS\n\nOutput\n\nPrint all days on which Takahashi is bound to work in ascending order, one per line.\n\nSample Input 1\n\n11 3 2\nooxxxoxxxoo\n\nSample Output 1\n\n6\n\nTakahashi is going to work on 3 days out of the 11 days. After working for a day, he will refrain from working on the subsequent 2 days.\n\nThere are four possible choices for his workdays: Day 1,6,10, Day 1,6,11, Day 2,6,10, and Day 2,6,11.\n\nThus, he is bound to work on Day 6.\n\nSample Input 2\n\n5 2 3\nooxoo\n\nSample Output 2\n\n1\n5\n\nThere is only one possible choice for his workdays: Day 1,5.\n\nSample Input 3\n\n5 1 0\nooooo\n\nSample Output 3\n\nThere may be no days on which he is bound to work.\n\nSample Input 4\n\n16 4 3\nooxxoxoxxxoxoxxo\n\nSample Output 4\n\n11\n16", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1919, "cpu_time_ms": 318, "memory_kb": 7052}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s089138574", "group_id": "codeNet:p02721", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tn, k, c := bs.IntScan(), bs.IntScan(), bs.IntScan()\n\ts := strings.Split(bs.Scan(), \"\")\n\n\tl := make([]string, n)\n\tr := make([]string, n)\n\n\tvar index int\n\tvar lCount int\n\tlPos := []int{}\n\tvar rCount int\n\n\tindex = 0\n\tfor {\n\t\tif s[index] == \"o\" {\n\t\t\tl[index] = \"o\"\n\t\t\tlCount++\n\t\t\tlPos = append(lPos, index)\n\t\t\tindex += c\n\t\t}\n\t\tindex++\n\t\tif index >= n {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tindex = n - 1\n\tfor {\n\t\tif s[index] == \"o\" {\n\t\t\tok := true\n\t\t\tfor i:=1; i<=c; i++ {\n\t\t\t\tif index + i >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif r[index+i] == \"o\" {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\trCount++\n\t\t\t\tr[index] = \"o\"\n\t\t\t}\n\t\t}\n\t\tindex--\n\t\tif index < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif lCount == rCount && lCount == k {\n\t\tfor _, i := range lPos {\n\t\t\tif l[i] == \"o\" && l[i] == r[i] {\n\t\t\t\tbw.Printf(\"%v\\n\", i+1)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "language": "Go", "metadata": {"date": 1586067470, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02721.html", "problem_id": "p02721", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02721/input.txt", "sample_output_relpath": "derived/input_output/data/p02721/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02721/Go/s089138574.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s089138574", "user_id": "u647304231"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tn, k, c := bs.IntScan(), bs.IntScan(), bs.IntScan()\n\ts := strings.Split(bs.Scan(), \"\")\n\n\tl := make([]string, n)\n\tr := make([]string, n)\n\n\tvar index int\n\tvar lCount int\n\tlPos := []int{}\n\tvar rCount int\n\n\tindex = 0\n\tfor {\n\t\tif s[index] == \"o\" {\n\t\t\tl[index] = \"o\"\n\t\t\tlCount++\n\t\t\tlPos = append(lPos, index)\n\t\t\tindex += c\n\t\t}\n\t\tindex++\n\t\tif index >= n {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tindex = n - 1\n\tfor {\n\t\tif s[index] == \"o\" {\n\t\t\tok := true\n\t\t\tfor i:=1; i<=c; i++ {\n\t\t\t\tif index + i >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif r[index+i] == \"o\" {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\trCount++\n\t\t\t\tr[index] = \"o\"\n\t\t\t}\n\t\t}\n\t\tindex--\n\t\tif index < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif lCount == rCount && lCount == k {\n\t\tfor _, i := range lPos {\n\t\t\tif l[i] == \"o\" && l[i] == r[i] {\n\t\t\t\tbw.Printf(\"%v\\n\", i+1)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi has decided to work on K days of his choice from the N days starting with tomorrow.\n\nYou are given an integer C and a string S. Takahashi will choose his workdays as follows:\n\nAfter working for a day, he will refrain from working on the subsequent C days.\n\nIf the i-th character of S is x, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.\n\nFind all days on which Takahashi is bound to work.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq N\n\n0 \\leq C \\leq N\n\nThe length of S is N.\n\nEach character of S is o or x.\n\nTakahashi can choose his workdays so that the conditions in Problem Statement are satisfied.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K C\nS\n\nOutput\n\nPrint all days on which Takahashi is bound to work in ascending order, one per line.\n\nSample Input 1\n\n11 3 2\nooxxxoxxxoo\n\nSample Output 1\n\n6\n\nTakahashi is going to work on 3 days out of the 11 days. After working for a day, he will refrain from working on the subsequent 2 days.\n\nThere are four possible choices for his workdays: Day 1,6,10, Day 1,6,11, Day 2,6,10, and Day 2,6,11.\n\nThus, he is bound to work on Day 6.\n\nSample Input 2\n\n5 2 3\nooxoo\n\nSample Output 2\n\n1\n5\n\nThere is only one possible choice for his workdays: Day 1,5.\n\nSample Input 3\n\n5 1 0\nooooo\n\nSample Output 3\n\nThere may be no days on which he is bound to work.\n\nSample Input 4\n\n16 4 3\nooxxoxoxxxoxoxxo\n\nSample Output 4\n\n11\n16", "sample_input": "11 3 2\nooxxxoxxxoo\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02721", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi has decided to work on K days of his choice from the N days starting with tomorrow.\n\nYou are given an integer C and a string S. Takahashi will choose his workdays as follows:\n\nAfter working for a day, he will refrain from working on the subsequent C days.\n\nIf the i-th character of S is x, he will not work on Day i, where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.\n\nFind all days on which Takahashi is bound to work.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq N\n\n0 \\leq C \\leq N\n\nThe length of S is N.\n\nEach character of S is o or x.\n\nTakahashi can choose his workdays so that the conditions in Problem Statement are satisfied.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K C\nS\n\nOutput\n\nPrint all days on which Takahashi is bound to work in ascending order, one per line.\n\nSample Input 1\n\n11 3 2\nooxxxoxxxoo\n\nSample Output 1\n\n6\n\nTakahashi is going to work on 3 days out of the 11 days. After working for a day, he will refrain from working on the subsequent 2 days.\n\nThere are four possible choices for his workdays: Day 1,6,10, Day 1,6,11, Day 2,6,10, and Day 2,6,11.\n\nThus, he is bound to work on Day 6.\n\nSample Input 2\n\n5 2 3\nooxoo\n\nSample Output 2\n\n1\n5\n\nThere is only one possible choice for his workdays: Day 1,5.\n\nSample Input 3\n\n5 1 0\nooooo\n\nSample Output 3\n\nThere may be no days on which he is bound to work.\n\nSample Input 4\n\n16 4 3\nooxxoxoxxxoxoxxo\n\nSample Output 4\n\n11\n16", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1858, "cpu_time_ms": 1793, "memory_kb": 18304}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s078616489", "group_id": "codeNet:p02723", "input_text": "// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.\n// $ bundle -pkg main -prefix -dst github.com/mpppk/atcoder/abc160/A github.com/mpppk/atcoder/abc160/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc (i *lib_Input) GetIntLines() (newLines [][]int, err error) {\n\treturn i.GetIntLinesFrom(0)\n}\n\nfunc (i *lib_Input) GetIntLinesFrom(fromIndex int) (newLines [][]int, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetIntLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetIntLineRange(fromRowIndex, rangeNum int) (newLines [][]int, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetIntLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetIntLine(index int) ([]int, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToIntSlice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetIntValue(rowIndex, colIndex int) (int, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int(v), nil\n}\n\nfunc (i *lib_Input) GetFirstIntValue(rowIndex int) (int, error) {\n\treturn i.GetIntValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColIntLine(colIndex int) (newLine []int, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToIntSlice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Lines() (newLines [][]int8, err error) {\n\treturn i.GetInt8LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt8LinesFrom(fromIndex int) (newLines [][]int8, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt8Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8LineRange(fromRowIndex, rangeNum int) (newLines [][]int8, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt8Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Line(index int) ([]int8, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt8Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt8Value(rowIndex, colIndex int) (int8, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int8(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt8Value(rowIndex int) (int8, error) {\n\treturn i.GetInt8Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt8Line(colIndex int) (newLine []int8, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt8Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Lines() (newLines [][]int16, err error) {\n\treturn i.GetInt16LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt16LinesFrom(fromIndex int) (newLines [][]int16, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt16Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16LineRange(fromRowIndex, rangeNum int) (newLines [][]int16, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt16Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Line(index int) ([]int16, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt16Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt16Value(rowIndex, colIndex int) (int16, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int16(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt16Value(rowIndex int) (int16, error) {\n\treturn i.GetInt16Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt16Line(colIndex int) (newLine []int16, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt16Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Lines() (newLines [][]int32, err error) {\n\treturn i.GetInt32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt32LinesFrom(fromIndex int) (newLines [][]int32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32LineRange(fromRowIndex, rangeNum int) (newLines [][]int32, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Line(index int) ([]int32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt32Value(rowIndex, colIndex int) (int32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt32Value(rowIndex int) (int32, error) {\n\treturn i.GetInt32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt32Line(colIndex int) (newLine []int32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Lines() (newLines [][]int64, err error) {\n\treturn i.GetInt64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt64LinesFrom(fromIndex int) (newLines [][]int64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64LineRange(fromRowIndex, rangeNum int) (newLines [][]int64, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Line(index int) ([]int64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt64Value(rowIndex, colIndex int) (int64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt64Value(rowIndex int) (int64, error) {\n\treturn i.GetInt64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt64Line(colIndex int) (newLine []int64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Lines() (newLines [][]float32, err error) {\n\treturn i.GetFloat32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat32LinesFrom(fromIndex int) (newLines [][]float32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32LineRange(fromRowIndex, rangeNum int) (newLines [][]float32, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Line(index int) ([]float32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat32Value(rowIndex, colIndex int) (float32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat32Value(rowIndex int) (float32, error) {\n\treturn i.GetFloat32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat32Line(colIndex int) (newLine []float32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Lines() (newLines [][]float64, err error) {\n\treturn i.GetFloat64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat64LinesFrom(fromIndex int) (newLines [][]float64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64LineRange(fromRowIndex, rangeNum int) (newLines [][]float64, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Line(index int) ([]float64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat64Value(rowIndex, colIndex int) (float64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat64Value(rowIndex int) (float64, error) {\n\treturn i.GetFloat64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat64Line(colIndex int) (newLine []float64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc lib_IntToBits(value int, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int8ToBits(value int8, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int16ToBits(value int16, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int32ToBits(value int32, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int64ToBits(value int64, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_GetEachDigitSumInt(n int) (sum int) {\n\tfor _, digit := range lib_ToDigitSliceInt(n) {\n\t\tsum += int(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt(n int) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt(digits []int8) int {\n\tv := int(0)\n\tfor i, digit := range digits {\n\t\tv += int(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt8(n int8) (sum int8) {\n\tfor _, digit := range lib_ToDigitSliceInt8(n) {\n\t\tsum += int8(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt8(n int8) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt8(digits []int8) int8 {\n\tv := int8(0)\n\tfor i, digit := range digits {\n\t\tv += int8(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt16(n int16) (sum int16) {\n\tfor _, digit := range lib_ToDigitSliceInt16(n) {\n\t\tsum += int16(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt16(n int16) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt16(digits []int8) int16 {\n\tv := int16(0)\n\tfor i, digit := range digits {\n\t\tv += int16(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt32(n int32) (sum int32) {\n\tfor _, digit := range lib_ToDigitSliceInt32(n) {\n\t\tsum += int32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt32(n int32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt32(digits []int8) int32 {\n\tv := int32(0)\n\tfor i, digit := range digits {\n\t\tv += int32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt64(n int64) (sum int64) {\n\tfor _, digit := range lib_ToDigitSliceInt64(n) {\n\t\tsum += int64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt64(n int64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt64(digits []int8) int64 {\n\tv := int64(0)\n\tfor i, digit := range digits {\n\t\tv += int64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat32(n float32) (sum float32) {\n\tfor _, digit := range lib_ToDigitSliceFloat32(n) {\n\t\tsum += float32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat32(n float32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat32(digits []int8) float32 {\n\tv := float32(0)\n\tfor i, digit := range digits {\n\t\tv += float32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat64(n float64) (sum float64) {\n\tfor _, digit := range lib_ToDigitSliceFloat64(n) {\n\t\tsum += float64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat64(n float64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat64(digits []int8) float64 {\n\tv := float64(0)\n\tfor i, digit := range digits {\n\t\tv += float64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_SumInt(values []int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt(values []int, f func(v int) bool) (newValues []int) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterIntSlice(values [][]int, f func(v []int) bool) (newValues [][]int) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt(values []int) (newValues []int) {\n\tm := map[int]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt(values1 []int, values2 []int) (newValues []int, err error) {\n\treturn lib_SubtractIntBy(values1, values2, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffIntBy(values []int, f func(v int) int) (newValues []int, err error) {\n\tdiffValues := append([]int{0}, values...)\n\tnewValues, err = lib_SubtractIntBy(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt(values []int) (newValues []int, err error) {\n\treturn lib_RDiffIntBy(values, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToIntSlice(s string) (ValueLine []int, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToIntSlice(line []string) (ValueLine []int, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt(values []int) (max int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxIntVA(values ...int) (max int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt(values []int) (min int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewIntGridMap(grid [][]string, defaultValue int) (m [][]int) {\n\tfor _, line := range grid {\n\t\tvar newLine []int\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_IntRange(start, end, step int) []int {\n\tif end < start {\n\t\treturn []int{}\n\t}\n\ts := make([]int, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt8(values []int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt8(values []int8, f func(v int8) bool) (newValues []int8) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt8Slice(values [][]int8, f func(v []int8) bool) (newValues [][]int8) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt8(values []int8) (newValues []int8) {\n\tm := map[int8]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt8(values1 []int8, values2 []int8) (newValues []int8, err error) {\n\treturn lib_SubtractInt8By(values1, values2, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tdiffValues := append([]int8{0}, values...)\n\tnewValues, err = lib_SubtractInt8By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt8(values []int8) (newValues []int8, err error) {\n\treturn lib_RDiffInt8By(values, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt8Slice(s string) (ValueLine []int8, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt8Slice(line []string) (ValueLine []int8, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8(values []int8) (max int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8VA(values ...int8) (max int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt8(values []int8) (min int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt8GridMap(grid [][]string, defaultValue int8) (m [][]int8) {\n\tfor _, line := range grid {\n\t\tvar newLine []int8\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int8Range(start, end, step int8) []int8 {\n\tif end < start {\n\t\treturn []int8{}\n\t}\n\ts := make([]int8, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt16(values []int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt16(values []int16, f func(v int16) bool) (newValues []int16) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt16Slice(values [][]int16, f func(v []int16) bool) (newValues [][]int16) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt16(values []int16) (newValues []int16) {\n\tm := map[int16]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt16(values1 []int16, values2 []int16) (newValues []int16, err error) {\n\treturn lib_SubtractInt16By(values1, values2, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tdiffValues := append([]int16{0}, values...)\n\tnewValues, err = lib_SubtractInt16By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt16(values []int16) (newValues []int16, err error) {\n\treturn lib_RDiffInt16By(values, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt16Slice(s string) (ValueLine []int16, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt16Slice(line []string) (ValueLine []int16, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16(values []int16) (max int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16VA(values ...int16) (max int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt16(values []int16) (min int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt16GridMap(grid [][]string, defaultValue int16) (m [][]int16) {\n\tfor _, line := range grid {\n\t\tvar newLine []int16\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int16Range(start, end, step int16) []int16 {\n\tif end < start {\n\t\treturn []int16{}\n\t}\n\ts := make([]int16, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt32(values []int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt32(values []int32, f func(v int32) bool) (newValues []int32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt32Slice(values [][]int32, f func(v []int32) bool) (newValues [][]int32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt32(values []int32) (newValues []int32) {\n\tm := map[int32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt32(values1 []int32, values2 []int32) (newValues []int32, err error) {\n\treturn lib_SubtractInt32By(values1, values2, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tdiffValues := append([]int32{0}, values...)\n\tnewValues, err = lib_SubtractInt32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt32(values []int32) (newValues []int32, err error) {\n\treturn lib_RDiffInt32By(values, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt32Slice(s string) (ValueLine []int32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt32Slice(line []string) (ValueLine []int32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32(values []int32) (max int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32VA(values ...int32) (max int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt32(values []int32) (min int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt32GridMap(grid [][]string, defaultValue int32) (m [][]int32) {\n\tfor _, line := range grid {\n\t\tvar newLine []int32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int32Range(start, end, step int32) []int32 {\n\tif end < start {\n\t\treturn []int32{}\n\t}\n\ts := make([]int32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt64(values []int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt64(values []int64, f func(v int64) bool) (newValues []int64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt64Slice(values [][]int64, f func(v []int64) bool) (newValues [][]int64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt64(values []int64) (newValues []int64) {\n\tm := map[int64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt64(values1 []int64, values2 []int64) (newValues []int64, err error) {\n\treturn lib_SubtractInt64By(values1, values2, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tdiffValues := append([]int64{0}, values...)\n\tnewValues, err = lib_SubtractInt64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt64(values []int64) (newValues []int64, err error) {\n\treturn lib_RDiffInt64By(values, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt64Slice(s string) (ValueLine []int64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt64Slice(line []string) (ValueLine []int64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64(values []int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64VA(values ...int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt64(values []int64) (min int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt64GridMap(grid [][]string, defaultValue int64) (m [][]int64) {\n\tfor _, line := range grid {\n\t\tvar newLine []int64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int64Range(start, end, step int64) []int64 {\n\tif end < start {\n\t\treturn []int64{}\n\t}\n\ts := make([]int64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat32(values []float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat32(values []float32, f func(v float32) bool) (newValues []float32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterFloat32Slice(values [][]float32, f func(v []float32) bool) (newValues [][]float32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat32(values []float32) (newValues []float32) {\n\tm := map[float32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat32(values1 []float32, values2 []float32) (newValues []float32, err error) {\n\treturn lib_SubtractFloat32By(values1, values2, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tdiffValues := append([]float32{0}, values...)\n\tnewValues, err = lib_SubtractFloat32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat32(values []float32) (newValues []float32, err error) {\n\treturn lib_RDiffFloat32By(values, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat32Slice(s string) (ValueLine []float32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat32Slice(line []string) (ValueLine []float32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32(values []float32) (max float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32VA(values ...float32) (max float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat32(values []float32) (min float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat32GridMap(grid [][]string, defaultValue float32) (m [][]float32) {\n\tfor _, line := range grid {\n\t\tvar newLine []float32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float32Range(start, end, step float32) []float32 {\n\tif end < start {\n\t\treturn []float32{}\n\t}\n\ts := make([]float32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat64(values []float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat64(values []float64, f func(v float64) bool) (newValues []float64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterFloat64Slice(values [][]float64, f func(v []float64) bool) (newValues [][]float64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat64(values []float64) (newValues []float64) {\n\tm := map[float64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat64(values1 []float64, values2 []float64) (newValues []float64, err error) {\n\treturn lib_SubtractFloat64By(values1, values2, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tdiffValues := append([]float64{0}, values...)\n\tnewValues, err = lib_SubtractFloat64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat64(values []float64) (newValues []float64, err error) {\n\treturn lib_RDiffFloat64By(values, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat64Slice(s string) (ValueLine []float64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat64Slice(line []string) (ValueLine []float64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64(values []float64) (max float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64VA(values ...float64) (max float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat64(values []float64) (min float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat64GridMap(grid [][]string, defaultValue float64) (m [][]float64) {\n\tfor _, line := range grid {\n\t\tvar newLine []float64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float64Range(start, end, step float64) []float64 {\n\tif end < start {\n\t\treturn []float64{}\n\t}\n\ts := make([]float64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\ntype lib_Int3ToIntCache map[int]map[int]map[int]int\n\nfunc (c lib_Int3ToIntCache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToIntCache) Get(k1, k2, k3 int) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToIntCache) Set(k1, k2, k3 int, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt(values []int, f func(v int) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToIntSlice(values []int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt(values [][][]int, f func(v [][]int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSliceToInt(values, f))\n}\n\nfunc lib_MaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSlice2ToInt(values, f))\n}\n\ntype lib_Int83ToIntCache map[int8]map[int8]map[int8]int\n\nfunc (c lib_Int83ToIntCache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToIntCache) Get(k1, k2, k3 int8) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToIntCache) Set(k1, k2, k3 int8, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt8(values []int, f func(v int) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt8Slice(values []int) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt(values [][]int8, f func(v []int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt(values [][][]int8, f func(v [][]int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8Slice2ToInt(values, f))\n}\n\ntype lib_Int163ToIntCache map[int16]map[int16]map[int16]int\n\nfunc (c lib_Int163ToIntCache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToIntCache) Get(k1, k2, k3 int16) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToIntCache) Set(k1, k2, k3 int16, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt16(values []int, f func(v int) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt16Slice(values []int) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt(values [][]int16, f func(v []int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt(values [][][]int16, f func(v [][]int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16Slice2ToInt(values, f))\n}\n\ntype lib_Int323ToIntCache map[int32]map[int32]map[int32]int\n\nfunc (c lib_Int323ToIntCache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToIntCache) Get(k1, k2, k3 int32) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToIntCache) Set(k1, k2, k3 int32, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt32(values []int, f func(v int) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt32Slice(values []int) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt(values [][]int32, f func(v []int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt(values [][][]int32, f func(v [][]int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32Slice2ToInt(values, f))\n}\n\ntype lib_Int643ToIntCache map[int64]map[int64]map[int64]int\n\nfunc (c lib_Int643ToIntCache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToIntCache) Get(k1, k2, k3 int64) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToIntCache) Set(k1, k2, k3 int64, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt64(values []int, f func(v int) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt64Slice(values []int) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt(values [][]int64, f func(v []int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt(values [][][]int64, f func(v [][]int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64Slice2ToInt(values, f))\n}\n\ntype lib_Float323ToIntCache map[float32]map[float32]map[float32]int\n\nfunc (c lib_Float323ToIntCache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToIntCache) Get(k1, k2, k3 float32) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToIntCache) Set(k1, k2, k3 float32, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByFloat32(values []int, f func(v int) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat32Slice(values []int) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt(values [][]float32, f func(v []float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt(values [][][]float32, f func(v [][]float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32Slice2ToInt(values, f))\n}\n\ntype lib_Float643ToIntCache map[float64]map[float64]map[float64]int\n\nfunc (c lib_Float643ToIntCache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToIntCache) Get(k1, k2, k3 float64) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToIntCache) Set(k1, k2, k3 float64, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByFloat64(values []int, f func(v int) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat64Slice(values []int) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt(values [][]float64, f func(v []float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt(values [][][]float64, f func(v [][]float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64Slice2ToInt(values, f))\n}\n\ntype lib_Int3ToInt8Cache map[int]map[int]map[int]int8\n\nfunc (c lib_Int3ToInt8Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt8Cache) Get(k1, k2, k3 int) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt8Cache) Set(k1, k2, k3 int, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt(values []int8, f func(v int8) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToIntSlice(values []int8) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt8(values [][]int, f func(v []int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt8(values [][][]int, f func(v [][]int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSlice2ToInt8(values, f))\n}\n\ntype lib_Int83ToInt8Cache map[int8]map[int8]map[int8]int8\n\nfunc (c lib_Int83ToInt8Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt8Cache) Get(k1, k2, k3 int8) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt8Cache) Set(k1, k2, k3 int8, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt8(values []int8, f func(v int8) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt8Slice(values []int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt8(values [][][]int8, f func(v [][]int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8Slice2ToInt8(values, f))\n}\n\ntype lib_Int163ToInt8Cache map[int16]map[int16]map[int16]int8\n\nfunc (c lib_Int163ToInt8Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt8Cache) Get(k1, k2, k3 int16) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt8Cache) Set(k1, k2, k3 int16, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt16(values []int8, f func(v int8) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt16Slice(values []int8) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt8(values [][]int16, f func(v []int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt8(values [][][]int16, f func(v [][]int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16Slice2ToInt8(values, f))\n}\n\ntype lib_Int323ToInt8Cache map[int32]map[int32]map[int32]int8\n\nfunc (c lib_Int323ToInt8Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt8Cache) Get(k1, k2, k3 int32) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt8Cache) Set(k1, k2, k3 int32, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt32(values []int8, f func(v int8) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt32Slice(values []int8) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt8(values [][]int32, f func(v []int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt8(values [][][]int32, f func(v [][]int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32Slice2ToInt8(values, f))\n}\n\ntype lib_Int643ToInt8Cache map[int64]map[int64]map[int64]int8\n\nfunc (c lib_Int643ToInt8Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt8Cache) Get(k1, k2, k3 int64) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt8Cache) Set(k1, k2, k3 int64, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt64(values []int8, f func(v int8) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt64Slice(values []int8) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt8(values [][]int64, f func(v []int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt8(values [][][]int64, f func(v [][]int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64Slice2ToInt8(values, f))\n}\n\ntype lib_Float323ToInt8Cache map[float32]map[float32]map[float32]int8\n\nfunc (c lib_Float323ToInt8Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt8Cache) Get(k1, k2, k3 float32) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt8Cache) Set(k1, k2, k3 float32, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByFloat32(values []int8, f func(v int8) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat32Slice(values []int8) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt8(values [][]float32, f func(v []float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt8(values [][][]float32, f func(v [][]float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32Slice2ToInt8(values, f))\n}\n\ntype lib_Float643ToInt8Cache map[float64]map[float64]map[float64]int8\n\nfunc (c lib_Float643ToInt8Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt8Cache) Get(k1, k2, k3 float64) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt8Cache) Set(k1, k2, k3 float64, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByFloat64(values []int8, f func(v int8) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat64Slice(values []int8) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt8(values [][]float64, f func(v []float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt8(values [][][]float64, f func(v [][]float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64Slice2ToInt8(values, f))\n}\n\ntype lib_Int3ToInt16Cache map[int]map[int]map[int]int16\n\nfunc (c lib_Int3ToInt16Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt16Cache) Get(k1, k2, k3 int) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt16Cache) Set(k1, k2, k3 int, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt(values []int16, f func(v int16) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToIntSlice(values []int16) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt16(values [][]int, f func(v []int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt16(values [][][]int, f func(v [][]int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSlice2ToInt16(values, f))\n}\n\ntype lib_Int83ToInt16Cache map[int8]map[int8]map[int8]int16\n\nfunc (c lib_Int83ToInt16Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt16Cache) Get(k1, k2, k3 int8) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt16Cache) Set(k1, k2, k3 int8, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt8(values []int16, f func(v int16) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt8Slice(values []int16) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt16(values [][]int8, f func(v []int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt16(values [][][]int8, f func(v [][]int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8Slice2ToInt16(values, f))\n}\n\ntype lib_Int163ToInt16Cache map[int16]map[int16]map[int16]int16\n\nfunc (c lib_Int163ToInt16Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt16Cache) Get(k1, k2, k3 int16) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt16Cache) Set(k1, k2, k3 int16, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt16(values []int16, f func(v int16) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt16Slice(values []int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt16(values [][][]int16, f func(v [][]int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16Slice2ToInt16(values, f))\n}\n\ntype lib_Int323ToInt16Cache map[int32]map[int32]map[int32]int16\n\nfunc (c lib_Int323ToInt16Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt16Cache) Get(k1, k2, k3 int32) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt16Cache) Set(k1, k2, k3 int32, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt32(values []int16, f func(v int16) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt32Slice(values []int16) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt16(values [][]int32, f func(v []int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt16(values [][][]int32, f func(v [][]int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32Slice2ToInt16(values, f))\n}\n\ntype lib_Int643ToInt16Cache map[int64]map[int64]map[int64]int16\n\nfunc (c lib_Int643ToInt16Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt16Cache) Get(k1, k2, k3 int64) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt16Cache) Set(k1, k2, k3 int64, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt64(values []int16, f func(v int16) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt64Slice(values []int16) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt16(values [][]int64, f func(v []int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt16(values [][][]int64, f func(v [][]int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64Slice2ToInt16(values, f))\n}\n\ntype lib_Float323ToInt16Cache map[float32]map[float32]map[float32]int16\n\nfunc (c lib_Float323ToInt16Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt16Cache) Get(k1, k2, k3 float32) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt16Cache) Set(k1, k2, k3 float32, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByFloat32(values []int16, f func(v int16) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat32Slice(values []int16) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt16(values [][]float32, f func(v []float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt16(values [][][]float32, f func(v [][]float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32Slice2ToInt16(values, f))\n}\n\ntype lib_Float643ToInt16Cache map[float64]map[float64]map[float64]int16\n\nfunc (c lib_Float643ToInt16Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt16Cache) Get(k1, k2, k3 float64) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt16Cache) Set(k1, k2, k3 float64, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByFloat64(values []int16, f func(v int16) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat64Slice(values []int16) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt16(values [][]float64, f func(v []float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt16(values [][][]float64, f func(v [][]float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64Slice2ToInt16(values, f))\n}\n\ntype lib_Int3ToInt32Cache map[int]map[int]map[int]int32\n\nfunc (c lib_Int3ToInt32Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt32Cache) Get(k1, k2, k3 int) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt32Cache) Set(k1, k2, k3 int, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt(values []int32, f func(v int32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToIntSlice(values []int32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt32(values [][]int, f func(v []int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt32(values [][][]int, f func(v [][]int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSlice2ToInt32(values, f))\n}\n\ntype lib_Int83ToInt32Cache map[int8]map[int8]map[int8]int32\n\nfunc (c lib_Int83ToInt32Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt32Cache) Get(k1, k2, k3 int8) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt32Cache) Set(k1, k2, k3 int8, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt8(values []int32, f func(v int32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt8Slice(values []int32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt32(values [][]int8, f func(v []int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt32(values [][][]int8, f func(v [][]int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8Slice2ToInt32(values, f))\n}\n\ntype lib_Int163ToInt32Cache map[int16]map[int16]map[int16]int32\n\nfunc (c lib_Int163ToInt32Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt32Cache) Get(k1, k2, k3 int16) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt32Cache) Set(k1, k2, k3 int16, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt16(values []int32, f func(v int32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt16Slice(values []int32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt32(values [][]int16, f func(v []int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt32(values [][][]int16, f func(v [][]int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16Slice2ToInt32(values, f))\n}\n\ntype lib_Int323ToInt32Cache map[int32]map[int32]map[int32]int32\n\nfunc (c lib_Int323ToInt32Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt32Cache) Get(k1, k2, k3 int32) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt32Cache) Set(k1, k2, k3 int32, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt32(values []int32, f func(v int32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt32Slice(values []int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt32(values [][][]int32, f func(v [][]int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32Slice2ToInt32(values, f))\n}\n\ntype lib_Int643ToInt32Cache map[int64]map[int64]map[int64]int32\n\nfunc (c lib_Int643ToInt32Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt32Cache) Get(k1, k2, k3 int64) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt32Cache) Set(k1, k2, k3 int64, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt64(values []int32, f func(v int32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt64Slice(values []int32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt32(values [][]int64, f func(v []int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt32(values [][][]int64, f func(v [][]int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64Slice2ToInt32(values, f))\n}\n\ntype lib_Float323ToInt32Cache map[float32]map[float32]map[float32]int32\n\nfunc (c lib_Float323ToInt32Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt32Cache) Get(k1, k2, k3 float32) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt32Cache) Set(k1, k2, k3 float32, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByFloat32(values []int32, f func(v int32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat32Slice(values []int32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt32(values [][]float32, f func(v []float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt32(values [][][]float32, f func(v [][]float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32Slice2ToInt32(values, f))\n}\n\ntype lib_Float643ToInt32Cache map[float64]map[float64]map[float64]int32\n\nfunc (c lib_Float643ToInt32Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt32Cache) Get(k1, k2, k3 float64) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt32Cache) Set(k1, k2, k3 float64, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByFloat64(values []int32, f func(v int32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat64Slice(values []int32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt32(values [][]float64, f func(v []float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt32(values [][][]float64, f func(v [][]float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64Slice2ToInt32(values, f))\n}\n\ntype lib_Int3ToInt64Cache map[int]map[int]map[int]int64\n\nfunc (c lib_Int3ToInt64Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt64Cache) Get(k1, k2, k3 int) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt64Cache) Set(k1, k2, k3 int, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt(values []int64, f func(v int64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToIntSlice(values []int64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt64(values [][]int, f func(v []int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt64(values [][][]int, f func(v [][]int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSlice2ToInt64(values, f))\n}\n\ntype lib_Int83ToInt64Cache map[int8]map[int8]map[int8]int64\n\nfunc (c lib_Int83ToInt64Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt64Cache) Get(k1, k2, k3 int8) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt64Cache) Set(k1, k2, k3 int8, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt8(values []int64, f func(v int64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt8Slice(values []int64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt64(values [][]int8, f func(v []int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt64(values [][][]int8, f func(v [][]int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8Slice2ToInt64(values, f))\n}\n\ntype lib_Int163ToInt64Cache map[int16]map[int16]map[int16]int64\n\nfunc (c lib_Int163ToInt64Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt64Cache) Get(k1, k2, k3 int16) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt64Cache) Set(k1, k2, k3 int16, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt16(values []int64, f func(v int64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt16Slice(values []int64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt64(values [][]int16, f func(v []int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt64(values [][][]int16, f func(v [][]int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16Slice2ToInt64(values, f))\n}\n\ntype lib_Int323ToInt64Cache map[int32]map[int32]map[int32]int64\n\nfunc (c lib_Int323ToInt64Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt64Cache) Get(k1, k2, k3 int32) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt64Cache) Set(k1, k2, k3 int32, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt32(values []int64, f func(v int64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt32Slice(values []int64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt64(values [][]int32, f func(v []int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt64(values [][][]int32, f func(v [][]int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32Slice2ToInt64(values, f))\n}\n\ntype lib_Int643ToInt64Cache map[int64]map[int64]map[int64]int64\n\nfunc (c lib_Int643ToInt64Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt64Cache) Get(k1, k2, k3 int64) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt64Cache) Set(k1, k2, k3 int64, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt64(values []int64, f func(v int64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt64Slice(values []int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt64(values [][][]int64, f func(v [][]int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64Slice2ToInt64(values, f))\n}\n\ntype lib_Float323ToInt64Cache map[float32]map[float32]map[float32]int64\n\nfunc (c lib_Float323ToInt64Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt64Cache) Get(k1, k2, k3 float32) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt64Cache) Set(k1, k2, k3 float32, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByFloat32(values []int64, f func(v int64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat32Slice(values []int64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt64(values [][]float32, f func(v []float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt64(values [][][]float32, f func(v [][]float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32Slice2ToInt64(values, f))\n}\n\ntype lib_Float643ToInt64Cache map[float64]map[float64]map[float64]int64\n\nfunc (c lib_Float643ToInt64Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt64Cache) Get(k1, k2, k3 float64) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt64Cache) Set(k1, k2, k3 float64, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByFloat64(values []int64, f func(v int64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat64Slice(values []int64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt64(values [][]float64, f func(v []float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt64(values [][][]float64, f func(v [][]float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64Slice2ToInt64(values, f))\n}\n\ntype lib_Int3ToFloat32Cache map[int]map[int]map[int]float32\n\nfunc (c lib_Int3ToFloat32Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToFloat32Cache) Get(k1, k2, k3 int) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToFloat32Cache) Set(k1, k2, k3 int, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt(values []float32, f func(v float32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToIntSlice(values []float32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat32(values [][]int, f func(v []int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat32(values [][][]int, f func(v [][]int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSlice2ToFloat32(values, f))\n}\n\ntype lib_Int83ToFloat32Cache map[int8]map[int8]map[int8]float32\n\nfunc (c lib_Int83ToFloat32Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToFloat32Cache) Get(k1, k2, k3 int8) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToFloat32Cache) Set(k1, k2, k3 int8, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt8(values []float32, f func(v float32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt8Slice(values []float32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat32(values [][]int8, f func(v []int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat32(values [][][]int8, f func(v [][]int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8Slice2ToFloat32(values, f))\n}\n\ntype lib_Int163ToFloat32Cache map[int16]map[int16]map[int16]float32\n\nfunc (c lib_Int163ToFloat32Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToFloat32Cache) Get(k1, k2, k3 int16) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToFloat32Cache) Set(k1, k2, k3 int16, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt16(values []float32, f func(v float32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt16Slice(values []float32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat32(values [][]int16, f func(v []int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat32(values [][][]int16, f func(v [][]int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16Slice2ToFloat32(values, f))\n}\n\ntype lib_Int323ToFloat32Cache map[int32]map[int32]map[int32]float32\n\nfunc (c lib_Int323ToFloat32Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToFloat32Cache) Get(k1, k2, k3 int32) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToFloat32Cache) Set(k1, k2, k3 int32, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt32(values []float32, f func(v float32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt32Slice(values []float32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat32(values [][]int32, f func(v []int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat32(values [][][]int32, f func(v [][]int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32Slice2ToFloat32(values, f))\n}\n\ntype lib_Int643ToFloat32Cache map[int64]map[int64]map[int64]float32\n\nfunc (c lib_Int643ToFloat32Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToFloat32Cache) Get(k1, k2, k3 int64) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToFloat32Cache) Set(k1, k2, k3 int64, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt64(values []float32, f func(v float32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt64Slice(values []float32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat32(values [][]int64, f func(v []int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat32(values [][][]int64, f func(v [][]int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64Slice2ToFloat32(values, f))\n}\n\ntype lib_Float323ToFloat32Cache map[float32]map[float32]map[float32]float32\n\nfunc (c lib_Float323ToFloat32Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToFloat32Cache) Get(k1, k2, k3 float32) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToFloat32Cache) Set(k1, k2, k3 float32, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByFloat32(values []float32, f func(v float32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat32Slice(values []float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat32(values [][][]float32, f func(v [][]float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32Slice2ToFloat32(values, f))\n}\n\ntype lib_Float643ToFloat32Cache map[float64]map[float64]map[float64]float32\n\nfunc (c lib_Float643ToFloat32Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToFloat32Cache) Get(k1, k2, k3 float64) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToFloat32Cache) Set(k1, k2, k3 float64, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByFloat64(values []float32, f func(v float32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat64Slice(values []float32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat32(values [][]float64, f func(v []float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat32(values [][][]float64, f func(v [][]float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64Slice2ToFloat32(values, f))\n}\n\ntype lib_Int3ToFloat64Cache map[int]map[int]map[int]float64\n\nfunc (c lib_Int3ToFloat64Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToFloat64Cache) Get(k1, k2, k3 int) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToFloat64Cache) Set(k1, k2, k3 int, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt(values []float64, f func(v float64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToIntSlice(values []float64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat64(values [][]int, f func(v []int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat64(values [][][]int, f func(v [][]int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSlice2ToFloat64(values, f))\n}\n\ntype lib_Int83ToFloat64Cache map[int8]map[int8]map[int8]float64\n\nfunc (c lib_Int83ToFloat64Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToFloat64Cache) Get(k1, k2, k3 int8) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToFloat64Cache) Set(k1, k2, k3 int8, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt8(values []float64, f func(v float64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt8Slice(values []float64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat64(values [][]int8, f func(v []int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat64(values [][][]int8, f func(v [][]int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8Slice2ToFloat64(values, f))\n}\n\ntype lib_Int163ToFloat64Cache map[int16]map[int16]map[int16]float64\n\nfunc (c lib_Int163ToFloat64Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToFloat64Cache) Get(k1, k2, k3 int16) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToFloat64Cache) Set(k1, k2, k3 int16, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt16(values []float64, f func(v float64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt16Slice(values []float64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat64(values [][]int16, f func(v []int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat64(values [][][]int16, f func(v [][]int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16Slice2ToFloat64(values, f))\n}\n\ntype lib_Int323ToFloat64Cache map[int32]map[int32]map[int32]float64\n\nfunc (c lib_Int323ToFloat64Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToFloat64Cache) Get(k1, k2, k3 int32) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToFloat64Cache) Set(k1, k2, k3 int32, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt32(values []float64, f func(v float64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt32Slice(values []float64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat64(values [][]int32, f func(v []int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat64(values [][][]int32, f func(v [][]int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32Slice2ToFloat64(values, f))\n}\n\ntype lib_Int643ToFloat64Cache map[int64]map[int64]map[int64]float64\n\nfunc (c lib_Int643ToFloat64Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToFloat64Cache) Get(k1, k2, k3 int64) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToFloat64Cache) Set(k1, k2, k3 int64, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt64(values []float64, f func(v float64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt64Slice(values []float64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat64(values [][]int64, f func(v []int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat64(values [][][]int64, f func(v [][]int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64Slice2ToFloat64(values, f))\n}\n\ntype lib_Float323ToFloat64Cache map[float32]map[float32]map[float32]float64\n\nfunc (c lib_Float323ToFloat64Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToFloat64Cache) Get(k1, k2, k3 float32) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToFloat64Cache) Set(k1, k2, k3 float32, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByFloat32(values []float64, f func(v float64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat32Slice(values []float64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat64(values [][]float32, f func(v []float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat64(values [][][]float32, f func(v [][]float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32Slice2ToFloat64(values, f))\n}\n\ntype lib_Float643ToFloat64Cache map[float64]map[float64]map[float64]float64\n\nfunc (c lib_Float643ToFloat64Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToFloat64Cache) Get(k1, k2, k3 float64) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToFloat64Cache) Set(k1, k2, k3 float64, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByFloat64(values []float64, f func(v float64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat64Slice(values []float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat64(values [][][]float64, f func(v [][]float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64Slice2ToFloat64(values, f))\n}\n\nfunc lib_ReduceRune(values []rune, f func(acc, cur rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceRuneSlice(values [][]rune, f func(acc rune, cur []rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyRune(values []rune) []rune {\n\tdst := make([]rune, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyRuneSlice(values [][]rune) [][]rune {\n\tdst := make([][]rune, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyRune(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseRune(values []rune) []rune {\n\tnewValues := lib_CopyRune(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseRuneSlice(values [][]rune) [][]rune {\n\tnewValues := lib_CopyRuneSlice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapRune(values []rune, f func(v rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapRuneSlice(values [][]rune, f func(v []rune) []rune) (newValues [][]rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeRune(values [][]rune, f func(v []rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipRune(valuesList ...[]rune) (newValuesList [][]rune, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipRune\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipRune\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []rune\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []rune\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []rune{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetRune(values []rune, i int) ([]rune, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []rune{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]rune, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_RuneCombination(values []rune, r int) (combinations [][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_RuneCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RunePermutation(values []rune, r int) (permutations [][]rune) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_RuneRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_RunePermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneSliceCombination(values [][]rune, r int) (combinations [][][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_RuneSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneRemoveFromSlice(slice []rune, i int) []rune {\n\tn := make([]rune, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPRune(ok bool, v1, v2 rune) rune {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindRune struct {\n\tnodes map[rune]rune\n}\n\nfunc lib_NewUnionFindRune(values []rune) *lib_UnionFindRune {\n\tm := map[rune]rune{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindRune{nodes: m}\n}\n\nfunc (u *lib_UnionFindRune) GetRoot(value rune) (rune, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindRune) Unite(v1, v2 rune) (rune, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindRune) IsSameGroup(v1, v2 rune) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeRune(f func(v rune) rune) func(v rune) rune {\n\tcache := map[rune]rune{}\n\treturn func(v rune) rune {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceString(values []string, f func(acc, cur string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceStringSlice(values [][]string, f func(acc string, cur []string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyString(values []string) []string {\n\tdst := make([]string, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyStringSlice(values [][]string) [][]string {\n\tdst := make([][]string, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyString(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseString(values []string) []string {\n\tnewValues := lib_CopyString(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseStringSlice(values [][]string) [][]string {\n\tnewValues := lib_CopyStringSlice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapString(values []string, f func(v string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapStringSlice(values [][]string, f func(v []string) []string) (newValues [][]string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeString(values [][]string, f func(v []string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipString(valuesList ...[]string) (newValuesList [][]string, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipString\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipString\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []string\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkStringByBits(values []string, bits []bool) (newValues [][]string, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []string\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []string{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetString(values []string, i int) ([]string, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []string{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]string, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_StringCombination(values []string, r int) (combinations [][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_StringCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringPermutation(values []string, r int) (permutations [][]string) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_StringRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_StringPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringSliceCombination(values [][]string, r int) (combinations [][][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_StringSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringRemoveFromSlice(slice []string, i int) []string {\n\tn := make([]string, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPString(ok bool, v1, v2 string) string {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindString struct {\n\tnodes map[string]string\n}\n\nfunc lib_NewUnionFindString(values []string) *lib_UnionFindString {\n\tm := map[string]string{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindString{nodes: m}\n}\n\nfunc (u *lib_UnionFindString) GetRoot(value string) (string, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindString) Unite(v1, v2 string) (string, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindString) IsSameGroup(v1, v2 string) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeString(f func(v string) string) func(v string) string {\n\tcache := map[string]string{}\n\treturn func(v string) string {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt(values []int, f func(acc, cur int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceIntSlice(values [][]int, f func(acc int, cur []int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt(values []int) []int {\n\tdst := make([]int, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyIntSlice(values [][]int) [][]int {\n\tdst := make([][]int, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt(values []int) []int {\n\tnewValues := lib_CopyInt(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseIntSlice(values [][]int) [][]int {\n\tnewValues := lib_CopyIntSlice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt(values []int, f func(v int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice(values [][]int, f func(v []int) []int) (newValues [][]int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt(valuesList ...[]int) (newValuesList [][]int, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkIntByBits(values []int, bits []bool) (newValues [][]int, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt(values []int, i int) ([]int, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_IntCombination(values []int, r int) (combinations [][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_IntCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntPermutation(values []int, r int) (permutations [][]int) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_IntRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_IntPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntSliceCombination(values [][]int, r int) (combinations [][][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_IntSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntRemoveFromSlice(slice []int, i int) []int {\n\tn := make([]int, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt(ok bool, v1, v2 int) int {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt struct {\n\tnodes map[int]int\n}\n\nfunc lib_NewUnionFindInt(values []int) *lib_UnionFindInt {\n\tm := map[int]int{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt) GetRoot(value int) (int, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt) Unite(v1, v2 int) (int, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt) IsSameGroup(v1, v2 int) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt(f func(v int) int) func(v int) int {\n\tcache := map[int]int{}\n\treturn func(v int) int {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt8(values []int8, f func(acc, cur int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt8Slice(values [][]int8, f func(acc int8, cur []int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt8(values []int8) []int8 {\n\tdst := make([]int8, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt8Slice(values [][]int8) [][]int8 {\n\tdst := make([][]int8, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt8(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt8(values []int8) []int8 {\n\tnewValues := lib_CopyInt8(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt8Slice(values [][]int8) [][]int8 {\n\tnewValues := lib_CopyInt8Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt8(values []int8, f func(v int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice(values [][]int8, f func(v []int8) []int8) (newValues [][]int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt8(valuesList ...[]int8) (newValuesList [][]int8, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt8\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt8\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int8\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int8\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int8{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt8(values []int8, i int) ([]int8, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int8{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int8, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int8Combination(values []int8, r int) (combinations [][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int8Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8Permutation(values []int8, r int) (permutations [][]int8) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int8RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int8Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8SliceCombination(values [][]int8, r int) (combinations [][][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int8SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8RemoveFromSlice(slice []int8, i int) []int8 {\n\tn := make([]int8, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt8(ok bool, v1, v2 int8) int8 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt8 struct {\n\tnodes map[int8]int8\n}\n\nfunc lib_NewUnionFindInt8(values []int8) *lib_UnionFindInt8 {\n\tm := map[int8]int8{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt8{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt8) GetRoot(value int8) (int8, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt8) Unite(v1, v2 int8) (int8, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt8) IsSameGroup(v1, v2 int8) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt8(f func(v int8) int8) func(v int8) int8 {\n\tcache := map[int8]int8{}\n\treturn func(v int8) int8 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt16(values []int16, f func(acc, cur int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt16Slice(values [][]int16, f func(acc int16, cur []int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt16(values []int16) []int16 {\n\tdst := make([]int16, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt16Slice(values [][]int16) [][]int16 {\n\tdst := make([][]int16, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt16(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt16(values []int16) []int16 {\n\tnewValues := lib_CopyInt16(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt16Slice(values [][]int16) [][]int16 {\n\tnewValues := lib_CopyInt16Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt16(values []int16, f func(v int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice(values [][]int16, f func(v []int16) []int16) (newValues [][]int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt16(valuesList ...[]int16) (newValuesList [][]int16, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt16\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt16\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int16\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int16\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int16{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt16(values []int16, i int) ([]int16, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int16{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int16, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int16Combination(values []int16, r int) (combinations [][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int16Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16Permutation(values []int16, r int) (permutations [][]int16) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int16RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int16Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16SliceCombination(values [][]int16, r int) (combinations [][][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int16SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16RemoveFromSlice(slice []int16, i int) []int16 {\n\tn := make([]int16, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt16(ok bool, v1, v2 int16) int16 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt16 struct {\n\tnodes map[int16]int16\n}\n\nfunc lib_NewUnionFindInt16(values []int16) *lib_UnionFindInt16 {\n\tm := map[int16]int16{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt16{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt16) GetRoot(value int16) (int16, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt16) Unite(v1, v2 int16) (int16, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt16) IsSameGroup(v1, v2 int16) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt16(f func(v int16) int16) func(v int16) int16 {\n\tcache := map[int16]int16{}\n\treturn func(v int16) int16 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt32(values []int32, f func(acc, cur int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt32Slice(values [][]int32, f func(acc int32, cur []int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt32(values []int32) []int32 {\n\tdst := make([]int32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt32Slice(values [][]int32) [][]int32 {\n\tdst := make([][]int32, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt32(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt32(values []int32) []int32 {\n\tnewValues := lib_CopyInt32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt32Slice(values [][]int32) [][]int32 {\n\tnewValues := lib_CopyInt32Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt32(values []int32, f func(v int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice(values [][]int32, f func(v []int32) []int32) (newValues [][]int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt32(valuesList ...[]int32) (newValuesList [][]int32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt32(values []int32, i int) ([]int32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int32Combination(values []int32, r int) (combinations [][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32Permutation(values []int32, r int) (permutations [][]int32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32SliceCombination(values [][]int32, r int) (combinations [][][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32RemoveFromSlice(slice []int32, i int) []int32 {\n\tn := make([]int32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt32(ok bool, v1, v2 int32) int32 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt32 struct {\n\tnodes map[int32]int32\n}\n\nfunc lib_NewUnionFindInt32(values []int32) *lib_UnionFindInt32 {\n\tm := map[int32]int32{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt32{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt32) GetRoot(value int32) (int32, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt32) Unite(v1, v2 int32) (int32, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt32) IsSameGroup(v1, v2 int32) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt32(f func(v int32) int32) func(v int32) int32 {\n\tcache := map[int32]int32{}\n\treturn func(v int32) int32 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt64(values []int64, f func(acc, cur int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt64Slice(values [][]int64, f func(acc int64, cur []int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt64(values []int64) []int64 {\n\tdst := make([]int64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt64Slice(values [][]int64) [][]int64 {\n\tdst := make([][]int64, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt64(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt64(values []int64) []int64 {\n\tnewValues := lib_CopyInt64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt64Slice(values [][]int64) [][]int64 {\n\tnewValues := lib_CopyInt64Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt64(values []int64, f func(v int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice(values [][]int64, f func(v []int64) []int64) (newValues [][]int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt64(valuesList ...[]int64) (newValuesList [][]int64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt64(values []int64, i int) ([]int64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int64Combination(values []int64, r int) (combinations [][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64Permutation(values []int64, r int) (permutations [][]int64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64SliceCombination(values [][]int64, r int) (combinations [][][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64RemoveFromSlice(slice []int64, i int) []int64 {\n\tn := make([]int64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt64(ok bool, v1, v2 int64) int64 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt64 struct {\n\tnodes map[int64]int64\n}\n\nfunc lib_NewUnionFindInt64(values []int64) *lib_UnionFindInt64 {\n\tm := map[int64]int64{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt64{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt64) GetRoot(value int64) (int64, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt64) Unite(v1, v2 int64) (int64, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt64) IsSameGroup(v1, v2 int64) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt64(f func(v int64) int64) func(v int64) int64 {\n\tcache := map[int64]int64{}\n\treturn func(v int64) int64 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceFloat32(values []float32, f func(acc, cur float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat32Slice(values [][]float32, f func(acc float32, cur []float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat32(values []float32) []float32 {\n\tdst := make([]float32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyFloat32Slice(values [][]float32) [][]float32 {\n\tdst := make([][]float32, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyFloat32(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseFloat32(values []float32) []float32 {\n\tnewValues := lib_CopyFloat32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseFloat32Slice(values [][]float32) [][]float32 {\n\tnewValues := lib_CopyFloat32Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat32(values []float32, f func(v float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice(values [][]float32, f func(v []float32) []float32) (newValues [][]float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat32(valuesList ...[]float32) (newValuesList [][]float32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat32(values []float32, i int) ([]float32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float32Combination(values []float32, r int) (combinations [][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32Permutation(values []float32, r int) (permutations [][]float32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32SliceCombination(values [][]float32, r int) (combinations [][][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32RemoveFromSlice(slice []float32, i int) []float32 {\n\tn := make([]float32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPFloat32(ok bool, v1, v2 float32) float32 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindFloat32 struct {\n\tnodes map[float32]float32\n}\n\nfunc lib_NewUnionFindFloat32(values []float32) *lib_UnionFindFloat32 {\n\tm := map[float32]float32{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindFloat32{nodes: m}\n}\n\nfunc (u *lib_UnionFindFloat32) GetRoot(value float32) (float32, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindFloat32) Unite(v1, v2 float32) (float32, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindFloat32) IsSameGroup(v1, v2 float32) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeFloat32(f func(v float32) float32) func(v float32) float32 {\n\tcache := map[float32]float32{}\n\treturn func(v float32) float32 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceFloat64(values []float64, f func(acc, cur float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat64Slice(values [][]float64, f func(acc float64, cur []float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat64(values []float64) []float64 {\n\tdst := make([]float64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyFloat64Slice(values [][]float64) [][]float64 {\n\tdst := make([][]float64, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyFloat64(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseFloat64(values []float64) []float64 {\n\tnewValues := lib_CopyFloat64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseFloat64Slice(values [][]float64) [][]float64 {\n\tnewValues := lib_CopyFloat64Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat64(values []float64, f func(v float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice(values [][]float64, f func(v []float64) []float64) (newValues [][]float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat64(valuesList ...[]float64) (newValuesList [][]float64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat64(values []float64, i int) ([]float64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float64Combination(values []float64, r int) (combinations [][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64Permutation(values []float64, r int) (permutations [][]float64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64SliceCombination(values [][]float64, r int) (combinations [][][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64RemoveFromSlice(slice []float64, i int) []float64 {\n\tn := make([]float64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPFloat64(ok bool, v1, v2 float64) float64 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindFloat64 struct {\n\tnodes map[float64]float64\n}\n\nfunc lib_NewUnionFindFloat64(values []float64) *lib_UnionFindFloat64 {\n\tm := map[float64]float64{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindFloat64{nodes: m}\n}\n\nfunc (u *lib_UnionFindFloat64) GetRoot(value float64) (float64, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindFloat64) Unite(v1, v2 float64) (float64, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindFloat64) IsSameGroup(v1, v2 float64) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeFloat64(f func(v float64) float64) func(v float64) float64 {\n\tcache := map[float64]float64{}\n\treturn func(v float64) float64 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToRune(f func(v1, v2 rune) rune) func(v1, v2 rune) rune {\n\tcache := map[rune]map[rune]rune{}\n\n\treturn func(v1, v2 rune) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToRune(f func(v1, v2, v3, v4, v5 rune) rune) func(v1, v2, v3, v4, v5 rune) rune {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToString(f func(v1, v2 rune) string) func(v1, v2 rune) string {\n\tcache := map[rune]map[rune]string{}\n\n\treturn func(v1, v2 rune) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToString(f func(v1, v2, v3, v4, v5 rune) string) func(v1, v2, v3, v4, v5 rune) string {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]string{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt(f func(v1, v2 rune) int) func(v1, v2 rune) int {\n\tcache := map[rune]map[rune]int{}\n\n\treturn func(v1, v2 rune) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt(f func(v1, v2, v3, v4, v5 rune) int) func(v1, v2, v3, v4, v5 rune) int {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt8(f func(v1, v2 rune) int8) func(v1, v2 rune) int8 {\n\tcache := map[rune]map[rune]int8{}\n\n\treturn func(v1, v2 rune) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt8(f func(v1, v2, v3, v4, v5 rune) int8) func(v1, v2, v3, v4, v5 rune) int8 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt16(f func(v1, v2 rune) int16) func(v1, v2 rune) int16 {\n\tcache := map[rune]map[rune]int16{}\n\n\treturn func(v1, v2 rune) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt16(f func(v1, v2, v3, v4, v5 rune) int16) func(v1, v2, v3, v4, v5 rune) int16 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt32(f func(v1, v2 rune) int32) func(v1, v2 rune) int32 {\n\tcache := map[rune]map[rune]int32{}\n\n\treturn func(v1, v2 rune) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt32(f func(v1, v2, v3, v4, v5 rune) int32) func(v1, v2, v3, v4, v5 rune) int32 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt64(f func(v1, v2 rune) int64) func(v1, v2 rune) int64 {\n\tcache := map[rune]map[rune]int64{}\n\n\treturn func(v1, v2 rune) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt64(f func(v1, v2, v3, v4, v5 rune) int64) func(v1, v2, v3, v4, v5 rune) int64 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToFloat32(f func(v1, v2 rune) float32) func(v1, v2 rune) float32 {\n\tcache := map[rune]map[rune]float32{}\n\n\treturn func(v1, v2 rune) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToFloat32(f func(v1, v2, v3, v4, v5 rune) float32) func(v1, v2, v3, v4, v5 rune) float32 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToFloat64(f func(v1, v2 rune) float64) func(v1, v2 rune) float64 {\n\tcache := map[rune]map[rune]float64{}\n\n\treturn func(v1, v2 rune) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToFloat64(f func(v1, v2, v3, v4, v5 rune) float64) func(v1, v2, v3, v4, v5 rune) float64 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToRune(f func(v1, v2 string) rune) func(v1, v2 string) rune {\n\tcache := map[string]map[string]rune{}\n\n\treturn func(v1, v2 string) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToRune(f func(v1, v2, v3, v4, v5 string) rune) func(v1, v2, v3, v4, v5 string) rune {\n\tcache := map[string]map[string]map[string]map[string]map[string]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 string) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToString(f func(v1, v2 string) string) func(v1, v2 string) string {\n\tcache := map[string]map[string]string{}\n\n\treturn func(v1, v2 string) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToString(f func(v1, v2, v3, v4, v5 string) string) func(v1, v2, v3, v4, v5 string) string {\n\tcache := map[string]map[string]map[string]map[string]map[string]string{}\n\n\treturn func(v1, v2, v3, v4, v5 string) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt(f func(v1, v2 string) int) func(v1, v2 string) int {\n\tcache := map[string]map[string]int{}\n\n\treturn func(v1, v2 string) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt(f func(v1, v2, v3, v4, v5 string) int) func(v1, v2, v3, v4, v5 string) int {\n\tcache := map[string]map[string]map[string]map[string]map[string]int{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt8(f func(v1, v2 string) int8) func(v1, v2 string) int8 {\n\tcache := map[string]map[string]int8{}\n\n\treturn func(v1, v2 string) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt8(f func(v1, v2, v3, v4, v5 string) int8) func(v1, v2, v3, v4, v5 string) int8 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt16(f func(v1, v2 string) int16) func(v1, v2 string) int16 {\n\tcache := map[string]map[string]int16{}\n\n\treturn func(v1, v2 string) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt16(f func(v1, v2, v3, v4, v5 string) int16) func(v1, v2, v3, v4, v5 string) int16 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt32(f func(v1, v2 string) int32) func(v1, v2 string) int32 {\n\tcache := map[string]map[string]int32{}\n\n\treturn func(v1, v2 string) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt32(f func(v1, v2, v3, v4, v5 string) int32) func(v1, v2, v3, v4, v5 string) int32 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt64(f func(v1, v2 string) int64) func(v1, v2 string) int64 {\n\tcache := map[string]map[string]int64{}\n\n\treturn func(v1, v2 string) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt64(f func(v1, v2, v3, v4, v5 string) int64) func(v1, v2, v3, v4, v5 string) int64 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToFloat32(f func(v1, v2 string) float32) func(v1, v2 string) float32 {\n\tcache := map[string]map[string]float32{}\n\n\treturn func(v1, v2 string) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToFloat32(f func(v1, v2, v3, v4, v5 string) float32) func(v1, v2, v3, v4, v5 string) float32 {\n\tcache := map[string]map[string]map[string]map[string]map[string]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 string) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToFloat64(f func(v1, v2 string) float64) func(v1, v2 string) float64 {\n\tcache := map[string]map[string]float64{}\n\n\treturn func(v1, v2 string) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToFloat64(f func(v1, v2, v3, v4, v5 string) float64) func(v1, v2, v3, v4, v5 string) float64 {\n\tcache := map[string]map[string]map[string]map[string]map[string]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 string) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToRune(f func(v1, v2 int) rune) func(v1, v2 int) rune {\n\tcache := map[int]map[int]rune{}\n\n\treturn func(v1, v2 int) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToRune(f func(v1, v2, v3, v4, v5 int) rune) func(v1, v2, v3, v4, v5 int) rune {\n\tcache := map[int]map[int]map[int]map[int]map[int]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToString(f func(v1, v2 int) string) func(v1, v2 int) string {\n\tcache := map[int]map[int]string{}\n\n\treturn func(v1, v2 int) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToString(f func(v1, v2, v3, v4, v5 int) string) func(v1, v2, v3, v4, v5 int) string {\n\tcache := map[int]map[int]map[int]map[int]map[int]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt(f func(v1, v2 int) int) func(v1, v2 int) int {\n\tcache := map[int]map[int]int{}\n\n\treturn func(v1, v2 int) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt(f func(v1, v2, v3, v4, v5 int) int) func(v1, v2, v3, v4, v5 int) int {\n\tcache := map[int]map[int]map[int]map[int]map[int]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt8(f func(v1, v2 int) int8) func(v1, v2 int) int8 {\n\tcache := map[int]map[int]int8{}\n\n\treturn func(v1, v2 int) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt8(f func(v1, v2, v3, v4, v5 int) int8) func(v1, v2, v3, v4, v5 int) int8 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt16(f func(v1, v2 int) int16) func(v1, v2 int) int16 {\n\tcache := map[int]map[int]int16{}\n\n\treturn func(v1, v2 int) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt16(f func(v1, v2, v3, v4, v5 int) int16) func(v1, v2, v3, v4, v5 int) int16 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt32(f func(v1, v2 int) int32) func(v1, v2 int) int32 {\n\tcache := map[int]map[int]int32{}\n\n\treturn func(v1, v2 int) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt32(f func(v1, v2, v3, v4, v5 int) int32) func(v1, v2, v3, v4, v5 int) int32 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt64(f func(v1, v2 int) int64) func(v1, v2 int) int64 {\n\tcache := map[int]map[int]int64{}\n\n\treturn func(v1, v2 int) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt64(f func(v1, v2, v3, v4, v5 int) int64) func(v1, v2, v3, v4, v5 int) int64 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToFloat32(f func(v1, v2 int) float32) func(v1, v2 int) float32 {\n\tcache := map[int]map[int]float32{}\n\n\treturn func(v1, v2 int) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToFloat32(f func(v1, v2, v3, v4, v5 int) float32) func(v1, v2, v3, v4, v5 int) float32 {\n\tcache := map[int]map[int]map[int]map[int]map[int]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToFloat64(f func(v1, v2 int) float64) func(v1, v2 int) float64 {\n\tcache := map[int]map[int]float64{}\n\n\treturn func(v1, v2 int) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToFloat64(f func(v1, v2, v3, v4, v5 int) float64) func(v1, v2, v3, v4, v5 int) float64 {\n\tcache := map[int]map[int]map[int]map[int]map[int]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToRune(f func(v1, v2 int8) rune) func(v1, v2 int8) rune {\n\tcache := map[int8]map[int8]rune{}\n\n\treturn func(v1, v2 int8) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToRune(f func(v1, v2, v3, v4, v5 int8) rune) func(v1, v2, v3, v4, v5 int8) rune {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToString(f func(v1, v2 int8) string) func(v1, v2 int8) string {\n\tcache := map[int8]map[int8]string{}\n\n\treturn func(v1, v2 int8) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToString(f func(v1, v2, v3, v4, v5 int8) string) func(v1, v2, v3, v4, v5 int8) string {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt(f func(v1, v2 int8) int) func(v1, v2 int8) int {\n\tcache := map[int8]map[int8]int{}\n\n\treturn func(v1, v2 int8) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt(f func(v1, v2, v3, v4, v5 int8) int) func(v1, v2, v3, v4, v5 int8) int {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt8(f func(v1, v2 int8) int8) func(v1, v2 int8) int8 {\n\tcache := map[int8]map[int8]int8{}\n\n\treturn func(v1, v2 int8) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt8(f func(v1, v2, v3, v4, v5 int8) int8) func(v1, v2, v3, v4, v5 int8) int8 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt16(f func(v1, v2 int8) int16) func(v1, v2 int8) int16 {\n\tcache := map[int8]map[int8]int16{}\n\n\treturn func(v1, v2 int8) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt16(f func(v1, v2, v3, v4, v5 int8) int16) func(v1, v2, v3, v4, v5 int8) int16 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt32(f func(v1, v2 int8) int32) func(v1, v2 int8) int32 {\n\tcache := map[int8]map[int8]int32{}\n\n\treturn func(v1, v2 int8) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt32(f func(v1, v2, v3, v4, v5 int8) int32) func(v1, v2, v3, v4, v5 int8) int32 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt64(f func(v1, v2 int8) int64) func(v1, v2 int8) int64 {\n\tcache := map[int8]map[int8]int64{}\n\n\treturn func(v1, v2 int8) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt64(f func(v1, v2, v3, v4, v5 int8) int64) func(v1, v2, v3, v4, v5 int8) int64 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToFloat32(f func(v1, v2 int8) float32) func(v1, v2 int8) float32 {\n\tcache := map[int8]map[int8]float32{}\n\n\treturn func(v1, v2 int8) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToFloat32(f func(v1, v2, v3, v4, v5 int8) float32) func(v1, v2, v3, v4, v5 int8) float32 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToFloat64(f func(v1, v2 int8) float64) func(v1, v2 int8) float64 {\n\tcache := map[int8]map[int8]float64{}\n\n\treturn func(v1, v2 int8) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToFloat64(f func(v1, v2, v3, v4, v5 int8) float64) func(v1, v2, v3, v4, v5 int8) float64 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToRune(f func(v1, v2 int16) rune) func(v1, v2 int16) rune {\n\tcache := map[int16]map[int16]rune{}\n\n\treturn func(v1, v2 int16) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToRune(f func(v1, v2, v3, v4, v5 int16) rune) func(v1, v2, v3, v4, v5 int16) rune {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToString(f func(v1, v2 int16) string) func(v1, v2 int16) string {\n\tcache := map[int16]map[int16]string{}\n\n\treturn func(v1, v2 int16) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToString(f func(v1, v2, v3, v4, v5 int16) string) func(v1, v2, v3, v4, v5 int16) string {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt(f func(v1, v2 int16) int) func(v1, v2 int16) int {\n\tcache := map[int16]map[int16]int{}\n\n\treturn func(v1, v2 int16) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt(f func(v1, v2, v3, v4, v5 int16) int) func(v1, v2, v3, v4, v5 int16) int {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt8(f func(v1, v2 int16) int8) func(v1, v2 int16) int8 {\n\tcache := map[int16]map[int16]int8{}\n\n\treturn func(v1, v2 int16) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt8(f func(v1, v2, v3, v4, v5 int16) int8) func(v1, v2, v3, v4, v5 int16) int8 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt16(f func(v1, v2 int16) int16) func(v1, v2 int16) int16 {\n\tcache := map[int16]map[int16]int16{}\n\n\treturn func(v1, v2 int16) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt16(f func(v1, v2, v3, v4, v5 int16) int16) func(v1, v2, v3, v4, v5 int16) int16 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt32(f func(v1, v2 int16) int32) func(v1, v2 int16) int32 {\n\tcache := map[int16]map[int16]int32{}\n\n\treturn func(v1, v2 int16) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt32(f func(v1, v2, v3, v4, v5 int16) int32) func(v1, v2, v3, v4, v5 int16) int32 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt64(f func(v1, v2 int16) int64) func(v1, v2 int16) int64 {\n\tcache := map[int16]map[int16]int64{}\n\n\treturn func(v1, v2 int16) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt64(f func(v1, v2, v3, v4, v5 int16) int64) func(v1, v2, v3, v4, v5 int16) int64 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToFloat32(f func(v1, v2 int16) float32) func(v1, v2 int16) float32 {\n\tcache := map[int16]map[int16]float32{}\n\n\treturn func(v1, v2 int16) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToFloat32(f func(v1, v2, v3, v4, v5 int16) float32) func(v1, v2, v3, v4, v5 int16) float32 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToFloat64(f func(v1, v2 int16) float64) func(v1, v2 int16) float64 {\n\tcache := map[int16]map[int16]float64{}\n\n\treturn func(v1, v2 int16) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToFloat64(f func(v1, v2, v3, v4, v5 int16) float64) func(v1, v2, v3, v4, v5 int16) float64 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToRune(f func(v1, v2 int32) rune) func(v1, v2 int32) rune {\n\tcache := map[int32]map[int32]rune{}\n\n\treturn func(v1, v2 int32) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToRune(f func(v1, v2, v3, v4, v5 int32) rune) func(v1, v2, v3, v4, v5 int32) rune {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToString(f func(v1, v2 int32) string) func(v1, v2 int32) string {\n\tcache := map[int32]map[int32]string{}\n\n\treturn func(v1, v2 int32) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToString(f func(v1, v2, v3, v4, v5 int32) string) func(v1, v2, v3, v4, v5 int32) string {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt(f func(v1, v2 int32) int) func(v1, v2 int32) int {\n\tcache := map[int32]map[int32]int{}\n\n\treturn func(v1, v2 int32) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt(f func(v1, v2, v3, v4, v5 int32) int) func(v1, v2, v3, v4, v5 int32) int {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt8(f func(v1, v2 int32) int8) func(v1, v2 int32) int8 {\n\tcache := map[int32]map[int32]int8{}\n\n\treturn func(v1, v2 int32) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt8(f func(v1, v2, v3, v4, v5 int32) int8) func(v1, v2, v3, v4, v5 int32) int8 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt16(f func(v1, v2 int32) int16) func(v1, v2 int32) int16 {\n\tcache := map[int32]map[int32]int16{}\n\n\treturn func(v1, v2 int32) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt16(f func(v1, v2, v3, v4, v5 int32) int16) func(v1, v2, v3, v4, v5 int32) int16 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt32(f func(v1, v2 int32) int32) func(v1, v2 int32) int32 {\n\tcache := map[int32]map[int32]int32{}\n\n\treturn func(v1, v2 int32) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt32(f func(v1, v2, v3, v4, v5 int32) int32) func(v1, v2, v3, v4, v5 int32) int32 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt64(f func(v1, v2 int32) int64) func(v1, v2 int32) int64 {\n\tcache := map[int32]map[int32]int64{}\n\n\treturn func(v1, v2 int32) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt64(f func(v1, v2, v3, v4, v5 int32) int64) func(v1, v2, v3, v4, v5 int32) int64 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToFloat32(f func(v1, v2 int32) float32) func(v1, v2 int32) float32 {\n\tcache := map[int32]map[int32]float32{}\n\n\treturn func(v1, v2 int32) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToFloat32(f func(v1, v2, v3, v4, v5 int32) float32) func(v1, v2, v3, v4, v5 int32) float32 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToFloat64(f func(v1, v2 int32) float64) func(v1, v2 int32) float64 {\n\tcache := map[int32]map[int32]float64{}\n\n\treturn func(v1, v2 int32) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToFloat64(f func(v1, v2, v3, v4, v5 int32) float64) func(v1, v2, v3, v4, v5 int32) float64 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToRune(f func(v1, v2 int64) rune) func(v1, v2 int64) rune {\n\tcache := map[int64]map[int64]rune{}\n\n\treturn func(v1, v2 int64) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToRune(f func(v1, v2, v3, v4, v5 int64) rune) func(v1, v2, v3, v4, v5 int64) rune {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToString(f func(v1, v2 int64) string) func(v1, v2 int64) string {\n\tcache := map[int64]map[int64]string{}\n\n\treturn func(v1, v2 int64) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToString(f func(v1, v2, v3, v4, v5 int64) string) func(v1, v2, v3, v4, v5 int64) string {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt(f func(v1, v2 int64) int) func(v1, v2 int64) int {\n\tcache := map[int64]map[int64]int{}\n\n\treturn func(v1, v2 int64) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt(f func(v1, v2, v3, v4, v5 int64) int) func(v1, v2, v3, v4, v5 int64) int {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt8(f func(v1, v2 int64) int8) func(v1, v2 int64) int8 {\n\tcache := map[int64]map[int64]int8{}\n\n\treturn func(v1, v2 int64) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt8(f func(v1, v2, v3, v4, v5 int64) int8) func(v1, v2, v3, v4, v5 int64) int8 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt16(f func(v1, v2 int64) int16) func(v1, v2 int64) int16 {\n\tcache := map[int64]map[int64]int16{}\n\n\treturn func(v1, v2 int64) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt16(f func(v1, v2, v3, v4, v5 int64) int16) func(v1, v2, v3, v4, v5 int64) int16 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt32(f func(v1, v2 int64) int32) func(v1, v2 int64) int32 {\n\tcache := map[int64]map[int64]int32{}\n\n\treturn func(v1, v2 int64) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt32(f func(v1, v2, v3, v4, v5 int64) int32) func(v1, v2, v3, v4, v5 int64) int32 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt64(f func(v1, v2 int64) int64) func(v1, v2 int64) int64 {\n\tcache := map[int64]map[int64]int64{}\n\n\treturn func(v1, v2 int64) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt64(f func(v1, v2, v3, v4, v5 int64) int64) func(v1, v2, v3, v4, v5 int64) int64 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToFloat32(f func(v1, v2 int64) float32) func(v1, v2 int64) float32 {\n\tcache := map[int64]map[int64]float32{}\n\n\treturn func(v1, v2 int64) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToFloat32(f func(v1, v2, v3, v4, v5 int64) float32) func(v1, v2, v3, v4, v5 int64) float32 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToFloat64(f func(v1, v2 int64) float64) func(v1, v2 int64) float64 {\n\tcache := map[int64]map[int64]float64{}\n\n\treturn func(v1, v2 int64) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToFloat64(f func(v1, v2, v3, v4, v5 int64) float64) func(v1, v2, v3, v4, v5 int64) float64 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToRune(f func(v1, v2 float32) rune) func(v1, v2 float32) rune {\n\tcache := map[float32]map[float32]rune{}\n\n\treturn func(v1, v2 float32) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToRune(f func(v1, v2, v3, v4, v5 float32) rune) func(v1, v2, v3, v4, v5 float32) rune {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToString(f func(v1, v2 float32) string) func(v1, v2 float32) string {\n\tcache := map[float32]map[float32]string{}\n\n\treturn func(v1, v2 float32) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToString(f func(v1, v2, v3, v4, v5 float32) string) func(v1, v2, v3, v4, v5 float32) string {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]string{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt(f func(v1, v2 float32) int) func(v1, v2 float32) int {\n\tcache := map[float32]map[float32]int{}\n\n\treturn func(v1, v2 float32) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt(f func(v1, v2, v3, v4, v5 float32) int) func(v1, v2, v3, v4, v5 float32) int {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt8(f func(v1, v2 float32) int8) func(v1, v2 float32) int8 {\n\tcache := map[float32]map[float32]int8{}\n\n\treturn func(v1, v2 float32) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt8(f func(v1, v2, v3, v4, v5 float32) int8) func(v1, v2, v3, v4, v5 float32) int8 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt16(f func(v1, v2 float32) int16) func(v1, v2 float32) int16 {\n\tcache := map[float32]map[float32]int16{}\n\n\treturn func(v1, v2 float32) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt16(f func(v1, v2, v3, v4, v5 float32) int16) func(v1, v2, v3, v4, v5 float32) int16 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt32(f func(v1, v2 float32) int32) func(v1, v2 float32) int32 {\n\tcache := map[float32]map[float32]int32{}\n\n\treturn func(v1, v2 float32) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt32(f func(v1, v2, v3, v4, v5 float32) int32) func(v1, v2, v3, v4, v5 float32) int32 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt64(f func(v1, v2 float32) int64) func(v1, v2 float32) int64 {\n\tcache := map[float32]map[float32]int64{}\n\n\treturn func(v1, v2 float32) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt64(f func(v1, v2, v3, v4, v5 float32) int64) func(v1, v2, v3, v4, v5 float32) int64 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToFloat32(f func(v1, v2 float32) float32) func(v1, v2 float32) float32 {\n\tcache := map[float32]map[float32]float32{}\n\n\treturn func(v1, v2 float32) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToFloat32(f func(v1, v2, v3, v4, v5 float32) float32) func(v1, v2, v3, v4, v5 float32) float32 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToFloat64(f func(v1, v2 float32) float64) func(v1, v2 float32) float64 {\n\tcache := map[float32]map[float32]float64{}\n\n\treturn func(v1, v2 float32) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToFloat64(f func(v1, v2, v3, v4, v5 float32) float64) func(v1, v2, v3, v4, v5 float32) float64 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToRune(f func(v1, v2 float64) rune) func(v1, v2 float64) rune {\n\tcache := map[float64]map[float64]rune{}\n\n\treturn func(v1, v2 float64) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToRune(f func(v1, v2, v3, v4, v5 float64) rune) func(v1, v2, v3, v4, v5 float64) rune {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToString(f func(v1, v2 float64) string) func(v1, v2 float64) string {\n\tcache := map[float64]map[float64]string{}\n\n\treturn func(v1, v2 float64) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToString(f func(v1, v2, v3, v4, v5 float64) string) func(v1, v2, v3, v4, v5 float64) string {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]string{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt(f func(v1, v2 float64) int) func(v1, v2 float64) int {\n\tcache := map[float64]map[float64]int{}\n\n\treturn func(v1, v2 float64) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt(f func(v1, v2, v3, v4, v5 float64) int) func(v1, v2, v3, v4, v5 float64) int {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt8(f func(v1, v2 float64) int8) func(v1, v2 float64) int8 {\n\tcache := map[float64]map[float64]int8{}\n\n\treturn func(v1, v2 float64) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt8(f func(v1, v2, v3, v4, v5 float64) int8) func(v1, v2, v3, v4, v5 float64) int8 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt16(f func(v1, v2 float64) int16) func(v1, v2 float64) int16 {\n\tcache := map[float64]map[float64]int16{}\n\n\treturn func(v1, v2 float64) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt16(f func(v1, v2, v3, v4, v5 float64) int16) func(v1, v2, v3, v4, v5 float64) int16 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt32(f func(v1, v2 float64) int32) func(v1, v2 float64) int32 {\n\tcache := map[float64]map[float64]int32{}\n\n\treturn func(v1, v2 float64) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt32(f func(v1, v2, v3, v4, v5 float64) int32) func(v1, v2, v3, v4, v5 float64) int32 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt64(f func(v1, v2 float64) int64) func(v1, v2 float64) int64 {\n\tcache := map[float64]map[float64]int64{}\n\n\treturn func(v1, v2 float64) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt64(f func(v1, v2, v3, v4, v5 float64) int64) func(v1, v2, v3, v4, v5 float64) int64 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToFloat32(f func(v1, v2 float64) float32) func(v1, v2 float64) float32 {\n\tcache := map[float64]map[float64]float32{}\n\n\treturn func(v1, v2 float64) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToFloat32(f func(v1, v2, v3, v4, v5 float64) float32) func(v1, v2, v3, v4, v5 float64) float32 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToFloat64(f func(v1, v2 float64) float64) func(v1, v2 float64) float64 {\n\tcache := map[float64]map[float64]float64{}\n\n\treturn func(v1, v2 float64) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToFloat64(f func(v1, v2, v3, v4, v5 float64) float64) func(v1, v2, v3, v4, v5 float64) float64 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\ntype lib_Graph struct {\n\tAdjacencyMatrix [][]bool\n}\n\nfunc lib_NewGraph(nodeNum int, edges [][]int, directed bool) (*lib_Graph, error) {\n\tif nodeNum < 1 {\n\t\treturn nil, fmt.Errorf(\"invalid nodeNum: %d\", nodeNum)\n\t}\n\n\tvar aMatrix [][]bool\n\tfor i := 0; i < nodeNum; i++ {\n\t\tline := make([]bool, nodeNum)\n\t\taMatrix = append(aMatrix, line)\n\t}\n\n\tfor _, edge := range edges {\n\t\taMatrix[edge[0]][edge[1]] = true\n\t\tif !directed {\n\t\t\taMatrix[edge[1]][edge[0]] = true\n\t\t}\n\t}\n\n\treturn &lib_Graph{AdjacencyMatrix: aMatrix}, nil\n}\n\nfunc (g *lib_Graph) IsValidPath(path []int) bool {\n\tfor i := 1; i < len(path); i++ {\n\t\tif !g.AdjacencyMatrix[path[i-1]][path[i]] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_toLines(scanner *bufio.Scanner) [][]string {\n\tvar lines [][]string\n\tfor scanner.Scan() {\n\t\ttext := lib_TrimSpaceAndNewLineCodeAndTab(scanner.Text())\n\t\tif len(text) == 0 {\n\t\t\tlines = append(lines, []string{})\n\t\t\tcontinue\n\t\t}\n\t\tline := strings.Split(text, \" \")\n\t\tlines = append(lines, line)\n\t}\n\treturn lines\n}\n\nfunc lib_toLinesFromReader(reader *bufio.Reader) (lines [][]string, err error) {\n\tfor {\n\t\tchunks, err := lib_readLineAsChunks(reader)\n\t\tif err == io.EOF {\n\t\t\treturn lines, nil\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read line from reader: %v\", err)\n\t\t}\n\t\tlineStr := lib_TrimSpaceAndNewLineCodeAndTab(strings.Join(chunks, \"\"))\n\t\tline := strings.Split(lineStr, \" \")\n\t\tlines = append(lines, line)\n\t}\n}\n\nfunc lib_readLineAsChunks(reader *bufio.Reader) (chunks []string, err error) {\n\tfor {\n\t\tchunk, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tchunks = append(chunks, string(chunk))\n\t\tif !isPrefix {\n\t\t\treturn chunks, nil\n\t\t}\n\t}\n}\n\ntype lib_Input struct {\n\tlines [][]string\n}\n\nfunc (i *lib_Input) validateColIndex(index int) error {\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\n\treturn nil\n}\n\nfunc (i *lib_Input) validateRowIndex(index int) error {\n\tif index >= len(i.lines) {\n\t\treturn errors.New(fmt.Sprintf(\"index(%d) is larger than lines(%d)\", index, len(i.lines)))\n\t}\n\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\treturn nil\n}\n\nfunc (i *lib_Input) GetLines(startRowIndex, endRowIndex int) ([][]string, error) {\n\tif err := i.validateRowIndex(startRowIndex); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid start row index: %v\", err)\n\t}\n\tif err := i.validateRowIndex(endRowIndex - 1); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid end row index: %v\", err)\n\t}\n\treturn i.lines[startRowIndex:endRowIndex], nil\n}\n\nfunc (i *lib_Input) GetStringLinesFrom(fromIndex int) (newLines [][]string, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetValue(rowIndex, colIndex int) (string, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn \"\", fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\treturn line[colIndex], nil\n}\n\nfunc (i *lib_Input) GetFirstValue(rowIndex int) (string, error) {\n\treturn i.GetValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColLine(colIndex int) (newLine []string, err error) {\n\tif err := i.validateColIndex(colIndex); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i, line := range i.lines {\n\t\tif len(line) <= colIndex {\n\t\t\treturn nil, errors.New(fmt.Sprintf(\"col index(%d) is larger than %dth line length(%d)\", colIndex, i, len(line)))\n\t\t}\n\t\tnewLine = append(newLine, line[colIndex])\n\t}\n\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetLine(index int) ([]string, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\treturn i.lines[index], nil\n}\n\nfunc (i *lib_Input) ReadAsStringGridFrom(fromIndex int) ([][]string, error) {\n\tlines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar m [][]string\n\tfor _, line := range lines {\n\t\tif len(line) > 1 {\n\t\t\treturn nil, fmt.Errorf(\"unexpected length line: %v\", line)\n\t\t}\n\n\t\tvar mLine []string\n\t\tfor _, r := range line[0] {\n\t\t\tmLine = append(mLine, string(r))\n\t\t}\n\t\tm = append(m, mLine)\n\t}\n\treturn m, nil\n}\n\nfunc lib_NewInput(scanner *bufio.Scanner) *lib_Input {\n\treturn &lib_Input{\n\t\tlines: lib_toLines(scanner),\n\t}\n}\n\nfunc lib_NewInputFromReader(reader *bufio.Reader) (*lib_Input, error) {\n\tlines, err := lib_toLinesFromReader(reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create new Input from reader: %v\", err)\n\t}\n\treturn &lib_Input{\n\t\tlines: lines,\n\t}, nil\n}\n\nfunc (i *lib_Input) MustGetIntLines() (newLines [][]int) {\n\tnewLines, err := i.GetIntLines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLinesFrom(fromIndex int) (newLines [][]int) {\n\tnewLines, err := i.GetIntLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLineRange(fromRowIndex, rangeNum int) (newLines [][]int) {\n\tnewLines, err := i.GetIntLineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLine(index int) []int {\n\tv, err := i.GetIntLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetIntValue(rowIndex, colIndex int) int {\n\tv, err := i.GetIntValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstIntValue(rowIndex int) int {\n\tv, err := i.GetFirstIntValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColIntLine(colIndex int) (newLine []int) {\n\tnewLine, err := i.GetColIntLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt8Lines() (newLines [][]int8) {\n\tnewLines, err := i.GetInt8Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8LinesFrom(fromIndex int) (newLines [][]int8) {\n\tnewLines, err := i.GetInt8LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8LineRange(fromRowIndex, rangeNum int) (newLines [][]int8) {\n\tnewLines, err := i.GetInt8LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8Line(index int) []int8 {\n\tv, err := i.GetInt8Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt8Value(rowIndex, colIndex int) int8 {\n\tv, err := i.GetInt8Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt8Value(rowIndex int) int8 {\n\tv, err := i.GetFirstInt8Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt8Line(colIndex int) (newLine []int8) {\n\tnewLine, err := i.GetColInt8Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt16Lines() (newLines [][]int16) {\n\tnewLines, err := i.GetInt16Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16LinesFrom(fromIndex int) (newLines [][]int16) {\n\tnewLines, err := i.GetInt16LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16LineRange(fromRowIndex, rangeNum int) (newLines [][]int16) {\n\tnewLines, err := i.GetInt16LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16Line(index int) []int16 {\n\tv, err := i.GetInt16Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt16Value(rowIndex, colIndex int) int16 {\n\tv, err := i.GetInt16Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt16Value(rowIndex int) int16 {\n\tv, err := i.GetFirstInt16Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt16Line(colIndex int) (newLine []int16) {\n\tnewLine, err := i.GetColInt16Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt32Lines() (newLines [][]int32) {\n\tnewLines, err := i.GetInt32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32LinesFrom(fromIndex int) (newLines [][]int32) {\n\tnewLines, err := i.GetInt32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32LineRange(fromRowIndex, rangeNum int) (newLines [][]int32) {\n\tnewLines, err := i.GetInt32LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32Line(index int) []int32 {\n\tv, err := i.GetInt32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt32Value(rowIndex, colIndex int) int32 {\n\tv, err := i.GetInt32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt32Value(rowIndex int) int32 {\n\tv, err := i.GetFirstInt32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt32Line(colIndex int) (newLine []int32) {\n\tnewLine, err := i.GetColInt32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt64Lines() (newLines [][]int64) {\n\tnewLines, err := i.GetInt64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64LinesFrom(fromIndex int) (newLines [][]int64) {\n\tnewLines, err := i.GetInt64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64LineRange(fromRowIndex, rangeNum int) (newLines [][]int64) {\n\tnewLines, err := i.GetInt64LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64Line(index int) []int64 {\n\tv, err := i.GetInt64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt64Value(rowIndex, colIndex int) int64 {\n\tv, err := i.GetInt64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt64Value(rowIndex int) int64 {\n\tv, err := i.GetFirstInt64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt64Line(colIndex int) (newLine []int64) {\n\tnewLine, err := i.GetColInt64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat32Lines() (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32LinesFrom(fromIndex int) (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32LineRange(fromRowIndex, rangeNum int) (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32Line(index int) []float32 {\n\tv, err := i.GetFloat32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat32Value(rowIndex, colIndex int) float32 {\n\tv, err := i.GetFloat32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat32Value(rowIndex int) float32 {\n\tv, err := i.GetFirstFloat32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat32Line(colIndex int) (newLine []float32) {\n\tnewLine, err := i.GetColFloat32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat64Lines() (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64LinesFrom(fromIndex int) (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64LineRange(fromRowIndex, rangeNum int) (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64Line(index int) []float64 {\n\tv, err := i.GetFloat64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat64Value(rowIndex, colIndex int) float64 {\n\tv, err := i.GetFloat64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat64Value(rowIndex int) float64 {\n\tv, err := i.GetFirstFloat64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat64Line(colIndex int) (newLine []float64) {\n\tnewLine, err := i.GetColFloat64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc lib_MustSubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_SubtractIntBy(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt(values1 []int, values2 []int) (newValues []int) {\n\tnewValues, err := lib_SubtractInt(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffIntBy(values []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_RDiffIntBy(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt(values []int) (newValues []int) {\n\tnewValues, err := lib_RDiffInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToIntSlice(s string) (ValueLine []int) {\n\tValueLine, err := lib_StringToIntSlice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToIntSlice(line []string) (ValueLine []int) {\n\tValueLine, err := lib_StringSliceToIntSlice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt(values []int) (max int) {\n\tmax, err := lib_MaxInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntVA(values ...int) (max int) {\n\tmax, err := lib_MaxIntVA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt(values []int) (min int) {\n\tmin, err := lib_MinInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt8(values1 []int8, values2 []int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8(values []int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt8Slice(s string) (ValueLine []int8) {\n\tValueLine, err := lib_StringToInt8Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt8Slice(line []string) (ValueLine []int8) {\n\tValueLine, err := lib_StringSliceToInt8Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt8(values []int8) (max int8) {\n\tmax, err := lib_MaxInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8VA(values ...int8) (max int8) {\n\tmax, err := lib_MaxInt8VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt8(values []int8) (min int8) {\n\tmin, err := lib_MinInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt16(values1 []int16, values2 []int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16(values []int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt16Slice(s string) (ValueLine []int16) {\n\tValueLine, err := lib_StringToInt16Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt16Slice(line []string) (ValueLine []int16) {\n\tValueLine, err := lib_StringSliceToInt16Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt16(values []int16) (max int16) {\n\tmax, err := lib_MaxInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16VA(values ...int16) (max int16) {\n\tmax, err := lib_MaxInt16VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt16(values []int16) (min int16) {\n\tmin, err := lib_MinInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt32(values1 []int32, values2 []int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32(values []int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt32Slice(s string) (ValueLine []int32) {\n\tValueLine, err := lib_StringToInt32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt32Slice(line []string) (ValueLine []int32) {\n\tValueLine, err := lib_StringSliceToInt32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt32(values []int32) (max int32) {\n\tmax, err := lib_MaxInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32VA(values ...int32) (max int32) {\n\tmax, err := lib_MaxInt32VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt32(values []int32) (min int32) {\n\tmin, err := lib_MinInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt64(values1 []int64, values2 []int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64(values []int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt64Slice(s string) (ValueLine []int64) {\n\tValueLine, err := lib_StringToInt64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt64Slice(line []string) (ValueLine []int64) {\n\tValueLine, err := lib_StringSliceToInt64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt64(values []int64) (max int64) {\n\tmax, err := lib_MaxInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64VA(values ...int64) (max int64) {\n\tmax, err := lib_MaxInt64VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt64(values []int64) (min int64) {\n\tmin, err := lib_MinInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat32(values1 []float32, values2 []float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32(values []float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat32Slice(s string) (ValueLine []float32) {\n\tValueLine, err := lib_StringToFloat32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat32Slice(line []string) (ValueLine []float32) {\n\tValueLine, err := lib_StringSliceToFloat32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat32(values []float32) (max float32) {\n\tmax, err := lib_MaxFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32VA(values ...float32) (max float32) {\n\tmax, err := lib_MaxFloat32VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat32(values []float32) (min float32) {\n\tmin, err := lib_MinFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat64(values1 []float64, values2 []float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64(values []float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat64Slice(s string) (ValueLine []float64) {\n\tValueLine, err := lib_StringToFloat64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat64Slice(line []string) (ValueLine []float64) {\n\tValueLine, err := lib_StringSliceToFloat64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat64(values []float64) (max float64) {\n\tmax, err := lib_MaxFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64VA(values ...float64) (max float64) {\n\tmax, err := lib_MaxFloat64VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat64(values []float64) (min float64) {\n\tmin, err := lib_MinFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustMaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustZipRune(valuesList ...[]rune) (newValuesList [][]rune) {\n\tnewValuesList, err := lib_ZipRune(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune) {\n\tnewValues, err := lib_ChunkRuneByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetRune(values []rune, i int) []rune {\n\tv, err := lib_UnsetRune(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustRuneCombination(values []rune, r int) (combinations [][]rune) {\n\tcombinations, err := lib_RuneCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustRuneSliceCombination(values [][]rune, r int) (combinations [][][]rune) {\n\tcombinations, err := lib_RuneSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipString(valuesList ...[]string) (newValuesList [][]string) {\n\tnewValuesList, err := lib_ZipString(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkStringByBits(values []string, bits []bool) (newValues [][]string) {\n\tnewValues, err := lib_ChunkStringByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetString(values []string, i int) []string {\n\tv, err := lib_UnsetString(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustStringCombination(values []string, r int) (combinations [][]string) {\n\tcombinations, err := lib_StringCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustStringSliceCombination(values [][]string, r int) (combinations [][][]string) {\n\tcombinations, err := lib_StringSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt(valuesList ...[]int) (newValuesList [][]int) {\n\tnewValuesList, err := lib_ZipInt(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkIntByBits(values []int, bits []bool) (newValues [][]int) {\n\tnewValues, err := lib_ChunkIntByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt(values []int, i int) []int {\n\tv, err := lib_UnsetInt(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustIntCombination(values []int, r int) (combinations [][]int) {\n\tcombinations, err := lib_IntCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustIntSliceCombination(values [][]int, r int) (combinations [][][]int) {\n\tcombinations, err := lib_IntSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt8(valuesList ...[]int8) (newValuesList [][]int8) {\n\tnewValuesList, err := lib_ZipInt8(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8) {\n\tnewValues, err := lib_ChunkInt8ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt8(values []int8, i int) []int8 {\n\tv, err := lib_UnsetInt8(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt8Combination(values []int8, r int) (combinations [][]int8) {\n\tcombinations, err := lib_Int8Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt8SliceCombination(values [][]int8, r int) (combinations [][][]int8) {\n\tcombinations, err := lib_Int8SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt16(valuesList ...[]int16) (newValuesList [][]int16) {\n\tnewValuesList, err := lib_ZipInt16(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16) {\n\tnewValues, err := lib_ChunkInt16ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt16(values []int16, i int) []int16 {\n\tv, err := lib_UnsetInt16(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt16Combination(values []int16, r int) (combinations [][]int16) {\n\tcombinations, err := lib_Int16Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt16SliceCombination(values [][]int16, r int) (combinations [][][]int16) {\n\tcombinations, err := lib_Int16SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt32(valuesList ...[]int32) (newValuesList [][]int32) {\n\tnewValuesList, err := lib_ZipInt32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32) {\n\tnewValues, err := lib_ChunkInt32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt32(values []int32, i int) []int32 {\n\tv, err := lib_UnsetInt32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt32Combination(values []int32, r int) (combinations [][]int32) {\n\tcombinations, err := lib_Int32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt32SliceCombination(values [][]int32, r int) (combinations [][][]int32) {\n\tcombinations, err := lib_Int32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt64(valuesList ...[]int64) (newValuesList [][]int64) {\n\tnewValuesList, err := lib_ZipInt64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64) {\n\tnewValues, err := lib_ChunkInt64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt64(values []int64, i int) []int64 {\n\tv, err := lib_UnsetInt64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt64Combination(values []int64, r int) (combinations [][]int64) {\n\tcombinations, err := lib_Int64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt64SliceCombination(values [][]int64, r int) (combinations [][][]int64) {\n\tcombinations, err := lib_Int64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat32(valuesList ...[]float32) (newValuesList [][]float32) {\n\tnewValuesList, err := lib_ZipFloat32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32) {\n\tnewValues, err := lib_ChunkFloat32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat32(values []float32, i int) []float32 {\n\tv, err := lib_UnsetFloat32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat32Combination(values []float32, r int) (combinations [][]float32) {\n\tcombinations, err := lib_Float32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat32SliceCombination(values [][]float32, r int) (combinations [][][]float32) {\n\tcombinations, err := lib_Float32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat64(valuesList ...[]float64) (newValuesList [][]float64) {\n\tnewValuesList, err := lib_ZipFloat64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64) {\n\tnewValues, err := lib_ChunkFloat64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat64(values []float64, i int) []float64 {\n\tv, err := lib_UnsetFloat64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat64Combination(values []float64, r int) (combinations [][]float64) {\n\tcombinations, err := lib_Float64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat64SliceCombination(values [][]float64, r int) (combinations [][][]float64) {\n\tcombinations, err := lib_Float64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustNewGraph(nodeNum int, edges [][]int, directed bool) *lib_Graph {\n\tv, err := lib_NewGraph(nodeNum, edges, directed)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetLines(startRowIndex, endRowIndex int) [][]string {\n\tv, err := i.GetLines(startRowIndex, endRowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetStringLinesFrom(fromIndex int) (newLines [][]string) {\n\tnewLines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetValue(rowIndex, colIndex int) string {\n\tv, err := i.GetValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstValue(rowIndex int) string {\n\tv, err := i.GetFirstValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColLine(colIndex int) (newLine []string) {\n\tnewLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetLine(index int) []string {\n\tv, err := i.GetLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustReadAsStringGridFrom(fromIndex int) [][]string {\n\tv, err := i.ReadAsStringGridFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustNewInputFromReader(reader *bufio.Reader) *lib_Input {\n\tv, err := lib_NewInputFromReader(reader)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustCombination(n, r int64) int64 {\n\tv, err := lib_Combination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustBigCombination(n, r int) *big.Int {\n\tv, err := lib_BigCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustParallelBigCombination(n, r int) *big.Int {\n\tv, err := lib_ParallelBigCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustMemoizedCombination(n, r int) int {\n\tv, err := lib_MemoizedCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustMemoizedBigCombination(n, r int) *big.Int {\n\tv, err := lib_MemoizedBigCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustRangeFactorial(n, num int64) (f int64) {\n\tf, err := lib_RangeFactorial(n, num)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc lib_MustFactorial(n int64) (f int64) {\n\tf, err := lib_Factorial(n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc lib_MustMemoizedFactorial(n int, cache map[int]int) int {\n\tv, err := lib_MemoizedFactorial(n, cache)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_toSpecificBitIntLine(line []string, bitSize int) (intLine []int64, err error) {\n\tfor j, v := range line {\n\t\tintV, err := strconv.ParseInt(v, 10, bitSize)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(fmt.Sprintf(\"%dth value: %v\", j, err.Error()))\n\t\t}\n\t\tintLine = append(intLine, intV)\n\t}\n\treturn intLine, nil\n}\n\nfunc lib_BitEnumeration(digits uint) (enums [][]bool) {\n\tif digits == 0 {\n\t\treturn [][]bool{}\n\t}\n\n\tfor i := 0; i < 1<>d&1 == 1)\n\t\t}\n\t\tenums = append(enums, e)\n\t}\n\treturn\n}\n\nfunc lib_Combination(n, r int64) (int64, error) {\n\tif n < r {\n\t\treturn 0, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn 1, nil\n\t}\n\n\trRangeFac, err := lib_RangeFactorial(n, r)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed in Combination: %v\", err)\n\t}\n\trFac, err := lib_Factorial(r)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed in Combination: %v\", err)\n\t}\n\treturn rRangeFac / rFac, nil\n}\n\nfunc lib_BigCombination(n, r int) (*big.Int, error) {\n\tif n < r {\n\t\treturn nil, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn big.NewInt(1), nil\n\t}\n\n\trFac := lib_BigFactorial(r)\n\tnFac := lib_BigFactorial(n)\n\tnrFac := lib_BigFactorial(n - r)\n\treturn nFac.Div(nFac, rFac.Mul(rFac, nrFac)), nil\n}\n\nfunc lib_ParallelBigCombination(n, r int) (*big.Int, error) {\n\tif n < r {\n\t\treturn nil, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn big.NewInt(1), nil\n\t}\n\n\trChan := make(chan *big.Int)\n\tnChan := make(chan *big.Int)\n\tnrChan := make(chan *big.Int)\n\tgo func(r int) {\n\t\trChan <- lib_BigFactorial(r)\n\t}(r)\n\tgo func(n int) {\n\t\tnChan <- lib_BigFactorial(n)\n\t}(n)\n\tgo func(nr int) {\n\t\tnrChan <- lib_BigFactorial(nr)\n\t}(n - r)\n\n\trFac, nFac, nrFac := <-rChan, <-nChan, <-nrChan\n\treturn nFac.Div(nFac, rFac.Mul(rFac, nrFac)), nil\n}\n\nfunc lib_MemoizedCombination(n, r int) (int, error) {\n\tif n < r {\n\t\treturn 0, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn 1, nil\n\t}\n\n\tcache := map[int]int{}\n\trFac, err := lib_MemoizedFactorial(r, cache)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"too large r: %s\", err)\n\t}\n\tnFac, err := lib_MemoizedFactorial(n, cache)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"too large n: %s\", err)\n\t}\n\tnrFac, err := lib_MemoizedFactorial(n-r, cache)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"too large n - r: %s\", err)\n\t}\n\treturn nFac / (rFac * nrFac), nil\n}\n\nfunc lib_MemoizedBigCombination(n, r int) (*big.Int, error) {\n\tif n < r {\n\t\treturn nil, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn big.NewInt(1), nil\n\t}\n\n\tcache := map[int]*big.Int{}\n\trFac := lib_MemoizedBigFactorial(r, cache)\n\tnFac := lib_MemoizedBigFactorial(n, cache)\n\tnrFac := lib_MemoizedBigFactorial(n-r, cache)\n\treturn nFac.Div(nFac, rFac.Mul(rFac, nrFac)), nil\n}\n\nfunc lib_RangeFactorial(n, num int64) (f int64, err error) {\n\tf = 1\n\tfor i := int64(0); i < num; i++ {\n\t\tf *= n - i\n\t}\n\treturn\n}\n\nfunc lib_Factorial(n int64) (f int64, err error) {\n\tif n > 20 { // FIXME Consider 32bit architecture\n\t\treturn 0, fmt.Errorf(\"too large Factorical n: %d\", n)\n\t}\n\n\tf = 1\n\tfor i := int64(2); i <= n; i++ {\n\t\tf = f * i\n\t}\n\treturn\n}\n\nfunc lib_BigFactorial(n int) *big.Int {\n\tresult := big.NewInt(1)\n\tfor i := 2; i <= n; i++ {\n\t\tresult = result.Mul(result, big.NewInt(int64(i)))\n\t}\n\treturn result\n}\n\nfunc lib_MemoizedFactorial(n int, cache map[int]int) (int, error) {\n\tif n > 20 { // FIXME Consider 32bit architecture\n\t\treturn 0, fmt.Errorf(\"too large n: %d\", n)\n\t}\n\n\tif cachedResult, ok := cache[n]; ok {\n\t\treturn cachedResult, nil\n\t}\n\n\tif n == 1 {\n\t\treturn 1, nil\n\t}\n\n\tbeforeResult, err := lib_MemoizedFactorial(n-1, cache)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tresult := n * beforeResult\n\tcache[n] = result\n\treturn result, nil\n}\n\nfunc lib_MemoizedBigFactorial(n int, cache map[int]*big.Int) *big.Int {\n\tif cachedResult, ok := cache[n]; ok {\n\t\treturn cachedResult\n\t}\n\n\tif n == 1 {\n\t\treturn big.NewInt(1)\n\t}\n\n\tbeforeResult := lib_MemoizedBigFactorial(n-1, cache)\n\tbigN := big.NewInt(int64(n))\n\tresult := bigN.Mul(bigN, beforeResult)\n\tcache[n] = result\n\treturn result\n}\n\nfunc lib_FindPosFromStringGrid(m [][]string, s string) (int, int) {\n\tfor rowIndex, row := range m {\n\t\tfor colIndex, p := range row {\n\t\t\tif p == s {\n\t\t\t\treturn rowIndex, colIndex\n\t\t\t}\n\t\t}\n\t}\n\tpanic(s + \" not found\")\n}\n\nfunc lib_ToYesNo(yes bool) string {\n\treturn lib_TernaryOPString(yes, \"Yes\", \"No\")\n}\n\nfunc lib_ReverseStr(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc lib_PanicIfErrorExist(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc lib_TrimSpaceAndNewLineCodeAndTab(s string) string {\n\treturn strings.TrimFunc(s, func(r rune) bool {\n\t\treturn r == ' ' || r == '\\r' || r == '\\n' || r == '\\t'\n\t})\n}\n\nconst YES = \"Yes\"\n\nconst NO = \"No\"\n\nfunc solve(S string) string {\n\tif S[2] == S[3] && S[4] == S[5] {\n\t\treturn YES\n\t} else {\n\t\treturn NO\n\t}\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar S string\n\tscanner.Scan()\n\tS = scanner.Text()\n\tfmt.Println(solve(S))\n}\n", "language": "Go", "metadata": {"date": 1586041621, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/Go/s078616489.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s078616489", "user_id": "u562039972"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.\n// $ bundle -pkg main -prefix -dst github.com/mpppk/atcoder/abc160/A github.com/mpppk/atcoder/abc160/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc (i *lib_Input) GetIntLines() (newLines [][]int, err error) {\n\treturn i.GetIntLinesFrom(0)\n}\n\nfunc (i *lib_Input) GetIntLinesFrom(fromIndex int) (newLines [][]int, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetIntLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetIntLineRange(fromRowIndex, rangeNum int) (newLines [][]int, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetIntLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetIntLine(index int) ([]int, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToIntSlice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetIntValue(rowIndex, colIndex int) (int, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int(v), nil\n}\n\nfunc (i *lib_Input) GetFirstIntValue(rowIndex int) (int, error) {\n\treturn i.GetIntValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColIntLine(colIndex int) (newLine []int, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToIntSlice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Lines() (newLines [][]int8, err error) {\n\treturn i.GetInt8LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt8LinesFrom(fromIndex int) (newLines [][]int8, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt8Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8LineRange(fromRowIndex, rangeNum int) (newLines [][]int8, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt8Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Line(index int) ([]int8, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt8Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt8Value(rowIndex, colIndex int) (int8, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int8(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt8Value(rowIndex int) (int8, error) {\n\treturn i.GetInt8Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt8Line(colIndex int) (newLine []int8, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt8Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Lines() (newLines [][]int16, err error) {\n\treturn i.GetInt16LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt16LinesFrom(fromIndex int) (newLines [][]int16, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt16Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16LineRange(fromRowIndex, rangeNum int) (newLines [][]int16, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt16Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Line(index int) ([]int16, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt16Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt16Value(rowIndex, colIndex int) (int16, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int16(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt16Value(rowIndex int) (int16, error) {\n\treturn i.GetInt16Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt16Line(colIndex int) (newLine []int16, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt16Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Lines() (newLines [][]int32, err error) {\n\treturn i.GetInt32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt32LinesFrom(fromIndex int) (newLines [][]int32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32LineRange(fromRowIndex, rangeNum int) (newLines [][]int32, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Line(index int) ([]int32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt32Value(rowIndex, colIndex int) (int32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt32Value(rowIndex int) (int32, error) {\n\treturn i.GetInt32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt32Line(colIndex int) (newLine []int32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Lines() (newLines [][]int64, err error) {\n\treturn i.GetInt64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt64LinesFrom(fromIndex int) (newLines [][]int64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64LineRange(fromRowIndex, rangeNum int) (newLines [][]int64, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Line(index int) ([]int64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt64Value(rowIndex, colIndex int) (int64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt64Value(rowIndex int) (int64, error) {\n\treturn i.GetInt64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt64Line(colIndex int) (newLine []int64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Lines() (newLines [][]float32, err error) {\n\treturn i.GetFloat32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat32LinesFrom(fromIndex int) (newLines [][]float32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32LineRange(fromRowIndex, rangeNum int) (newLines [][]float32, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Line(index int) ([]float32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat32Value(rowIndex, colIndex int) (float32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat32Value(rowIndex int) (float32, error) {\n\treturn i.GetFloat32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat32Line(colIndex int) (newLine []float32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Lines() (newLines [][]float64, err error) {\n\treturn i.GetFloat64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat64LinesFrom(fromIndex int) (newLines [][]float64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64LineRange(fromRowIndex, rangeNum int) (newLines [][]float64, err error) {\n\tcnt := 0\n\tfor index := range i.lines {\n\t\tif index < fromRowIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t\tcnt++\n\t\tif cnt >= rangeNum {\n\t\t\treturn newLines, nil\n\t\t}\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Line(index int) ([]float64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat64Value(rowIndex, colIndex int) (float64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat64Value(rowIndex int) (float64, error) {\n\treturn i.GetFloat64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat64Line(colIndex int) (newLine []float64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc lib_IntToBits(value int, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int8ToBits(value int8, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int16ToBits(value int16, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int32ToBits(value int32, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int64ToBits(value int64, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_GetEachDigitSumInt(n int) (sum int) {\n\tfor _, digit := range lib_ToDigitSliceInt(n) {\n\t\tsum += int(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt(n int) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt(digits []int8) int {\n\tv := int(0)\n\tfor i, digit := range digits {\n\t\tv += int(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt8(n int8) (sum int8) {\n\tfor _, digit := range lib_ToDigitSliceInt8(n) {\n\t\tsum += int8(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt8(n int8) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt8(digits []int8) int8 {\n\tv := int8(0)\n\tfor i, digit := range digits {\n\t\tv += int8(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt16(n int16) (sum int16) {\n\tfor _, digit := range lib_ToDigitSliceInt16(n) {\n\t\tsum += int16(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt16(n int16) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt16(digits []int8) int16 {\n\tv := int16(0)\n\tfor i, digit := range digits {\n\t\tv += int16(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt32(n int32) (sum int32) {\n\tfor _, digit := range lib_ToDigitSliceInt32(n) {\n\t\tsum += int32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt32(n int32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt32(digits []int8) int32 {\n\tv := int32(0)\n\tfor i, digit := range digits {\n\t\tv += int32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt64(n int64) (sum int64) {\n\tfor _, digit := range lib_ToDigitSliceInt64(n) {\n\t\tsum += int64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt64(n int64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt64(digits []int8) int64 {\n\tv := int64(0)\n\tfor i, digit := range digits {\n\t\tv += int64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat32(n float32) (sum float32) {\n\tfor _, digit := range lib_ToDigitSliceFloat32(n) {\n\t\tsum += float32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat32(n float32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat32(digits []int8) float32 {\n\tv := float32(0)\n\tfor i, digit := range digits {\n\t\tv += float32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat64(n float64) (sum float64) {\n\tfor _, digit := range lib_ToDigitSliceFloat64(n) {\n\t\tsum += float64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat64(n float64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat64(digits []int8) float64 {\n\tv := float64(0)\n\tfor i, digit := range digits {\n\t\tv += float64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_SumInt(values []int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt(values []int, f func(v int) bool) (newValues []int) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterIntSlice(values [][]int, f func(v []int) bool) (newValues [][]int) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt(values []int) (newValues []int) {\n\tm := map[int]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt(values1 []int, values2 []int) (newValues []int, err error) {\n\treturn lib_SubtractIntBy(values1, values2, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffIntBy(values []int, f func(v int) int) (newValues []int, err error) {\n\tdiffValues := append([]int{0}, values...)\n\tnewValues, err = lib_SubtractIntBy(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt(values []int) (newValues []int, err error) {\n\treturn lib_RDiffIntBy(values, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToIntSlice(s string) (ValueLine []int, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToIntSlice(line []string) (ValueLine []int, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt(values []int) (max int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxIntVA(values ...int) (max int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt(values []int) (min int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewIntGridMap(grid [][]string, defaultValue int) (m [][]int) {\n\tfor _, line := range grid {\n\t\tvar newLine []int\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_IntRange(start, end, step int) []int {\n\tif end < start {\n\t\treturn []int{}\n\t}\n\ts := make([]int, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt8(values []int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt8(values []int8, f func(v int8) bool) (newValues []int8) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt8Slice(values [][]int8, f func(v []int8) bool) (newValues [][]int8) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt8(values []int8) (newValues []int8) {\n\tm := map[int8]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt8(values1 []int8, values2 []int8) (newValues []int8, err error) {\n\treturn lib_SubtractInt8By(values1, values2, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tdiffValues := append([]int8{0}, values...)\n\tnewValues, err = lib_SubtractInt8By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt8(values []int8) (newValues []int8, err error) {\n\treturn lib_RDiffInt8By(values, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt8Slice(s string) (ValueLine []int8, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt8Slice(line []string) (ValueLine []int8, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8(values []int8) (max int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8VA(values ...int8) (max int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt8(values []int8) (min int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt8GridMap(grid [][]string, defaultValue int8) (m [][]int8) {\n\tfor _, line := range grid {\n\t\tvar newLine []int8\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int8Range(start, end, step int8) []int8 {\n\tif end < start {\n\t\treturn []int8{}\n\t}\n\ts := make([]int8, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt16(values []int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt16(values []int16, f func(v int16) bool) (newValues []int16) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt16Slice(values [][]int16, f func(v []int16) bool) (newValues [][]int16) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt16(values []int16) (newValues []int16) {\n\tm := map[int16]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt16(values1 []int16, values2 []int16) (newValues []int16, err error) {\n\treturn lib_SubtractInt16By(values1, values2, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tdiffValues := append([]int16{0}, values...)\n\tnewValues, err = lib_SubtractInt16By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt16(values []int16) (newValues []int16, err error) {\n\treturn lib_RDiffInt16By(values, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt16Slice(s string) (ValueLine []int16, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt16Slice(line []string) (ValueLine []int16, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16(values []int16) (max int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16VA(values ...int16) (max int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt16(values []int16) (min int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt16GridMap(grid [][]string, defaultValue int16) (m [][]int16) {\n\tfor _, line := range grid {\n\t\tvar newLine []int16\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int16Range(start, end, step int16) []int16 {\n\tif end < start {\n\t\treturn []int16{}\n\t}\n\ts := make([]int16, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt32(values []int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt32(values []int32, f func(v int32) bool) (newValues []int32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt32Slice(values [][]int32, f func(v []int32) bool) (newValues [][]int32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt32(values []int32) (newValues []int32) {\n\tm := map[int32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt32(values1 []int32, values2 []int32) (newValues []int32, err error) {\n\treturn lib_SubtractInt32By(values1, values2, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tdiffValues := append([]int32{0}, values...)\n\tnewValues, err = lib_SubtractInt32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt32(values []int32) (newValues []int32, err error) {\n\treturn lib_RDiffInt32By(values, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt32Slice(s string) (ValueLine []int32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt32Slice(line []string) (ValueLine []int32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32(values []int32) (max int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32VA(values ...int32) (max int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt32(values []int32) (min int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt32GridMap(grid [][]string, defaultValue int32) (m [][]int32) {\n\tfor _, line := range grid {\n\t\tvar newLine []int32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int32Range(start, end, step int32) []int32 {\n\tif end < start {\n\t\treturn []int32{}\n\t}\n\ts := make([]int32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt64(values []int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt64(values []int64, f func(v int64) bool) (newValues []int64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterInt64Slice(values [][]int64, f func(v []int64) bool) (newValues [][]int64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt64(values []int64) (newValues []int64) {\n\tm := map[int64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt64(values1 []int64, values2 []int64) (newValues []int64, err error) {\n\treturn lib_SubtractInt64By(values1, values2, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tdiffValues := append([]int64{0}, values...)\n\tnewValues, err = lib_SubtractInt64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt64(values []int64) (newValues []int64, err error) {\n\treturn lib_RDiffInt64By(values, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt64Slice(s string) (ValueLine []int64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt64Slice(line []string) (ValueLine []int64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64(values []int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64VA(values ...int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt64(values []int64) (min int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt64GridMap(grid [][]string, defaultValue int64) (m [][]int64) {\n\tfor _, line := range grid {\n\t\tvar newLine []int64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int64Range(start, end, step int64) []int64 {\n\tif end < start {\n\t\treturn []int64{}\n\t}\n\ts := make([]int64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat32(values []float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat32(values []float32, f func(v float32) bool) (newValues []float32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterFloat32Slice(values [][]float32, f func(v []float32) bool) (newValues [][]float32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat32(values []float32) (newValues []float32) {\n\tm := map[float32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat32(values1 []float32, values2 []float32) (newValues []float32, err error) {\n\treturn lib_SubtractFloat32By(values1, values2, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tdiffValues := append([]float32{0}, values...)\n\tnewValues, err = lib_SubtractFloat32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat32(values []float32) (newValues []float32, err error) {\n\treturn lib_RDiffFloat32By(values, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat32Slice(s string) (ValueLine []float32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat32Slice(line []string) (ValueLine []float32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32(values []float32) (max float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32VA(values ...float32) (max float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat32(values []float32) (min float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat32GridMap(grid [][]string, defaultValue float32) (m [][]float32) {\n\tfor _, line := range grid {\n\t\tvar newLine []float32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float32Range(start, end, step float32) []float32 {\n\tif end < start {\n\t\treturn []float32{}\n\t}\n\ts := make([]float32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat64(values []float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat64(values []float64, f func(v float64) bool) (newValues []float64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_FilterFloat64Slice(values [][]float64, f func(v []float64) bool) (newValues [][]float64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat64(values []float64) (newValues []float64) {\n\tm := map[float64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat64(values1 []float64, values2 []float64) (newValues []float64, err error) {\n\treturn lib_SubtractFloat64By(values1, values2, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tdiffValues := append([]float64{0}, values...)\n\tnewValues, err = lib_SubtractFloat64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat64(values []float64) (newValues []float64, err error) {\n\treturn lib_RDiffFloat64By(values, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat64Slice(s string) (ValueLine []float64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat64Slice(line []string) (ValueLine []float64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64(values []float64) (max float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64VA(values ...float64) (max float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat64(values []float64) (min float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat64GridMap(grid [][]string, defaultValue float64) (m [][]float64) {\n\tfor _, line := range grid {\n\t\tvar newLine []float64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float64Range(start, end, step float64) []float64 {\n\tif end < start {\n\t\treturn []float64{}\n\t}\n\ts := make([]float64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\ntype lib_Int3ToIntCache map[int]map[int]map[int]int\n\nfunc (c lib_Int3ToIntCache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToIntCache) Get(k1, k2, k3 int) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToIntCache) Set(k1, k2, k3 int, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt(values []int, f func(v int) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToIntSlice(values []int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt(values [][][]int, f func(v [][]int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSliceToInt(values, f))\n}\n\nfunc lib_MaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSlice2ToInt(values, f))\n}\n\ntype lib_Int83ToIntCache map[int8]map[int8]map[int8]int\n\nfunc (c lib_Int83ToIntCache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToIntCache) Get(k1, k2, k3 int8) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToIntCache) Set(k1, k2, k3 int8, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt8(values []int, f func(v int) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt8Slice(values []int) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt(values [][]int8, f func(v []int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt(values [][][]int8, f func(v [][]int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8Slice2ToInt(values, f))\n}\n\ntype lib_Int163ToIntCache map[int16]map[int16]map[int16]int\n\nfunc (c lib_Int163ToIntCache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToIntCache) Get(k1, k2, k3 int16) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToIntCache) Set(k1, k2, k3 int16, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt16(values []int, f func(v int) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt16Slice(values []int) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt(values [][]int16, f func(v []int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt(values [][][]int16, f func(v [][]int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16Slice2ToInt(values, f))\n}\n\ntype lib_Int323ToIntCache map[int32]map[int32]map[int32]int\n\nfunc (c lib_Int323ToIntCache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToIntCache) Get(k1, k2, k3 int32) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToIntCache) Set(k1, k2, k3 int32, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt32(values []int, f func(v int) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt32Slice(values []int) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt(values [][]int32, f func(v []int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt(values [][][]int32, f func(v [][]int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32Slice2ToInt(values, f))\n}\n\ntype lib_Int643ToIntCache map[int64]map[int64]map[int64]int\n\nfunc (c lib_Int643ToIntCache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToIntCache) Get(k1, k2, k3 int64) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToIntCache) Set(k1, k2, k3 int64, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByInt64(values []int, f func(v int) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt64Slice(values []int) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt(values [][]int64, f func(v []int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt(values [][][]int64, f func(v [][]int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64Slice2ToInt(values, f))\n}\n\ntype lib_Float323ToIntCache map[float32]map[float32]map[float32]int\n\nfunc (c lib_Float323ToIntCache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToIntCache) Get(k1, k2, k3 float32) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToIntCache) Set(k1, k2, k3 float32, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByFloat32(values []int, f func(v int) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat32Slice(values []int) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt(values [][]float32, f func(v []float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt(values [][][]float32, f func(v [][]float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32Slice2ToInt(values, f))\n}\n\ntype lib_Float643ToIntCache map[float64]map[float64]map[float64]int\n\nfunc (c lib_Float643ToIntCache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToIntCache) Get(k1, k2, k3 float64) (int, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToIntCache) Set(k1, k2, k3 float64, v int) int {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumIntByFloat64(values []int, f func(v int) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat64Slice(values []int) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt(values [][]float64, f func(v []float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt(values [][][]float64, f func(v [][]float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64Slice2ToInt(values, f))\n}\n\ntype lib_Int3ToInt8Cache map[int]map[int]map[int]int8\n\nfunc (c lib_Int3ToInt8Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt8Cache) Get(k1, k2, k3 int) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt8Cache) Set(k1, k2, k3 int, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt(values []int8, f func(v int8) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToIntSlice(values []int8) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt8(values [][]int, f func(v []int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt8(values [][][]int, f func(v [][]int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSlice2ToInt8(values, f))\n}\n\ntype lib_Int83ToInt8Cache map[int8]map[int8]map[int8]int8\n\nfunc (c lib_Int83ToInt8Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt8Cache) Get(k1, k2, k3 int8) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt8Cache) Set(k1, k2, k3 int8, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt8(values []int8, f func(v int8) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt8Slice(values []int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt8(values [][][]int8, f func(v [][]int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8Slice2ToInt8(values, f))\n}\n\ntype lib_Int163ToInt8Cache map[int16]map[int16]map[int16]int8\n\nfunc (c lib_Int163ToInt8Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt8Cache) Get(k1, k2, k3 int16) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt8Cache) Set(k1, k2, k3 int16, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt16(values []int8, f func(v int8) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt16Slice(values []int8) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt8(values [][]int16, f func(v []int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt8(values [][][]int16, f func(v [][]int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16Slice2ToInt8(values, f))\n}\n\ntype lib_Int323ToInt8Cache map[int32]map[int32]map[int32]int8\n\nfunc (c lib_Int323ToInt8Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt8Cache) Get(k1, k2, k3 int32) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt8Cache) Set(k1, k2, k3 int32, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt32(values []int8, f func(v int8) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt32Slice(values []int8) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt8(values [][]int32, f func(v []int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt8(values [][][]int32, f func(v [][]int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32Slice2ToInt8(values, f))\n}\n\ntype lib_Int643ToInt8Cache map[int64]map[int64]map[int64]int8\n\nfunc (c lib_Int643ToInt8Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt8Cache) Get(k1, k2, k3 int64) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt8Cache) Set(k1, k2, k3 int64, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByInt64(values []int8, f func(v int8) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt64Slice(values []int8) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt8(values [][]int64, f func(v []int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt8(values [][][]int64, f func(v [][]int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64Slice2ToInt8(values, f))\n}\n\ntype lib_Float323ToInt8Cache map[float32]map[float32]map[float32]int8\n\nfunc (c lib_Float323ToInt8Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt8Cache) Get(k1, k2, k3 float32) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt8Cache) Set(k1, k2, k3 float32, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByFloat32(values []int8, f func(v int8) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat32Slice(values []int8) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt8(values [][]float32, f func(v []float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt8(values [][][]float32, f func(v [][]float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32Slice2ToInt8(values, f))\n}\n\ntype lib_Float643ToInt8Cache map[float64]map[float64]map[float64]int8\n\nfunc (c lib_Float643ToInt8Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt8Cache) Get(k1, k2, k3 float64) (int8, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt8Cache) Set(k1, k2, k3 float64, v int8) int8 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int8{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int8{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt8ByFloat64(values []int8, f func(v int8) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat64Slice(values []int8) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt8(values [][]float64, f func(v []float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt8(values [][][]float64, f func(v [][]float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64Slice2ToInt8(values, f))\n}\n\ntype lib_Int3ToInt16Cache map[int]map[int]map[int]int16\n\nfunc (c lib_Int3ToInt16Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt16Cache) Get(k1, k2, k3 int) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt16Cache) Set(k1, k2, k3 int, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt(values []int16, f func(v int16) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToIntSlice(values []int16) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt16(values [][]int, f func(v []int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt16(values [][][]int, f func(v [][]int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSlice2ToInt16(values, f))\n}\n\ntype lib_Int83ToInt16Cache map[int8]map[int8]map[int8]int16\n\nfunc (c lib_Int83ToInt16Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt16Cache) Get(k1, k2, k3 int8) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt16Cache) Set(k1, k2, k3 int8, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt8(values []int16, f func(v int16) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt8Slice(values []int16) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt16(values [][]int8, f func(v []int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt16(values [][][]int8, f func(v [][]int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8Slice2ToInt16(values, f))\n}\n\ntype lib_Int163ToInt16Cache map[int16]map[int16]map[int16]int16\n\nfunc (c lib_Int163ToInt16Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt16Cache) Get(k1, k2, k3 int16) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt16Cache) Set(k1, k2, k3 int16, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt16(values []int16, f func(v int16) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt16Slice(values []int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt16(values [][][]int16, f func(v [][]int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16Slice2ToInt16(values, f))\n}\n\ntype lib_Int323ToInt16Cache map[int32]map[int32]map[int32]int16\n\nfunc (c lib_Int323ToInt16Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt16Cache) Get(k1, k2, k3 int32) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt16Cache) Set(k1, k2, k3 int32, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt32(values []int16, f func(v int16) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt32Slice(values []int16) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt16(values [][]int32, f func(v []int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt16(values [][][]int32, f func(v [][]int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32Slice2ToInt16(values, f))\n}\n\ntype lib_Int643ToInt16Cache map[int64]map[int64]map[int64]int16\n\nfunc (c lib_Int643ToInt16Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt16Cache) Get(k1, k2, k3 int64) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt16Cache) Set(k1, k2, k3 int64, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByInt64(values []int16, f func(v int16) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt64Slice(values []int16) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt16(values [][]int64, f func(v []int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt16(values [][][]int64, f func(v [][]int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64Slice2ToInt16(values, f))\n}\n\ntype lib_Float323ToInt16Cache map[float32]map[float32]map[float32]int16\n\nfunc (c lib_Float323ToInt16Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt16Cache) Get(k1, k2, k3 float32) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt16Cache) Set(k1, k2, k3 float32, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByFloat32(values []int16, f func(v int16) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat32Slice(values []int16) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt16(values [][]float32, f func(v []float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt16(values [][][]float32, f func(v [][]float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32Slice2ToInt16(values, f))\n}\n\ntype lib_Float643ToInt16Cache map[float64]map[float64]map[float64]int16\n\nfunc (c lib_Float643ToInt16Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt16Cache) Get(k1, k2, k3 float64) (int16, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt16Cache) Set(k1, k2, k3 float64, v int16) int16 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int16{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int16{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt16ByFloat64(values []int16, f func(v int16) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat64Slice(values []int16) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt16(values [][]float64, f func(v []float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt16(values [][][]float64, f func(v [][]float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64Slice2ToInt16(values, f))\n}\n\ntype lib_Int3ToInt32Cache map[int]map[int]map[int]int32\n\nfunc (c lib_Int3ToInt32Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt32Cache) Get(k1, k2, k3 int) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt32Cache) Set(k1, k2, k3 int, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt(values []int32, f func(v int32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToIntSlice(values []int32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt32(values [][]int, f func(v []int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt32(values [][][]int, f func(v [][]int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSlice2ToInt32(values, f))\n}\n\ntype lib_Int83ToInt32Cache map[int8]map[int8]map[int8]int32\n\nfunc (c lib_Int83ToInt32Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt32Cache) Get(k1, k2, k3 int8) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt32Cache) Set(k1, k2, k3 int8, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt8(values []int32, f func(v int32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt8Slice(values []int32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt32(values [][]int8, f func(v []int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt32(values [][][]int8, f func(v [][]int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8Slice2ToInt32(values, f))\n}\n\ntype lib_Int163ToInt32Cache map[int16]map[int16]map[int16]int32\n\nfunc (c lib_Int163ToInt32Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt32Cache) Get(k1, k2, k3 int16) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt32Cache) Set(k1, k2, k3 int16, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt16(values []int32, f func(v int32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt16Slice(values []int32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt32(values [][]int16, f func(v []int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt32(values [][][]int16, f func(v [][]int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16Slice2ToInt32(values, f))\n}\n\ntype lib_Int323ToInt32Cache map[int32]map[int32]map[int32]int32\n\nfunc (c lib_Int323ToInt32Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt32Cache) Get(k1, k2, k3 int32) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt32Cache) Set(k1, k2, k3 int32, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt32(values []int32, f func(v int32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt32Slice(values []int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt32(values [][][]int32, f func(v [][]int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32Slice2ToInt32(values, f))\n}\n\ntype lib_Int643ToInt32Cache map[int64]map[int64]map[int64]int32\n\nfunc (c lib_Int643ToInt32Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt32Cache) Get(k1, k2, k3 int64) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt32Cache) Set(k1, k2, k3 int64, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByInt64(values []int32, f func(v int32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt64Slice(values []int32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt32(values [][]int64, f func(v []int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt32(values [][][]int64, f func(v [][]int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64Slice2ToInt32(values, f))\n}\n\ntype lib_Float323ToInt32Cache map[float32]map[float32]map[float32]int32\n\nfunc (c lib_Float323ToInt32Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt32Cache) Get(k1, k2, k3 float32) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt32Cache) Set(k1, k2, k3 float32, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByFloat32(values []int32, f func(v int32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat32Slice(values []int32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt32(values [][]float32, f func(v []float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt32(values [][][]float32, f func(v [][]float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32Slice2ToInt32(values, f))\n}\n\ntype lib_Float643ToInt32Cache map[float64]map[float64]map[float64]int32\n\nfunc (c lib_Float643ToInt32Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt32Cache) Get(k1, k2, k3 float64) (int32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt32Cache) Set(k1, k2, k3 float64, v int32) int32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt32ByFloat64(values []int32, f func(v int32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat64Slice(values []int32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt32(values [][]float64, f func(v []float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt32(values [][][]float64, f func(v [][]float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64Slice2ToInt32(values, f))\n}\n\ntype lib_Int3ToInt64Cache map[int]map[int]map[int]int64\n\nfunc (c lib_Int3ToInt64Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToInt64Cache) Get(k1, k2, k3 int) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToInt64Cache) Set(k1, k2, k3 int, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt(values []int64, f func(v int64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToIntSlice(values []int64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt64(values [][]int, f func(v []int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt64(values [][][]int, f func(v [][]int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSlice2ToInt64(values, f))\n}\n\ntype lib_Int83ToInt64Cache map[int8]map[int8]map[int8]int64\n\nfunc (c lib_Int83ToInt64Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToInt64Cache) Get(k1, k2, k3 int8) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToInt64Cache) Set(k1, k2, k3 int8, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt8(values []int64, f func(v int64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt8Slice(values []int64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt64(values [][]int8, f func(v []int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt64(values [][][]int8, f func(v [][]int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8Slice2ToInt64(values, f))\n}\n\ntype lib_Int163ToInt64Cache map[int16]map[int16]map[int16]int64\n\nfunc (c lib_Int163ToInt64Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToInt64Cache) Get(k1, k2, k3 int16) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToInt64Cache) Set(k1, k2, k3 int16, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt16(values []int64, f func(v int64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt16Slice(values []int64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt64(values [][]int16, f func(v []int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt64(values [][][]int16, f func(v [][]int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16Slice2ToInt64(values, f))\n}\n\ntype lib_Int323ToInt64Cache map[int32]map[int32]map[int32]int64\n\nfunc (c lib_Int323ToInt64Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToInt64Cache) Get(k1, k2, k3 int32) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToInt64Cache) Set(k1, k2, k3 int32, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt32(values []int64, f func(v int64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt32Slice(values []int64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt64(values [][]int32, f func(v []int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt64(values [][][]int32, f func(v [][]int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32Slice2ToInt64(values, f))\n}\n\ntype lib_Int643ToInt64Cache map[int64]map[int64]map[int64]int64\n\nfunc (c lib_Int643ToInt64Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToInt64Cache) Get(k1, k2, k3 int64) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToInt64Cache) Set(k1, k2, k3 int64, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByInt64(values []int64, f func(v int64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt64Slice(values []int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt64(values [][][]int64, f func(v [][]int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64Slice2ToInt64(values, f))\n}\n\ntype lib_Float323ToInt64Cache map[float32]map[float32]map[float32]int64\n\nfunc (c lib_Float323ToInt64Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToInt64Cache) Get(k1, k2, k3 float32) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToInt64Cache) Set(k1, k2, k3 float32, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByFloat32(values []int64, f func(v int64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat32Slice(values []int64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt64(values [][]float32, f func(v []float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt64(values [][][]float32, f func(v [][]float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32Slice2ToInt64(values, f))\n}\n\ntype lib_Float643ToInt64Cache map[float64]map[float64]map[float64]int64\n\nfunc (c lib_Float643ToInt64Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToInt64Cache) Get(k1, k2, k3 float64) (int64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToInt64Cache) Set(k1, k2, k3 float64, v int64) int64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]int64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]int64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumInt64ByFloat64(values []int64, f func(v int64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat64Slice(values []int64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt64(values [][]float64, f func(v []float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt64(values [][][]float64, f func(v [][]float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64Slice2ToInt64(values, f))\n}\n\ntype lib_Int3ToFloat32Cache map[int]map[int]map[int]float32\n\nfunc (c lib_Int3ToFloat32Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToFloat32Cache) Get(k1, k2, k3 int) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToFloat32Cache) Set(k1, k2, k3 int, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt(values []float32, f func(v float32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToIntSlice(values []float32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat32(values [][]int, f func(v []int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat32(values [][][]int, f func(v [][]int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSlice2ToFloat32(values, f))\n}\n\ntype lib_Int83ToFloat32Cache map[int8]map[int8]map[int8]float32\n\nfunc (c lib_Int83ToFloat32Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToFloat32Cache) Get(k1, k2, k3 int8) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToFloat32Cache) Set(k1, k2, k3 int8, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt8(values []float32, f func(v float32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt8Slice(values []float32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat32(values [][]int8, f func(v []int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat32(values [][][]int8, f func(v [][]int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8Slice2ToFloat32(values, f))\n}\n\ntype lib_Int163ToFloat32Cache map[int16]map[int16]map[int16]float32\n\nfunc (c lib_Int163ToFloat32Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToFloat32Cache) Get(k1, k2, k3 int16) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToFloat32Cache) Set(k1, k2, k3 int16, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt16(values []float32, f func(v float32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt16Slice(values []float32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat32(values [][]int16, f func(v []int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat32(values [][][]int16, f func(v [][]int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16Slice2ToFloat32(values, f))\n}\n\ntype lib_Int323ToFloat32Cache map[int32]map[int32]map[int32]float32\n\nfunc (c lib_Int323ToFloat32Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToFloat32Cache) Get(k1, k2, k3 int32) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToFloat32Cache) Set(k1, k2, k3 int32, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt32(values []float32, f func(v float32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt32Slice(values []float32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat32(values [][]int32, f func(v []int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat32(values [][][]int32, f func(v [][]int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32Slice2ToFloat32(values, f))\n}\n\ntype lib_Int643ToFloat32Cache map[int64]map[int64]map[int64]float32\n\nfunc (c lib_Int643ToFloat32Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToFloat32Cache) Get(k1, k2, k3 int64) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToFloat32Cache) Set(k1, k2, k3 int64, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByInt64(values []float32, f func(v float32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt64Slice(values []float32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat32(values [][]int64, f func(v []int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat32(values [][][]int64, f func(v [][]int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64Slice2ToFloat32(values, f))\n}\n\ntype lib_Float323ToFloat32Cache map[float32]map[float32]map[float32]float32\n\nfunc (c lib_Float323ToFloat32Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToFloat32Cache) Get(k1, k2, k3 float32) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToFloat32Cache) Set(k1, k2, k3 float32, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByFloat32(values []float32, f func(v float32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat32Slice(values []float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat32(values [][][]float32, f func(v [][]float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32Slice2ToFloat32(values, f))\n}\n\ntype lib_Float643ToFloat32Cache map[float64]map[float64]map[float64]float32\n\nfunc (c lib_Float643ToFloat32Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToFloat32Cache) Get(k1, k2, k3 float64) (float32, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToFloat32Cache) Set(k1, k2, k3 float64, v float32) float32 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]float32{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]float32{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat32ByFloat64(values []float32, f func(v float32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat64Slice(values []float32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat32(values [][]float64, f func(v []float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat32(values [][][]float64, f func(v [][]float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64Slice2ToFloat32(values, f))\n}\n\ntype lib_Int3ToFloat64Cache map[int]map[int]map[int]float64\n\nfunc (c lib_Int3ToFloat64Cache) Has(k1, k2, k3 int) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int3ToFloat64Cache) Get(k1, k2, k3 int) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int3ToFloat64Cache) Set(k1, k2, k3 int, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int]map[int]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt(values []float64, f func(v float64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToIntSlice(values []float64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat64(values [][]int, f func(v []int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat64(values [][][]int, f func(v [][]int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSlice2ToFloat64(values, f))\n}\n\ntype lib_Int83ToFloat64Cache map[int8]map[int8]map[int8]float64\n\nfunc (c lib_Int83ToFloat64Cache) Has(k1, k2, k3 int8) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int83ToFloat64Cache) Get(k1, k2, k3 int8) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int83ToFloat64Cache) Set(k1, k2, k3 int8, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int8]map[int8]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int8]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt8(values []float64, f func(v float64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt8Slice(values []float64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat64(values [][]int8, f func(v []int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat64(values [][][]int8, f func(v [][]int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8Slice2ToFloat64(values, f))\n}\n\ntype lib_Int163ToFloat64Cache map[int16]map[int16]map[int16]float64\n\nfunc (c lib_Int163ToFloat64Cache) Has(k1, k2, k3 int16) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int163ToFloat64Cache) Get(k1, k2, k3 int16) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int163ToFloat64Cache) Set(k1, k2, k3 int16, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int16]map[int16]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int16]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt16(values []float64, f func(v float64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt16Slice(values []float64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat64(values [][]int16, f func(v []int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat64(values [][][]int16, f func(v [][]int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16Slice2ToFloat64(values, f))\n}\n\ntype lib_Int323ToFloat64Cache map[int32]map[int32]map[int32]float64\n\nfunc (c lib_Int323ToFloat64Cache) Has(k1, k2, k3 int32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int323ToFloat64Cache) Get(k1, k2, k3 int32) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int323ToFloat64Cache) Set(k1, k2, k3 int32, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int32]map[int32]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int32]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt32(values []float64, f func(v float64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt32Slice(values []float64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat64(values [][]int32, f func(v []int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat64(values [][][]int32, f func(v [][]int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32Slice2ToFloat64(values, f))\n}\n\ntype lib_Int643ToFloat64Cache map[int64]map[int64]map[int64]float64\n\nfunc (c lib_Int643ToFloat64Cache) Has(k1, k2, k3 int64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Int643ToFloat64Cache) Get(k1, k2, k3 int64) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Int643ToFloat64Cache) Set(k1, k2, k3 int64, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[int64]map[int64]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[int64]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByInt64(values []float64, f func(v float64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt64Slice(values []float64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat64(values [][]int64, f func(v []int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat64(values [][][]int64, f func(v [][]int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64Slice2ToFloat64(values, f))\n}\n\ntype lib_Float323ToFloat64Cache map[float32]map[float32]map[float32]float64\n\nfunc (c lib_Float323ToFloat64Cache) Has(k1, k2, k3 float32) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float323ToFloat64Cache) Get(k1, k2, k3 float32) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float323ToFloat64Cache) Set(k1, k2, k3 float32, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float32]map[float32]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float32]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByFloat32(values []float64, f func(v float64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat32Slice(values []float64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat64(values [][]float32, f func(v []float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat64(values [][][]float32, f func(v [][]float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32Slice2ToFloat64(values, f))\n}\n\ntype lib_Float643ToFloat64Cache map[float64]map[float64]map[float64]float64\n\nfunc (c lib_Float643ToFloat64Cache) Has(k1, k2, k3 float64) bool {\n\tif _, ok := c[k1]; !ok {\n\t\treturn false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn false\n\t}\n\n\t_, ok := c[k1][k2][k3]\n\treturn ok\n}\n\nfunc (c lib_Float643ToFloat64Cache) Get(k1, k2, k3 float64) (float64, bool) {\n\tif _, ok := c[k1]; !ok {\n\t\treturn 0, false\n\t}\n\n\tif _, ok := c[k1][k2]; !ok {\n\t\treturn 0, false\n\t}\n\n\tv, ok := c[k1][k2][k3]\n\treturn v, ok\n}\n\nfunc (c lib_Float643ToFloat64Cache) Set(k1, k2, k3 float64, v float64) float64 {\n\tif _, ok := c[k1]; !ok {\n\t\tc[k1] = map[float64]map[float64]float64{}\n\t}\n\tif _, ok := c[k1][k2]; !ok {\n\t\tc[k1][k2] = map[float64]float64{}\n\t}\n\tc[k1][k2][k3] = v\n\treturn v\n}\n\nfunc lib_SumFloat64ByFloat64(values []float64, f func(v float64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat64Slice(values []float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat64(values [][][]float64, f func(v [][]float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64Slice2ToFloat64(values, f))\n}\n\nfunc lib_ReduceRune(values []rune, f func(acc, cur rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceRuneSlice(values [][]rune, f func(acc rune, cur []rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyRune(values []rune) []rune {\n\tdst := make([]rune, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyRuneSlice(values [][]rune) [][]rune {\n\tdst := make([][]rune, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyRune(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseRune(values []rune) []rune {\n\tnewValues := lib_CopyRune(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseRuneSlice(values [][]rune) [][]rune {\n\tnewValues := lib_CopyRuneSlice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapRune(values []rune, f func(v rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapRuneSlice(values [][]rune, f func(v []rune) []rune) (newValues [][]rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeRune(values [][]rune, f func(v []rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipRune(valuesList ...[]rune) (newValuesList [][]rune, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipRune\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipRune\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []rune\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []rune\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []rune{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetRune(values []rune, i int) ([]rune, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []rune{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]rune, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_RuneCombination(values []rune, r int) (combinations [][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_RuneCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RunePermutation(values []rune, r int) (permutations [][]rune) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_RuneRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_RunePermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneSliceCombination(values [][]rune, r int) (combinations [][][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_RuneSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneRemoveFromSlice(slice []rune, i int) []rune {\n\tn := make([]rune, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPRune(ok bool, v1, v2 rune) rune {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindRune struct {\n\tnodes map[rune]rune\n}\n\nfunc lib_NewUnionFindRune(values []rune) *lib_UnionFindRune {\n\tm := map[rune]rune{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindRune{nodes: m}\n}\n\nfunc (u *lib_UnionFindRune) GetRoot(value rune) (rune, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindRune) Unite(v1, v2 rune) (rune, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindRune) IsSameGroup(v1, v2 rune) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeRune(f func(v rune) rune) func(v rune) rune {\n\tcache := map[rune]rune{}\n\treturn func(v rune) rune {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceString(values []string, f func(acc, cur string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceStringSlice(values [][]string, f func(acc string, cur []string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyString(values []string) []string {\n\tdst := make([]string, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyStringSlice(values [][]string) [][]string {\n\tdst := make([][]string, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyString(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseString(values []string) []string {\n\tnewValues := lib_CopyString(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseStringSlice(values [][]string) [][]string {\n\tnewValues := lib_CopyStringSlice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapString(values []string, f func(v string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapStringSlice(values [][]string, f func(v []string) []string) (newValues [][]string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeString(values [][]string, f func(v []string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipString(valuesList ...[]string) (newValuesList [][]string, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipString\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipString\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []string\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkStringByBits(values []string, bits []bool) (newValues [][]string, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []string\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []string{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetString(values []string, i int) ([]string, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []string{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]string, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_StringCombination(values []string, r int) (combinations [][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_StringCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringPermutation(values []string, r int) (permutations [][]string) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_StringRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_StringPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringSliceCombination(values [][]string, r int) (combinations [][][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_StringSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringRemoveFromSlice(slice []string, i int) []string {\n\tn := make([]string, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPString(ok bool, v1, v2 string) string {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindString struct {\n\tnodes map[string]string\n}\n\nfunc lib_NewUnionFindString(values []string) *lib_UnionFindString {\n\tm := map[string]string{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindString{nodes: m}\n}\n\nfunc (u *lib_UnionFindString) GetRoot(value string) (string, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindString) Unite(v1, v2 string) (string, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindString) IsSameGroup(v1, v2 string) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeString(f func(v string) string) func(v string) string {\n\tcache := map[string]string{}\n\treturn func(v string) string {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt(values []int, f func(acc, cur int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceIntSlice(values [][]int, f func(acc int, cur []int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt(values []int) []int {\n\tdst := make([]int, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyIntSlice(values [][]int) [][]int {\n\tdst := make([][]int, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt(values []int) []int {\n\tnewValues := lib_CopyInt(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseIntSlice(values [][]int) [][]int {\n\tnewValues := lib_CopyIntSlice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt(values []int, f func(v int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice(values [][]int, f func(v []int) []int) (newValues [][]int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt(valuesList ...[]int) (newValuesList [][]int, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkIntByBits(values []int, bits []bool) (newValues [][]int, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt(values []int, i int) ([]int, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_IntCombination(values []int, r int) (combinations [][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_IntCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntPermutation(values []int, r int) (permutations [][]int) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_IntRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_IntPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntSliceCombination(values [][]int, r int) (combinations [][][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_IntSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntRemoveFromSlice(slice []int, i int) []int {\n\tn := make([]int, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt(ok bool, v1, v2 int) int {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt struct {\n\tnodes map[int]int\n}\n\nfunc lib_NewUnionFindInt(values []int) *lib_UnionFindInt {\n\tm := map[int]int{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt) GetRoot(value int) (int, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt) Unite(v1, v2 int) (int, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt) IsSameGroup(v1, v2 int) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt(f func(v int) int) func(v int) int {\n\tcache := map[int]int{}\n\treturn func(v int) int {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt8(values []int8, f func(acc, cur int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt8Slice(values [][]int8, f func(acc int8, cur []int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt8(values []int8) []int8 {\n\tdst := make([]int8, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt8Slice(values [][]int8) [][]int8 {\n\tdst := make([][]int8, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt8(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt8(values []int8) []int8 {\n\tnewValues := lib_CopyInt8(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt8Slice(values [][]int8) [][]int8 {\n\tnewValues := lib_CopyInt8Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt8(values []int8, f func(v int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice(values [][]int8, f func(v []int8) []int8) (newValues [][]int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt8(valuesList ...[]int8) (newValuesList [][]int8, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt8\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt8\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int8\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int8\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int8{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt8(values []int8, i int) ([]int8, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int8{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int8, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int8Combination(values []int8, r int) (combinations [][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int8Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8Permutation(values []int8, r int) (permutations [][]int8) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int8RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int8Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8SliceCombination(values [][]int8, r int) (combinations [][][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int8SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8RemoveFromSlice(slice []int8, i int) []int8 {\n\tn := make([]int8, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt8(ok bool, v1, v2 int8) int8 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt8 struct {\n\tnodes map[int8]int8\n}\n\nfunc lib_NewUnionFindInt8(values []int8) *lib_UnionFindInt8 {\n\tm := map[int8]int8{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt8{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt8) GetRoot(value int8) (int8, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt8) Unite(v1, v2 int8) (int8, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt8) IsSameGroup(v1, v2 int8) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt8(f func(v int8) int8) func(v int8) int8 {\n\tcache := map[int8]int8{}\n\treturn func(v int8) int8 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt16(values []int16, f func(acc, cur int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt16Slice(values [][]int16, f func(acc int16, cur []int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt16(values []int16) []int16 {\n\tdst := make([]int16, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt16Slice(values [][]int16) [][]int16 {\n\tdst := make([][]int16, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt16(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt16(values []int16) []int16 {\n\tnewValues := lib_CopyInt16(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt16Slice(values [][]int16) [][]int16 {\n\tnewValues := lib_CopyInt16Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt16(values []int16, f func(v int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice(values [][]int16, f func(v []int16) []int16) (newValues [][]int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt16(valuesList ...[]int16) (newValuesList [][]int16, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt16\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt16\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int16\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int16\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int16{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt16(values []int16, i int) ([]int16, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int16{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int16, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int16Combination(values []int16, r int) (combinations [][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int16Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16Permutation(values []int16, r int) (permutations [][]int16) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int16RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int16Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16SliceCombination(values [][]int16, r int) (combinations [][][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int16SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16RemoveFromSlice(slice []int16, i int) []int16 {\n\tn := make([]int16, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt16(ok bool, v1, v2 int16) int16 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt16 struct {\n\tnodes map[int16]int16\n}\n\nfunc lib_NewUnionFindInt16(values []int16) *lib_UnionFindInt16 {\n\tm := map[int16]int16{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt16{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt16) GetRoot(value int16) (int16, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt16) Unite(v1, v2 int16) (int16, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt16) IsSameGroup(v1, v2 int16) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt16(f func(v int16) int16) func(v int16) int16 {\n\tcache := map[int16]int16{}\n\treturn func(v int16) int16 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt32(values []int32, f func(acc, cur int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt32Slice(values [][]int32, f func(acc int32, cur []int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt32(values []int32) []int32 {\n\tdst := make([]int32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt32Slice(values [][]int32) [][]int32 {\n\tdst := make([][]int32, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt32(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt32(values []int32) []int32 {\n\tnewValues := lib_CopyInt32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt32Slice(values [][]int32) [][]int32 {\n\tnewValues := lib_CopyInt32Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt32(values []int32, f func(v int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice(values [][]int32, f func(v []int32) []int32) (newValues [][]int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt32(valuesList ...[]int32) (newValuesList [][]int32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt32(values []int32, i int) ([]int32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int32Combination(values []int32, r int) (combinations [][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32Permutation(values []int32, r int) (permutations [][]int32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32SliceCombination(values [][]int32, r int) (combinations [][][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32RemoveFromSlice(slice []int32, i int) []int32 {\n\tn := make([]int32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt32(ok bool, v1, v2 int32) int32 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt32 struct {\n\tnodes map[int32]int32\n}\n\nfunc lib_NewUnionFindInt32(values []int32) *lib_UnionFindInt32 {\n\tm := map[int32]int32{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt32{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt32) GetRoot(value int32) (int32, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt32) Unite(v1, v2 int32) (int32, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt32) IsSameGroup(v1, v2 int32) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt32(f func(v int32) int32) func(v int32) int32 {\n\tcache := map[int32]int32{}\n\treturn func(v int32) int32 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceInt64(values []int64, f func(acc, cur int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt64Slice(values [][]int64, f func(acc int64, cur []int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt64(values []int64) []int64 {\n\tdst := make([]int64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyInt64Slice(values [][]int64) [][]int64 {\n\tdst := make([][]int64, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyInt64(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseInt64(values []int64) []int64 {\n\tnewValues := lib_CopyInt64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseInt64Slice(values [][]int64) [][]int64 {\n\tnewValues := lib_CopyInt64Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt64(values []int64, f func(v int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice(values [][]int64, f func(v []int64) []int64) (newValues [][]int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt64(valuesList ...[]int64) (newValuesList [][]int64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt64(values []int64, i int) ([]int64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int64Combination(values []int64, r int) (combinations [][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64Permutation(values []int64, r int) (permutations [][]int64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64SliceCombination(values [][]int64, r int) (combinations [][][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64RemoveFromSlice(slice []int64, i int) []int64 {\n\tn := make([]int64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPInt64(ok bool, v1, v2 int64) int64 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindInt64 struct {\n\tnodes map[int64]int64\n}\n\nfunc lib_NewUnionFindInt64(values []int64) *lib_UnionFindInt64 {\n\tm := map[int64]int64{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindInt64{nodes: m}\n}\n\nfunc (u *lib_UnionFindInt64) GetRoot(value int64) (int64, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindInt64) Unite(v1, v2 int64) (int64, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindInt64) IsSameGroup(v1, v2 int64) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeInt64(f func(v int64) int64) func(v int64) int64 {\n\tcache := map[int64]int64{}\n\treturn func(v int64) int64 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceFloat32(values []float32, f func(acc, cur float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat32Slice(values [][]float32, f func(acc float32, cur []float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat32(values []float32) []float32 {\n\tdst := make([]float32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyFloat32Slice(values [][]float32) [][]float32 {\n\tdst := make([][]float32, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyFloat32(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseFloat32(values []float32) []float32 {\n\tnewValues := lib_CopyFloat32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseFloat32Slice(values [][]float32) [][]float32 {\n\tnewValues := lib_CopyFloat32Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat32(values []float32, f func(v float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice(values [][]float32, f func(v []float32) []float32) (newValues [][]float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat32(valuesList ...[]float32) (newValuesList [][]float32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat32(values []float32, i int) ([]float32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float32Combination(values []float32, r int) (combinations [][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32Permutation(values []float32, r int) (permutations [][]float32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32SliceCombination(values [][]float32, r int) (combinations [][][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32RemoveFromSlice(slice []float32, i int) []float32 {\n\tn := make([]float32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPFloat32(ok bool, v1, v2 float32) float32 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindFloat32 struct {\n\tnodes map[float32]float32\n}\n\nfunc lib_NewUnionFindFloat32(values []float32) *lib_UnionFindFloat32 {\n\tm := map[float32]float32{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindFloat32{nodes: m}\n}\n\nfunc (u *lib_UnionFindFloat32) GetRoot(value float32) (float32, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindFloat32) Unite(v1, v2 float32) (float32, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindFloat32) IsSameGroup(v1, v2 float32) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeFloat32(f func(v float32) float32) func(v float32) float32 {\n\tcache := map[float32]float32{}\n\treturn func(v float32) float32 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_ReduceFloat64(values []float64, f func(acc, cur float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat64Slice(values [][]float64, f func(acc float64, cur []float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat64(values []float64) []float64 {\n\tdst := make([]float64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_CopyFloat64Slice(values [][]float64) [][]float64 {\n\tdst := make([][]float64, len(values))\n\tfor i, value := range values {\n\t\tdst[i] = lib_CopyFloat64(value)\n\t}\n\treturn dst\n}\n\nfunc lib_ReverseFloat64(values []float64) []float64 {\n\tnewValues := lib_CopyFloat64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_ReverseFloat64Slice(values [][]float64) [][]float64 {\n\tnewValues := lib_CopyFloat64Slice(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat64(values []float64, f func(v float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice(values [][]float64, f func(v []float64) []float64) (newValues [][]float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat64(valuesList ...[]float64) (newValuesList [][]float64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat64(values []float64, i int) ([]float64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float64Combination(values []float64, r int) (combinations [][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64Permutation(values []float64, r int) (permutations [][]float64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64SliceCombination(values [][]float64, r int) (combinations [][][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64RemoveFromSlice(slice []float64, i int) []float64 {\n\tn := make([]float64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_TernaryOPFloat64(ok bool, v1, v2 float64) float64 {\n\tif ok {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\ntype lib_UnionFindFloat64 struct {\n\tnodes map[float64]float64\n}\n\nfunc lib_NewUnionFindFloat64(values []float64) *lib_UnionFindFloat64 {\n\tm := map[float64]float64{}\n\tfor _, v := range values {\n\t\tm[v] = v\n\t}\n\treturn &lib_UnionFindFloat64{nodes: m}\n}\n\nfunc (u *lib_UnionFindFloat64) GetRoot(value float64) (float64, int) {\n\tv := value\n\tnewV := u.nodes[v]\n\tcnt := 0\n\tfor newV != v {\n\t\tcnt++\n\t\toldV := v\n\t\tv = newV\n\t\tnewV = u.nodes[newV]\n\t\tu.nodes[oldV] = newV\n\t}\n\treturn newV, cnt\n}\n\nfunc (u *lib_UnionFindFloat64) Unite(v1, v2 float64) (float64, bool) {\n\tv1Root, v1HopNum := u.GetRoot(v1)\n\tv2Root, v2HopNum := u.GetRoot(v2)\n\tif v1Root == v2Root {\n\t\treturn v1Root, false\n\t}\n\tif v1HopNum >= v2HopNum {\n\t\tu.nodes[v2Root] = v1Root\n\t\treturn v1Root, true\n\t}\n\tu.nodes[v1Root] = v2Root\n\treturn v2Root, true\n}\n\nfunc (u *lib_UnionFindFloat64) IsSameGroup(v1, v2 float64) bool {\n\tv1Root, _ := u.GetRoot(v1)\n\tv2Root, _ := u.GetRoot(v2)\n\treturn v1Root == v2Root\n}\n\nfunc lib_MemoizeFloat64(f func(v float64) float64) func(v float64) float64 {\n\tcache := map[float64]float64{}\n\treturn func(v float64) float64 {\n\t\tif cachedResult, ok := cache[v]; ok {\n\t\t\treturn cachedResult\n\t\t}\n\t\tresult := f(v)\n\t\tcache[v] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToRune(f func(v1, v2 rune) rune) func(v1, v2 rune) rune {\n\tcache := map[rune]map[rune]rune{}\n\n\treturn func(v1, v2 rune) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToRune(f func(v1, v2, v3, v4, v5 rune) rune) func(v1, v2, v3, v4, v5 rune) rune {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToString(f func(v1, v2 rune) string) func(v1, v2 rune) string {\n\tcache := map[rune]map[rune]string{}\n\n\treturn func(v1, v2 rune) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToString(f func(v1, v2, v3, v4, v5 rune) string) func(v1, v2, v3, v4, v5 rune) string {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]string{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt(f func(v1, v2 rune) int) func(v1, v2 rune) int {\n\tcache := map[rune]map[rune]int{}\n\n\treturn func(v1, v2 rune) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt(f func(v1, v2, v3, v4, v5 rune) int) func(v1, v2, v3, v4, v5 rune) int {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt8(f func(v1, v2 rune) int8) func(v1, v2 rune) int8 {\n\tcache := map[rune]map[rune]int8{}\n\n\treturn func(v1, v2 rune) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt8(f func(v1, v2, v3, v4, v5 rune) int8) func(v1, v2, v3, v4, v5 rune) int8 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt16(f func(v1, v2 rune) int16) func(v1, v2 rune) int16 {\n\tcache := map[rune]map[rune]int16{}\n\n\treturn func(v1, v2 rune) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt16(f func(v1, v2, v3, v4, v5 rune) int16) func(v1, v2, v3, v4, v5 rune) int16 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt32(f func(v1, v2 rune) int32) func(v1, v2 rune) int32 {\n\tcache := map[rune]map[rune]int32{}\n\n\treturn func(v1, v2 rune) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt32(f func(v1, v2, v3, v4, v5 rune) int32) func(v1, v2, v3, v4, v5 rune) int32 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToInt64(f func(v1, v2 rune) int64) func(v1, v2 rune) int64 {\n\tcache := map[rune]map[rune]int64{}\n\n\treturn func(v1, v2 rune) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToInt64(f func(v1, v2, v3, v4, v5 rune) int64) func(v1, v2, v3, v4, v5 rune) int64 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToFloat32(f func(v1, v2 rune) float32) func(v1, v2 rune) float32 {\n\tcache := map[rune]map[rune]float32{}\n\n\treturn func(v1, v2 rune) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToFloat32(f func(v1, v2, v3, v4, v5 rune) float32) func(v1, v2, v3, v4, v5 rune) float32 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune2ToFloat64(f func(v1, v2 rune) float64) func(v1, v2 rune) float64 {\n\tcache := map[rune]map[rune]float64{}\n\n\treturn func(v1, v2 rune) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[rune]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeRune5ToFloat64(f func(v1, v2, v3, v4, v5 rune) float64) func(v1, v2, v3, v4, v5 rune) float64 {\n\tcache := map[rune]map[rune]map[rune]map[rune]map[rune]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 rune) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[rune]map[rune]map[rune]map[rune]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[rune]map[rune]map[rune]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[rune]map[rune]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[rune]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToRune(f func(v1, v2 string) rune) func(v1, v2 string) rune {\n\tcache := map[string]map[string]rune{}\n\n\treturn func(v1, v2 string) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToRune(f func(v1, v2, v3, v4, v5 string) rune) func(v1, v2, v3, v4, v5 string) rune {\n\tcache := map[string]map[string]map[string]map[string]map[string]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 string) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToString(f func(v1, v2 string) string) func(v1, v2 string) string {\n\tcache := map[string]map[string]string{}\n\n\treturn func(v1, v2 string) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToString(f func(v1, v2, v3, v4, v5 string) string) func(v1, v2, v3, v4, v5 string) string {\n\tcache := map[string]map[string]map[string]map[string]map[string]string{}\n\n\treturn func(v1, v2, v3, v4, v5 string) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt(f func(v1, v2 string) int) func(v1, v2 string) int {\n\tcache := map[string]map[string]int{}\n\n\treturn func(v1, v2 string) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt(f func(v1, v2, v3, v4, v5 string) int) func(v1, v2, v3, v4, v5 string) int {\n\tcache := map[string]map[string]map[string]map[string]map[string]int{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt8(f func(v1, v2 string) int8) func(v1, v2 string) int8 {\n\tcache := map[string]map[string]int8{}\n\n\treturn func(v1, v2 string) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt8(f func(v1, v2, v3, v4, v5 string) int8) func(v1, v2, v3, v4, v5 string) int8 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt16(f func(v1, v2 string) int16) func(v1, v2 string) int16 {\n\tcache := map[string]map[string]int16{}\n\n\treturn func(v1, v2 string) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt16(f func(v1, v2, v3, v4, v5 string) int16) func(v1, v2, v3, v4, v5 string) int16 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt32(f func(v1, v2 string) int32) func(v1, v2 string) int32 {\n\tcache := map[string]map[string]int32{}\n\n\treturn func(v1, v2 string) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt32(f func(v1, v2, v3, v4, v5 string) int32) func(v1, v2, v3, v4, v5 string) int32 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToInt64(f func(v1, v2 string) int64) func(v1, v2 string) int64 {\n\tcache := map[string]map[string]int64{}\n\n\treturn func(v1, v2 string) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToInt64(f func(v1, v2, v3, v4, v5 string) int64) func(v1, v2, v3, v4, v5 string) int64 {\n\tcache := map[string]map[string]map[string]map[string]map[string]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 string) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToFloat32(f func(v1, v2 string) float32) func(v1, v2 string) float32 {\n\tcache := map[string]map[string]float32{}\n\n\treturn func(v1, v2 string) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToFloat32(f func(v1, v2, v3, v4, v5 string) float32) func(v1, v2, v3, v4, v5 string) float32 {\n\tcache := map[string]map[string]map[string]map[string]map[string]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 string) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString2ToFloat64(f func(v1, v2 string) float64) func(v1, v2 string) float64 {\n\tcache := map[string]map[string]float64{}\n\n\treturn func(v1, v2 string) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[string]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeString5ToFloat64(f func(v1, v2, v3, v4, v5 string) float64) func(v1, v2, v3, v4, v5 string) float64 {\n\tcache := map[string]map[string]map[string]map[string]map[string]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 string) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[string]map[string]map[string]map[string]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[string]map[string]map[string]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[string]map[string]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[string]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToRune(f func(v1, v2 int) rune) func(v1, v2 int) rune {\n\tcache := map[int]map[int]rune{}\n\n\treturn func(v1, v2 int) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToRune(f func(v1, v2, v3, v4, v5 int) rune) func(v1, v2, v3, v4, v5 int) rune {\n\tcache := map[int]map[int]map[int]map[int]map[int]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToString(f func(v1, v2 int) string) func(v1, v2 int) string {\n\tcache := map[int]map[int]string{}\n\n\treturn func(v1, v2 int) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToString(f func(v1, v2, v3, v4, v5 int) string) func(v1, v2, v3, v4, v5 int) string {\n\tcache := map[int]map[int]map[int]map[int]map[int]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt(f func(v1, v2 int) int) func(v1, v2 int) int {\n\tcache := map[int]map[int]int{}\n\n\treturn func(v1, v2 int) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt(f func(v1, v2, v3, v4, v5 int) int) func(v1, v2, v3, v4, v5 int) int {\n\tcache := map[int]map[int]map[int]map[int]map[int]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt8(f func(v1, v2 int) int8) func(v1, v2 int) int8 {\n\tcache := map[int]map[int]int8{}\n\n\treturn func(v1, v2 int) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt8(f func(v1, v2, v3, v4, v5 int) int8) func(v1, v2, v3, v4, v5 int) int8 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt16(f func(v1, v2 int) int16) func(v1, v2 int) int16 {\n\tcache := map[int]map[int]int16{}\n\n\treturn func(v1, v2 int) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt16(f func(v1, v2, v3, v4, v5 int) int16) func(v1, v2, v3, v4, v5 int) int16 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt32(f func(v1, v2 int) int32) func(v1, v2 int) int32 {\n\tcache := map[int]map[int]int32{}\n\n\treturn func(v1, v2 int) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt32(f func(v1, v2, v3, v4, v5 int) int32) func(v1, v2, v3, v4, v5 int) int32 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToInt64(f func(v1, v2 int) int64) func(v1, v2 int) int64 {\n\tcache := map[int]map[int]int64{}\n\n\treturn func(v1, v2 int) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToInt64(f func(v1, v2, v3, v4, v5 int) int64) func(v1, v2, v3, v4, v5 int) int64 {\n\tcache := map[int]map[int]map[int]map[int]map[int]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToFloat32(f func(v1, v2 int) float32) func(v1, v2 int) float32 {\n\tcache := map[int]map[int]float32{}\n\n\treturn func(v1, v2 int) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToFloat32(f func(v1, v2, v3, v4, v5 int) float32) func(v1, v2, v3, v4, v5 int) float32 {\n\tcache := map[int]map[int]map[int]map[int]map[int]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt2ToFloat64(f func(v1, v2 int) float64) func(v1, v2 int) float64 {\n\tcache := map[int]map[int]float64{}\n\n\treturn func(v1, v2 int) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt5ToFloat64(f func(v1, v2, v3, v4, v5 int) float64) func(v1, v2, v3, v4, v5 int) float64 {\n\tcache := map[int]map[int]map[int]map[int]map[int]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int]map[int]map[int]map[int]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int]map[int]map[int]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int]map[int]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToRune(f func(v1, v2 int8) rune) func(v1, v2 int8) rune {\n\tcache := map[int8]map[int8]rune{}\n\n\treturn func(v1, v2 int8) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToRune(f func(v1, v2, v3, v4, v5 int8) rune) func(v1, v2, v3, v4, v5 int8) rune {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToString(f func(v1, v2 int8) string) func(v1, v2 int8) string {\n\tcache := map[int8]map[int8]string{}\n\n\treturn func(v1, v2 int8) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToString(f func(v1, v2, v3, v4, v5 int8) string) func(v1, v2, v3, v4, v5 int8) string {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt(f func(v1, v2 int8) int) func(v1, v2 int8) int {\n\tcache := map[int8]map[int8]int{}\n\n\treturn func(v1, v2 int8) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt(f func(v1, v2, v3, v4, v5 int8) int) func(v1, v2, v3, v4, v5 int8) int {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt8(f func(v1, v2 int8) int8) func(v1, v2 int8) int8 {\n\tcache := map[int8]map[int8]int8{}\n\n\treturn func(v1, v2 int8) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt8(f func(v1, v2, v3, v4, v5 int8) int8) func(v1, v2, v3, v4, v5 int8) int8 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt16(f func(v1, v2 int8) int16) func(v1, v2 int8) int16 {\n\tcache := map[int8]map[int8]int16{}\n\n\treturn func(v1, v2 int8) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt16(f func(v1, v2, v3, v4, v5 int8) int16) func(v1, v2, v3, v4, v5 int8) int16 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt32(f func(v1, v2 int8) int32) func(v1, v2 int8) int32 {\n\tcache := map[int8]map[int8]int32{}\n\n\treturn func(v1, v2 int8) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt32(f func(v1, v2, v3, v4, v5 int8) int32) func(v1, v2, v3, v4, v5 int8) int32 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToInt64(f func(v1, v2 int8) int64) func(v1, v2 int8) int64 {\n\tcache := map[int8]map[int8]int64{}\n\n\treturn func(v1, v2 int8) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToInt64(f func(v1, v2, v3, v4, v5 int8) int64) func(v1, v2, v3, v4, v5 int8) int64 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToFloat32(f func(v1, v2 int8) float32) func(v1, v2 int8) float32 {\n\tcache := map[int8]map[int8]float32{}\n\n\treturn func(v1, v2 int8) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToFloat32(f func(v1, v2, v3, v4, v5 int8) float32) func(v1, v2, v3, v4, v5 int8) float32 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt82ToFloat64(f func(v1, v2 int8) float64) func(v1, v2 int8) float64 {\n\tcache := map[int8]map[int8]float64{}\n\n\treturn func(v1, v2 int8) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int8]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt85ToFloat64(f func(v1, v2, v3, v4, v5 int8) float64) func(v1, v2, v3, v4, v5 int8) float64 {\n\tcache := map[int8]map[int8]map[int8]map[int8]map[int8]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int8) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int8]map[int8]map[int8]map[int8]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int8]map[int8]map[int8]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int8]map[int8]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int8]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToRune(f func(v1, v2 int16) rune) func(v1, v2 int16) rune {\n\tcache := map[int16]map[int16]rune{}\n\n\treturn func(v1, v2 int16) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToRune(f func(v1, v2, v3, v4, v5 int16) rune) func(v1, v2, v3, v4, v5 int16) rune {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToString(f func(v1, v2 int16) string) func(v1, v2 int16) string {\n\tcache := map[int16]map[int16]string{}\n\n\treturn func(v1, v2 int16) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToString(f func(v1, v2, v3, v4, v5 int16) string) func(v1, v2, v3, v4, v5 int16) string {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt(f func(v1, v2 int16) int) func(v1, v2 int16) int {\n\tcache := map[int16]map[int16]int{}\n\n\treturn func(v1, v2 int16) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt(f func(v1, v2, v3, v4, v5 int16) int) func(v1, v2, v3, v4, v5 int16) int {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt8(f func(v1, v2 int16) int8) func(v1, v2 int16) int8 {\n\tcache := map[int16]map[int16]int8{}\n\n\treturn func(v1, v2 int16) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt8(f func(v1, v2, v3, v4, v5 int16) int8) func(v1, v2, v3, v4, v5 int16) int8 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt16(f func(v1, v2 int16) int16) func(v1, v2 int16) int16 {\n\tcache := map[int16]map[int16]int16{}\n\n\treturn func(v1, v2 int16) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt16(f func(v1, v2, v3, v4, v5 int16) int16) func(v1, v2, v3, v4, v5 int16) int16 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt32(f func(v1, v2 int16) int32) func(v1, v2 int16) int32 {\n\tcache := map[int16]map[int16]int32{}\n\n\treturn func(v1, v2 int16) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt32(f func(v1, v2, v3, v4, v5 int16) int32) func(v1, v2, v3, v4, v5 int16) int32 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToInt64(f func(v1, v2 int16) int64) func(v1, v2 int16) int64 {\n\tcache := map[int16]map[int16]int64{}\n\n\treturn func(v1, v2 int16) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToInt64(f func(v1, v2, v3, v4, v5 int16) int64) func(v1, v2, v3, v4, v5 int16) int64 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToFloat32(f func(v1, v2 int16) float32) func(v1, v2 int16) float32 {\n\tcache := map[int16]map[int16]float32{}\n\n\treturn func(v1, v2 int16) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToFloat32(f func(v1, v2, v3, v4, v5 int16) float32) func(v1, v2, v3, v4, v5 int16) float32 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt162ToFloat64(f func(v1, v2 int16) float64) func(v1, v2 int16) float64 {\n\tcache := map[int16]map[int16]float64{}\n\n\treturn func(v1, v2 int16) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int16]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt165ToFloat64(f func(v1, v2, v3, v4, v5 int16) float64) func(v1, v2, v3, v4, v5 int16) float64 {\n\tcache := map[int16]map[int16]map[int16]map[int16]map[int16]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int16) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int16]map[int16]map[int16]map[int16]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int16]map[int16]map[int16]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int16]map[int16]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int16]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToRune(f func(v1, v2 int32) rune) func(v1, v2 int32) rune {\n\tcache := map[int32]map[int32]rune{}\n\n\treturn func(v1, v2 int32) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToRune(f func(v1, v2, v3, v4, v5 int32) rune) func(v1, v2, v3, v4, v5 int32) rune {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToString(f func(v1, v2 int32) string) func(v1, v2 int32) string {\n\tcache := map[int32]map[int32]string{}\n\n\treturn func(v1, v2 int32) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToString(f func(v1, v2, v3, v4, v5 int32) string) func(v1, v2, v3, v4, v5 int32) string {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt(f func(v1, v2 int32) int) func(v1, v2 int32) int {\n\tcache := map[int32]map[int32]int{}\n\n\treturn func(v1, v2 int32) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt(f func(v1, v2, v3, v4, v5 int32) int) func(v1, v2, v3, v4, v5 int32) int {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt8(f func(v1, v2 int32) int8) func(v1, v2 int32) int8 {\n\tcache := map[int32]map[int32]int8{}\n\n\treturn func(v1, v2 int32) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt8(f func(v1, v2, v3, v4, v5 int32) int8) func(v1, v2, v3, v4, v5 int32) int8 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt16(f func(v1, v2 int32) int16) func(v1, v2 int32) int16 {\n\tcache := map[int32]map[int32]int16{}\n\n\treturn func(v1, v2 int32) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt16(f func(v1, v2, v3, v4, v5 int32) int16) func(v1, v2, v3, v4, v5 int32) int16 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt32(f func(v1, v2 int32) int32) func(v1, v2 int32) int32 {\n\tcache := map[int32]map[int32]int32{}\n\n\treturn func(v1, v2 int32) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt32(f func(v1, v2, v3, v4, v5 int32) int32) func(v1, v2, v3, v4, v5 int32) int32 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToInt64(f func(v1, v2 int32) int64) func(v1, v2 int32) int64 {\n\tcache := map[int32]map[int32]int64{}\n\n\treturn func(v1, v2 int32) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToInt64(f func(v1, v2, v3, v4, v5 int32) int64) func(v1, v2, v3, v4, v5 int32) int64 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToFloat32(f func(v1, v2 int32) float32) func(v1, v2 int32) float32 {\n\tcache := map[int32]map[int32]float32{}\n\n\treturn func(v1, v2 int32) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToFloat32(f func(v1, v2, v3, v4, v5 int32) float32) func(v1, v2, v3, v4, v5 int32) float32 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt322ToFloat64(f func(v1, v2 int32) float64) func(v1, v2 int32) float64 {\n\tcache := map[int32]map[int32]float64{}\n\n\treturn func(v1, v2 int32) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int32]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt325ToFloat64(f func(v1, v2, v3, v4, v5 int32) float64) func(v1, v2, v3, v4, v5 int32) float64 {\n\tcache := map[int32]map[int32]map[int32]map[int32]map[int32]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int32) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int32]map[int32]map[int32]map[int32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int32]map[int32]map[int32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int32]map[int32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int32]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToRune(f func(v1, v2 int64) rune) func(v1, v2 int64) rune {\n\tcache := map[int64]map[int64]rune{}\n\n\treturn func(v1, v2 int64) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToRune(f func(v1, v2, v3, v4, v5 int64) rune) func(v1, v2, v3, v4, v5 int64) rune {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToString(f func(v1, v2 int64) string) func(v1, v2 int64) string {\n\tcache := map[int64]map[int64]string{}\n\n\treturn func(v1, v2 int64) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToString(f func(v1, v2, v3, v4, v5 int64) string) func(v1, v2, v3, v4, v5 int64) string {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]string{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt(f func(v1, v2 int64) int) func(v1, v2 int64) int {\n\tcache := map[int64]map[int64]int{}\n\n\treturn func(v1, v2 int64) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt(f func(v1, v2, v3, v4, v5 int64) int) func(v1, v2, v3, v4, v5 int64) int {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt8(f func(v1, v2 int64) int8) func(v1, v2 int64) int8 {\n\tcache := map[int64]map[int64]int8{}\n\n\treturn func(v1, v2 int64) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt8(f func(v1, v2, v3, v4, v5 int64) int8) func(v1, v2, v3, v4, v5 int64) int8 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt16(f func(v1, v2 int64) int16) func(v1, v2 int64) int16 {\n\tcache := map[int64]map[int64]int16{}\n\n\treturn func(v1, v2 int64) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt16(f func(v1, v2, v3, v4, v5 int64) int16) func(v1, v2, v3, v4, v5 int64) int16 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt32(f func(v1, v2 int64) int32) func(v1, v2 int64) int32 {\n\tcache := map[int64]map[int64]int32{}\n\n\treturn func(v1, v2 int64) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt32(f func(v1, v2, v3, v4, v5 int64) int32) func(v1, v2, v3, v4, v5 int64) int32 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToInt64(f func(v1, v2 int64) int64) func(v1, v2 int64) int64 {\n\tcache := map[int64]map[int64]int64{}\n\n\treturn func(v1, v2 int64) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToInt64(f func(v1, v2, v3, v4, v5 int64) int64) func(v1, v2, v3, v4, v5 int64) int64 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToFloat32(f func(v1, v2 int64) float32) func(v1, v2 int64) float32 {\n\tcache := map[int64]map[int64]float32{}\n\n\treturn func(v1, v2 int64) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToFloat32(f func(v1, v2, v3, v4, v5 int64) float32) func(v1, v2, v3, v4, v5 int64) float32 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt642ToFloat64(f func(v1, v2 int64) float64) func(v1, v2 int64) float64 {\n\tcache := map[int64]map[int64]float64{}\n\n\treturn func(v1, v2 int64) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[int64]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeInt645ToFloat64(f func(v1, v2, v3, v4, v5 int64) float64) func(v1, v2, v3, v4, v5 int64) float64 {\n\tcache := map[int64]map[int64]map[int64]map[int64]map[int64]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 int64) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[int64]map[int64]map[int64]map[int64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[int64]map[int64]map[int64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[int64]map[int64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[int64]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToRune(f func(v1, v2 float32) rune) func(v1, v2 float32) rune {\n\tcache := map[float32]map[float32]rune{}\n\n\treturn func(v1, v2 float32) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToRune(f func(v1, v2, v3, v4, v5 float32) rune) func(v1, v2, v3, v4, v5 float32) rune {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToString(f func(v1, v2 float32) string) func(v1, v2 float32) string {\n\tcache := map[float32]map[float32]string{}\n\n\treturn func(v1, v2 float32) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToString(f func(v1, v2, v3, v4, v5 float32) string) func(v1, v2, v3, v4, v5 float32) string {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]string{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt(f func(v1, v2 float32) int) func(v1, v2 float32) int {\n\tcache := map[float32]map[float32]int{}\n\n\treturn func(v1, v2 float32) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt(f func(v1, v2, v3, v4, v5 float32) int) func(v1, v2, v3, v4, v5 float32) int {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt8(f func(v1, v2 float32) int8) func(v1, v2 float32) int8 {\n\tcache := map[float32]map[float32]int8{}\n\n\treturn func(v1, v2 float32) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt8(f func(v1, v2, v3, v4, v5 float32) int8) func(v1, v2, v3, v4, v5 float32) int8 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt16(f func(v1, v2 float32) int16) func(v1, v2 float32) int16 {\n\tcache := map[float32]map[float32]int16{}\n\n\treturn func(v1, v2 float32) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt16(f func(v1, v2, v3, v4, v5 float32) int16) func(v1, v2, v3, v4, v5 float32) int16 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt32(f func(v1, v2 float32) int32) func(v1, v2 float32) int32 {\n\tcache := map[float32]map[float32]int32{}\n\n\treturn func(v1, v2 float32) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt32(f func(v1, v2, v3, v4, v5 float32) int32) func(v1, v2, v3, v4, v5 float32) int32 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToInt64(f func(v1, v2 float32) int64) func(v1, v2 float32) int64 {\n\tcache := map[float32]map[float32]int64{}\n\n\treturn func(v1, v2 float32) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToInt64(f func(v1, v2, v3, v4, v5 float32) int64) func(v1, v2, v3, v4, v5 float32) int64 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToFloat32(f func(v1, v2 float32) float32) func(v1, v2 float32) float32 {\n\tcache := map[float32]map[float32]float32{}\n\n\treturn func(v1, v2 float32) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToFloat32(f func(v1, v2, v3, v4, v5 float32) float32) func(v1, v2, v3, v4, v5 float32) float32 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat322ToFloat64(f func(v1, v2 float32) float64) func(v1, v2 float32) float64 {\n\tcache := map[float32]map[float32]float64{}\n\n\treturn func(v1, v2 float32) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float32]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat325ToFloat64(f func(v1, v2, v3, v4, v5 float32) float64) func(v1, v2, v3, v4, v5 float32) float64 {\n\tcache := map[float32]map[float32]map[float32]map[float32]map[float32]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 float32) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float32]map[float32]map[float32]map[float32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float32]map[float32]map[float32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float32]map[float32]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float32]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToRune(f func(v1, v2 float64) rune) func(v1, v2 float64) rune {\n\tcache := map[float64]map[float64]rune{}\n\n\treturn func(v1, v2 float64) rune {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]rune{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToRune(f func(v1, v2, v3, v4, v5 float64) rune) func(v1, v2, v3, v4, v5 float64) rune {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]rune{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) rune {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]rune{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]rune{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToString(f func(v1, v2 float64) string) func(v1, v2 float64) string {\n\tcache := map[float64]map[float64]string{}\n\n\treturn func(v1, v2 float64) string {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]string{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToString(f func(v1, v2, v3, v4, v5 float64) string) func(v1, v2, v3, v4, v5 float64) string {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]string{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) string {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]string{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]string{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt(f func(v1, v2 float64) int) func(v1, v2 float64) int {\n\tcache := map[float64]map[float64]int{}\n\n\treturn func(v1, v2 float64) int {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt(f func(v1, v2, v3, v4, v5 float64) int) func(v1, v2, v3, v4, v5 float64) int {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt8(f func(v1, v2 float64) int8) func(v1, v2 float64) int8 {\n\tcache := map[float64]map[float64]int8{}\n\n\treturn func(v1, v2 float64) int8 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int8{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt8(f func(v1, v2, v3, v4, v5 float64) int8) func(v1, v2, v3, v4, v5 float64) int8 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int8{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int8 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int8{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int8{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt16(f func(v1, v2 float64) int16) func(v1, v2 float64) int16 {\n\tcache := map[float64]map[float64]int16{}\n\n\treturn func(v1, v2 float64) int16 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int16{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt16(f func(v1, v2, v3, v4, v5 float64) int16) func(v1, v2, v3, v4, v5 float64) int16 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int16{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int16 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int16{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int16{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt32(f func(v1, v2 float64) int32) func(v1, v2 float64) int32 {\n\tcache := map[float64]map[float64]int32{}\n\n\treturn func(v1, v2 float64) int32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt32(f func(v1, v2, v3, v4, v5 float64) int32) func(v1, v2, v3, v4, v5 float64) int32 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int32{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToInt64(f func(v1, v2 float64) int64) func(v1, v2 float64) int64 {\n\tcache := map[float64]map[float64]int64{}\n\n\treturn func(v1, v2 float64) int64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]int64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToInt64(f func(v1, v2, v3, v4, v5 float64) int64) func(v1, v2, v3, v4, v5 float64) int64 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]int64{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) int64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]int64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]int64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToFloat32(f func(v1, v2 float64) float32) func(v1, v2 float64) float32 {\n\tcache := map[float64]map[float64]float32{}\n\n\treturn func(v1, v2 float64) float32 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]float32{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToFloat32(f func(v1, v2, v3, v4, v5 float64) float32) func(v1, v2, v3, v4, v5 float64) float32 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]float32{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) float32 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]float32{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]float32{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat642ToFloat64(f func(v1, v2 float64) float64) func(v1, v2 float64) float64 {\n\tcache := map[float64]map[float64]float64{}\n\n\treturn func(v1, v2 float64) float64 {\n\t\tif v1Map, ok := cache[v1]; ok {\n\t\t\tif cachedValue, ok := v1Map[v2]; ok {\n\t\t\t\treturn cachedValue\n\t\t\t}\n\t\t}\n\n\t\tresult := f(v1, v2)\n\t\t_, v1Ok := cache[v1]\n\t\tif !v1Ok {\n\t\t\tcache[v1] = map[float64]float64{}\n\t\t}\n\n\t\tcache[v1][v2] = result\n\t\treturn result\n\t}\n}\n\nfunc lib_MemoizeFloat645ToFloat64(f func(v1, v2, v3, v4, v5 float64) float64) func(v1, v2, v3, v4, v5 float64) float64 {\n\tcache := map[float64]map[float64]map[float64]map[float64]map[float64]float64{}\n\n\treturn func(v1, v2, v3, v4, v5 float64) float64 {\n\t\tif _, ok := cache[v1]; !ok {\n\t\t\tcache[v1] = map[float64]map[float64]map[float64]map[float64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2]; !ok {\n\t\t\tcache[v1][v2] = map[float64]map[float64]map[float64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3]; !ok {\n\t\t\tcache[v1][v2][v3] = map[float64]map[float64]float64{}\n\t\t}\n\t\tif _, ok := cache[v1][v2][v3][v4]; !ok {\n\t\t\tcache[v1][v2][v3][v4] = map[float64]float64{}\n\t\t}\n\t\tif cachedValue, ok := cache[v1][v2][v3][v4][v5]; ok {\n\t\t\treturn cachedValue\n\t\t}\n\n\t\tresult := f(v1, v2, v3, v4, v5)\n\t\tcache[v1][v2][v3][v4][v5] = result\n\t\treturn result\n\t}\n}\n\ntype lib_Graph struct {\n\tAdjacencyMatrix [][]bool\n}\n\nfunc lib_NewGraph(nodeNum int, edges [][]int, directed bool) (*lib_Graph, error) {\n\tif nodeNum < 1 {\n\t\treturn nil, fmt.Errorf(\"invalid nodeNum: %d\", nodeNum)\n\t}\n\n\tvar aMatrix [][]bool\n\tfor i := 0; i < nodeNum; i++ {\n\t\tline := make([]bool, nodeNum)\n\t\taMatrix = append(aMatrix, line)\n\t}\n\n\tfor _, edge := range edges {\n\t\taMatrix[edge[0]][edge[1]] = true\n\t\tif !directed {\n\t\t\taMatrix[edge[1]][edge[0]] = true\n\t\t}\n\t}\n\n\treturn &lib_Graph{AdjacencyMatrix: aMatrix}, nil\n}\n\nfunc (g *lib_Graph) IsValidPath(path []int) bool {\n\tfor i := 1; i < len(path); i++ {\n\t\tif !g.AdjacencyMatrix[path[i-1]][path[i]] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_toLines(scanner *bufio.Scanner) [][]string {\n\tvar lines [][]string\n\tfor scanner.Scan() {\n\t\ttext := lib_TrimSpaceAndNewLineCodeAndTab(scanner.Text())\n\t\tif len(text) == 0 {\n\t\t\tlines = append(lines, []string{})\n\t\t\tcontinue\n\t\t}\n\t\tline := strings.Split(text, \" \")\n\t\tlines = append(lines, line)\n\t}\n\treturn lines\n}\n\nfunc lib_toLinesFromReader(reader *bufio.Reader) (lines [][]string, err error) {\n\tfor {\n\t\tchunks, err := lib_readLineAsChunks(reader)\n\t\tif err == io.EOF {\n\t\t\treturn lines, nil\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read line from reader: %v\", err)\n\t\t}\n\t\tlineStr := lib_TrimSpaceAndNewLineCodeAndTab(strings.Join(chunks, \"\"))\n\t\tline := strings.Split(lineStr, \" \")\n\t\tlines = append(lines, line)\n\t}\n}\n\nfunc lib_readLineAsChunks(reader *bufio.Reader) (chunks []string, err error) {\n\tfor {\n\t\tchunk, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tchunks = append(chunks, string(chunk))\n\t\tif !isPrefix {\n\t\t\treturn chunks, nil\n\t\t}\n\t}\n}\n\ntype lib_Input struct {\n\tlines [][]string\n}\n\nfunc (i *lib_Input) validateColIndex(index int) error {\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\n\treturn nil\n}\n\nfunc (i *lib_Input) validateRowIndex(index int) error {\n\tif index >= len(i.lines) {\n\t\treturn errors.New(fmt.Sprintf(\"index(%d) is larger than lines(%d)\", index, len(i.lines)))\n\t}\n\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\treturn nil\n}\n\nfunc (i *lib_Input) GetLines(startRowIndex, endRowIndex int) ([][]string, error) {\n\tif err := i.validateRowIndex(startRowIndex); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid start row index: %v\", err)\n\t}\n\tif err := i.validateRowIndex(endRowIndex - 1); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid end row index: %v\", err)\n\t}\n\treturn i.lines[startRowIndex:endRowIndex], nil\n}\n\nfunc (i *lib_Input) GetStringLinesFrom(fromIndex int) (newLines [][]string, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetValue(rowIndex, colIndex int) (string, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn \"\", fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\treturn line[colIndex], nil\n}\n\nfunc (i *lib_Input) GetFirstValue(rowIndex int) (string, error) {\n\treturn i.GetValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColLine(colIndex int) (newLine []string, err error) {\n\tif err := i.validateColIndex(colIndex); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i, line := range i.lines {\n\t\tif len(line) <= colIndex {\n\t\t\treturn nil, errors.New(fmt.Sprintf(\"col index(%d) is larger than %dth line length(%d)\", colIndex, i, len(line)))\n\t\t}\n\t\tnewLine = append(newLine, line[colIndex])\n\t}\n\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetLine(index int) ([]string, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\treturn i.lines[index], nil\n}\n\nfunc (i *lib_Input) ReadAsStringGridFrom(fromIndex int) ([][]string, error) {\n\tlines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar m [][]string\n\tfor _, line := range lines {\n\t\tif len(line) > 1 {\n\t\t\treturn nil, fmt.Errorf(\"unexpected length line: %v\", line)\n\t\t}\n\n\t\tvar mLine []string\n\t\tfor _, r := range line[0] {\n\t\t\tmLine = append(mLine, string(r))\n\t\t}\n\t\tm = append(m, mLine)\n\t}\n\treturn m, nil\n}\n\nfunc lib_NewInput(scanner *bufio.Scanner) *lib_Input {\n\treturn &lib_Input{\n\t\tlines: lib_toLines(scanner),\n\t}\n}\n\nfunc lib_NewInputFromReader(reader *bufio.Reader) (*lib_Input, error) {\n\tlines, err := lib_toLinesFromReader(reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create new Input from reader: %v\", err)\n\t}\n\treturn &lib_Input{\n\t\tlines: lines,\n\t}, nil\n}\n\nfunc (i *lib_Input) MustGetIntLines() (newLines [][]int) {\n\tnewLines, err := i.GetIntLines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLinesFrom(fromIndex int) (newLines [][]int) {\n\tnewLines, err := i.GetIntLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLineRange(fromRowIndex, rangeNum int) (newLines [][]int) {\n\tnewLines, err := i.GetIntLineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLine(index int) []int {\n\tv, err := i.GetIntLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetIntValue(rowIndex, colIndex int) int {\n\tv, err := i.GetIntValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstIntValue(rowIndex int) int {\n\tv, err := i.GetFirstIntValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColIntLine(colIndex int) (newLine []int) {\n\tnewLine, err := i.GetColIntLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt8Lines() (newLines [][]int8) {\n\tnewLines, err := i.GetInt8Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8LinesFrom(fromIndex int) (newLines [][]int8) {\n\tnewLines, err := i.GetInt8LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8LineRange(fromRowIndex, rangeNum int) (newLines [][]int8) {\n\tnewLines, err := i.GetInt8LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8Line(index int) []int8 {\n\tv, err := i.GetInt8Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt8Value(rowIndex, colIndex int) int8 {\n\tv, err := i.GetInt8Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt8Value(rowIndex int) int8 {\n\tv, err := i.GetFirstInt8Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt8Line(colIndex int) (newLine []int8) {\n\tnewLine, err := i.GetColInt8Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt16Lines() (newLines [][]int16) {\n\tnewLines, err := i.GetInt16Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16LinesFrom(fromIndex int) (newLines [][]int16) {\n\tnewLines, err := i.GetInt16LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16LineRange(fromRowIndex, rangeNum int) (newLines [][]int16) {\n\tnewLines, err := i.GetInt16LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16Line(index int) []int16 {\n\tv, err := i.GetInt16Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt16Value(rowIndex, colIndex int) int16 {\n\tv, err := i.GetInt16Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt16Value(rowIndex int) int16 {\n\tv, err := i.GetFirstInt16Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt16Line(colIndex int) (newLine []int16) {\n\tnewLine, err := i.GetColInt16Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt32Lines() (newLines [][]int32) {\n\tnewLines, err := i.GetInt32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32LinesFrom(fromIndex int) (newLines [][]int32) {\n\tnewLines, err := i.GetInt32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32LineRange(fromRowIndex, rangeNum int) (newLines [][]int32) {\n\tnewLines, err := i.GetInt32LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32Line(index int) []int32 {\n\tv, err := i.GetInt32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt32Value(rowIndex, colIndex int) int32 {\n\tv, err := i.GetInt32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt32Value(rowIndex int) int32 {\n\tv, err := i.GetFirstInt32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt32Line(colIndex int) (newLine []int32) {\n\tnewLine, err := i.GetColInt32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt64Lines() (newLines [][]int64) {\n\tnewLines, err := i.GetInt64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64LinesFrom(fromIndex int) (newLines [][]int64) {\n\tnewLines, err := i.GetInt64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64LineRange(fromRowIndex, rangeNum int) (newLines [][]int64) {\n\tnewLines, err := i.GetInt64LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64Line(index int) []int64 {\n\tv, err := i.GetInt64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt64Value(rowIndex, colIndex int) int64 {\n\tv, err := i.GetInt64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt64Value(rowIndex int) int64 {\n\tv, err := i.GetFirstInt64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt64Line(colIndex int) (newLine []int64) {\n\tnewLine, err := i.GetColInt64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat32Lines() (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32LinesFrom(fromIndex int) (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32LineRange(fromRowIndex, rangeNum int) (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32Line(index int) []float32 {\n\tv, err := i.GetFloat32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat32Value(rowIndex, colIndex int) float32 {\n\tv, err := i.GetFloat32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat32Value(rowIndex int) float32 {\n\tv, err := i.GetFirstFloat32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat32Line(colIndex int) (newLine []float32) {\n\tnewLine, err := i.GetColFloat32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat64Lines() (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64LinesFrom(fromIndex int) (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64LineRange(fromRowIndex, rangeNum int) (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64LineRange(fromRowIndex, rangeNum)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64Line(index int) []float64 {\n\tv, err := i.GetFloat64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat64Value(rowIndex, colIndex int) float64 {\n\tv, err := i.GetFloat64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat64Value(rowIndex int) float64 {\n\tv, err := i.GetFirstFloat64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat64Line(colIndex int) (newLine []float64) {\n\tnewLine, err := i.GetColFloat64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc lib_MustSubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_SubtractIntBy(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt(values1 []int, values2 []int) (newValues []int) {\n\tnewValues, err := lib_SubtractInt(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffIntBy(values []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_RDiffIntBy(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt(values []int) (newValues []int) {\n\tnewValues, err := lib_RDiffInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToIntSlice(s string) (ValueLine []int) {\n\tValueLine, err := lib_StringToIntSlice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToIntSlice(line []string) (ValueLine []int) {\n\tValueLine, err := lib_StringSliceToIntSlice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt(values []int) (max int) {\n\tmax, err := lib_MaxInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntVA(values ...int) (max int) {\n\tmax, err := lib_MaxIntVA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt(values []int) (min int) {\n\tmin, err := lib_MinInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt8(values1 []int8, values2 []int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8(values []int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt8Slice(s string) (ValueLine []int8) {\n\tValueLine, err := lib_StringToInt8Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt8Slice(line []string) (ValueLine []int8) {\n\tValueLine, err := lib_StringSliceToInt8Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt8(values []int8) (max int8) {\n\tmax, err := lib_MaxInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8VA(values ...int8) (max int8) {\n\tmax, err := lib_MaxInt8VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt8(values []int8) (min int8) {\n\tmin, err := lib_MinInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt16(values1 []int16, values2 []int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16(values []int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt16Slice(s string) (ValueLine []int16) {\n\tValueLine, err := lib_StringToInt16Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt16Slice(line []string) (ValueLine []int16) {\n\tValueLine, err := lib_StringSliceToInt16Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt16(values []int16) (max int16) {\n\tmax, err := lib_MaxInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16VA(values ...int16) (max int16) {\n\tmax, err := lib_MaxInt16VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt16(values []int16) (min int16) {\n\tmin, err := lib_MinInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt32(values1 []int32, values2 []int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32(values []int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt32Slice(s string) (ValueLine []int32) {\n\tValueLine, err := lib_StringToInt32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt32Slice(line []string) (ValueLine []int32) {\n\tValueLine, err := lib_StringSliceToInt32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt32(values []int32) (max int32) {\n\tmax, err := lib_MaxInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32VA(values ...int32) (max int32) {\n\tmax, err := lib_MaxInt32VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt32(values []int32) (min int32) {\n\tmin, err := lib_MinInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt64(values1 []int64, values2 []int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64(values []int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt64Slice(s string) (ValueLine []int64) {\n\tValueLine, err := lib_StringToInt64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt64Slice(line []string) (ValueLine []int64) {\n\tValueLine, err := lib_StringSliceToInt64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt64(values []int64) (max int64) {\n\tmax, err := lib_MaxInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64VA(values ...int64) (max int64) {\n\tmax, err := lib_MaxInt64VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt64(values []int64) (min int64) {\n\tmin, err := lib_MinInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat32(values1 []float32, values2 []float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32(values []float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat32Slice(s string) (ValueLine []float32) {\n\tValueLine, err := lib_StringToFloat32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat32Slice(line []string) (ValueLine []float32) {\n\tValueLine, err := lib_StringSliceToFloat32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat32(values []float32) (max float32) {\n\tmax, err := lib_MaxFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32VA(values ...float32) (max float32) {\n\tmax, err := lib_MaxFloat32VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat32(values []float32) (min float32) {\n\tmin, err := lib_MinFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat64(values1 []float64, values2 []float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64(values []float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat64Slice(s string) (ValueLine []float64) {\n\tValueLine, err := lib_StringToFloat64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat64Slice(line []string) (ValueLine []float64) {\n\tValueLine, err := lib_StringSliceToFloat64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat64(values []float64) (max float64) {\n\tmax, err := lib_MaxFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64VA(values ...float64) (max float64) {\n\tmax, err := lib_MaxFloat64VA(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat64(values []float64) (min float64) {\n\tmin, err := lib_MinFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustMaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustZipRune(valuesList ...[]rune) (newValuesList [][]rune) {\n\tnewValuesList, err := lib_ZipRune(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune) {\n\tnewValues, err := lib_ChunkRuneByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetRune(values []rune, i int) []rune {\n\tv, err := lib_UnsetRune(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustRuneCombination(values []rune, r int) (combinations [][]rune) {\n\tcombinations, err := lib_RuneCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustRuneSliceCombination(values [][]rune, r int) (combinations [][][]rune) {\n\tcombinations, err := lib_RuneSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipString(valuesList ...[]string) (newValuesList [][]string) {\n\tnewValuesList, err := lib_ZipString(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkStringByBits(values []string, bits []bool) (newValues [][]string) {\n\tnewValues, err := lib_ChunkStringByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetString(values []string, i int) []string {\n\tv, err := lib_UnsetString(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustStringCombination(values []string, r int) (combinations [][]string) {\n\tcombinations, err := lib_StringCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustStringSliceCombination(values [][]string, r int) (combinations [][][]string) {\n\tcombinations, err := lib_StringSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt(valuesList ...[]int) (newValuesList [][]int) {\n\tnewValuesList, err := lib_ZipInt(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkIntByBits(values []int, bits []bool) (newValues [][]int) {\n\tnewValues, err := lib_ChunkIntByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt(values []int, i int) []int {\n\tv, err := lib_UnsetInt(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustIntCombination(values []int, r int) (combinations [][]int) {\n\tcombinations, err := lib_IntCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustIntSliceCombination(values [][]int, r int) (combinations [][][]int) {\n\tcombinations, err := lib_IntSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt8(valuesList ...[]int8) (newValuesList [][]int8) {\n\tnewValuesList, err := lib_ZipInt8(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8) {\n\tnewValues, err := lib_ChunkInt8ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt8(values []int8, i int) []int8 {\n\tv, err := lib_UnsetInt8(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt8Combination(values []int8, r int) (combinations [][]int8) {\n\tcombinations, err := lib_Int8Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt8SliceCombination(values [][]int8, r int) (combinations [][][]int8) {\n\tcombinations, err := lib_Int8SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt16(valuesList ...[]int16) (newValuesList [][]int16) {\n\tnewValuesList, err := lib_ZipInt16(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16) {\n\tnewValues, err := lib_ChunkInt16ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt16(values []int16, i int) []int16 {\n\tv, err := lib_UnsetInt16(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt16Combination(values []int16, r int) (combinations [][]int16) {\n\tcombinations, err := lib_Int16Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt16SliceCombination(values [][]int16, r int) (combinations [][][]int16) {\n\tcombinations, err := lib_Int16SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt32(valuesList ...[]int32) (newValuesList [][]int32) {\n\tnewValuesList, err := lib_ZipInt32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32) {\n\tnewValues, err := lib_ChunkInt32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt32(values []int32, i int) []int32 {\n\tv, err := lib_UnsetInt32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt32Combination(values []int32, r int) (combinations [][]int32) {\n\tcombinations, err := lib_Int32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt32SliceCombination(values [][]int32, r int) (combinations [][][]int32) {\n\tcombinations, err := lib_Int32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt64(valuesList ...[]int64) (newValuesList [][]int64) {\n\tnewValuesList, err := lib_ZipInt64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64) {\n\tnewValues, err := lib_ChunkInt64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt64(values []int64, i int) []int64 {\n\tv, err := lib_UnsetInt64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt64Combination(values []int64, r int) (combinations [][]int64) {\n\tcombinations, err := lib_Int64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt64SliceCombination(values [][]int64, r int) (combinations [][][]int64) {\n\tcombinations, err := lib_Int64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat32(valuesList ...[]float32) (newValuesList [][]float32) {\n\tnewValuesList, err := lib_ZipFloat32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32) {\n\tnewValues, err := lib_ChunkFloat32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat32(values []float32, i int) []float32 {\n\tv, err := lib_UnsetFloat32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat32Combination(values []float32, r int) (combinations [][]float32) {\n\tcombinations, err := lib_Float32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat32SliceCombination(values [][]float32, r int) (combinations [][][]float32) {\n\tcombinations, err := lib_Float32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat64(valuesList ...[]float64) (newValuesList [][]float64) {\n\tnewValuesList, err := lib_ZipFloat64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64) {\n\tnewValues, err := lib_ChunkFloat64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat64(values []float64, i int) []float64 {\n\tv, err := lib_UnsetFloat64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat64Combination(values []float64, r int) (combinations [][]float64) {\n\tcombinations, err := lib_Float64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat64SliceCombination(values [][]float64, r int) (combinations [][][]float64) {\n\tcombinations, err := lib_Float64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustNewGraph(nodeNum int, edges [][]int, directed bool) *lib_Graph {\n\tv, err := lib_NewGraph(nodeNum, edges, directed)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetLines(startRowIndex, endRowIndex int) [][]string {\n\tv, err := i.GetLines(startRowIndex, endRowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetStringLinesFrom(fromIndex int) (newLines [][]string) {\n\tnewLines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetValue(rowIndex, colIndex int) string {\n\tv, err := i.GetValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstValue(rowIndex int) string {\n\tv, err := i.GetFirstValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColLine(colIndex int) (newLine []string) {\n\tnewLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetLine(index int) []string {\n\tv, err := i.GetLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustReadAsStringGridFrom(fromIndex int) [][]string {\n\tv, err := i.ReadAsStringGridFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustNewInputFromReader(reader *bufio.Reader) *lib_Input {\n\tv, err := lib_NewInputFromReader(reader)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustCombination(n, r int64) int64 {\n\tv, err := lib_Combination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustBigCombination(n, r int) *big.Int {\n\tv, err := lib_BigCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustParallelBigCombination(n, r int) *big.Int {\n\tv, err := lib_ParallelBigCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustMemoizedCombination(n, r int) int {\n\tv, err := lib_MemoizedCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustMemoizedBigCombination(n, r int) *big.Int {\n\tv, err := lib_MemoizedBigCombination(n, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustRangeFactorial(n, num int64) (f int64) {\n\tf, err := lib_RangeFactorial(n, num)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc lib_MustFactorial(n int64) (f int64) {\n\tf, err := lib_Factorial(n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc lib_MustMemoizedFactorial(n int, cache map[int]int) int {\n\tv, err := lib_MemoizedFactorial(n, cache)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_toSpecificBitIntLine(line []string, bitSize int) (intLine []int64, err error) {\n\tfor j, v := range line {\n\t\tintV, err := strconv.ParseInt(v, 10, bitSize)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(fmt.Sprintf(\"%dth value: %v\", j, err.Error()))\n\t\t}\n\t\tintLine = append(intLine, intV)\n\t}\n\treturn intLine, nil\n}\n\nfunc lib_BitEnumeration(digits uint) (enums [][]bool) {\n\tif digits == 0 {\n\t\treturn [][]bool{}\n\t}\n\n\tfor i := 0; i < 1<>d&1 == 1)\n\t\t}\n\t\tenums = append(enums, e)\n\t}\n\treturn\n}\n\nfunc lib_Combination(n, r int64) (int64, error) {\n\tif n < r {\n\t\treturn 0, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn 1, nil\n\t}\n\n\trRangeFac, err := lib_RangeFactorial(n, r)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed in Combination: %v\", err)\n\t}\n\trFac, err := lib_Factorial(r)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed in Combination: %v\", err)\n\t}\n\treturn rRangeFac / rFac, nil\n}\n\nfunc lib_BigCombination(n, r int) (*big.Int, error) {\n\tif n < r {\n\t\treturn nil, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn big.NewInt(1), nil\n\t}\n\n\trFac := lib_BigFactorial(r)\n\tnFac := lib_BigFactorial(n)\n\tnrFac := lib_BigFactorial(n - r)\n\treturn nFac.Div(nFac, rFac.Mul(rFac, nrFac)), nil\n}\n\nfunc lib_ParallelBigCombination(n, r int) (*big.Int, error) {\n\tif n < r {\n\t\treturn nil, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn big.NewInt(1), nil\n\t}\n\n\trChan := make(chan *big.Int)\n\tnChan := make(chan *big.Int)\n\tnrChan := make(chan *big.Int)\n\tgo func(r int) {\n\t\trChan <- lib_BigFactorial(r)\n\t}(r)\n\tgo func(n int) {\n\t\tnChan <- lib_BigFactorial(n)\n\t}(n)\n\tgo func(nr int) {\n\t\tnrChan <- lib_BigFactorial(nr)\n\t}(n - r)\n\n\trFac, nFac, nrFac := <-rChan, <-nChan, <-nrChan\n\treturn nFac.Div(nFac, rFac.Mul(rFac, nrFac)), nil\n}\n\nfunc lib_MemoizedCombination(n, r int) (int, error) {\n\tif n < r {\n\t\treturn 0, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn 1, nil\n\t}\n\n\tcache := map[int]int{}\n\trFac, err := lib_MemoizedFactorial(r, cache)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"too large r: %s\", err)\n\t}\n\tnFac, err := lib_MemoizedFactorial(n, cache)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"too large n: %s\", err)\n\t}\n\tnrFac, err := lib_MemoizedFactorial(n-r, cache)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"too large n - r: %s\", err)\n\t}\n\treturn nFac / (rFac * nrFac), nil\n}\n\nfunc lib_MemoizedBigCombination(n, r int) (*big.Int, error) {\n\tif n < r {\n\t\treturn nil, fmt.Errorf(\"r(%d) is larger than n(%d)\", r, n)\n\t}\n\n\tif n == r {\n\t\treturn big.NewInt(1), nil\n\t}\n\n\tcache := map[int]*big.Int{}\n\trFac := lib_MemoizedBigFactorial(r, cache)\n\tnFac := lib_MemoizedBigFactorial(n, cache)\n\tnrFac := lib_MemoizedBigFactorial(n-r, cache)\n\treturn nFac.Div(nFac, rFac.Mul(rFac, nrFac)), nil\n}\n\nfunc lib_RangeFactorial(n, num int64) (f int64, err error) {\n\tf = 1\n\tfor i := int64(0); i < num; i++ {\n\t\tf *= n - i\n\t}\n\treturn\n}\n\nfunc lib_Factorial(n int64) (f int64, err error) {\n\tif n > 20 { // FIXME Consider 32bit architecture\n\t\treturn 0, fmt.Errorf(\"too large Factorical n: %d\", n)\n\t}\n\n\tf = 1\n\tfor i := int64(2); i <= n; i++ {\n\t\tf = f * i\n\t}\n\treturn\n}\n\nfunc lib_BigFactorial(n int) *big.Int {\n\tresult := big.NewInt(1)\n\tfor i := 2; i <= n; i++ {\n\t\tresult = result.Mul(result, big.NewInt(int64(i)))\n\t}\n\treturn result\n}\n\nfunc lib_MemoizedFactorial(n int, cache map[int]int) (int, error) {\n\tif n > 20 { // FIXME Consider 32bit architecture\n\t\treturn 0, fmt.Errorf(\"too large n: %d\", n)\n\t}\n\n\tif cachedResult, ok := cache[n]; ok {\n\t\treturn cachedResult, nil\n\t}\n\n\tif n == 1 {\n\t\treturn 1, nil\n\t}\n\n\tbeforeResult, err := lib_MemoizedFactorial(n-1, cache)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tresult := n * beforeResult\n\tcache[n] = result\n\treturn result, nil\n}\n\nfunc lib_MemoizedBigFactorial(n int, cache map[int]*big.Int) *big.Int {\n\tif cachedResult, ok := cache[n]; ok {\n\t\treturn cachedResult\n\t}\n\n\tif n == 1 {\n\t\treturn big.NewInt(1)\n\t}\n\n\tbeforeResult := lib_MemoizedBigFactorial(n-1, cache)\n\tbigN := big.NewInt(int64(n))\n\tresult := bigN.Mul(bigN, beforeResult)\n\tcache[n] = result\n\treturn result\n}\n\nfunc lib_FindPosFromStringGrid(m [][]string, s string) (int, int) {\n\tfor rowIndex, row := range m {\n\t\tfor colIndex, p := range row {\n\t\t\tif p == s {\n\t\t\t\treturn rowIndex, colIndex\n\t\t\t}\n\t\t}\n\t}\n\tpanic(s + \" not found\")\n}\n\nfunc lib_ToYesNo(yes bool) string {\n\treturn lib_TernaryOPString(yes, \"Yes\", \"No\")\n}\n\nfunc lib_ReverseStr(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc lib_PanicIfErrorExist(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc lib_TrimSpaceAndNewLineCodeAndTab(s string) string {\n\treturn strings.TrimFunc(s, func(r rune) bool {\n\t\treturn r == ' ' || r == '\\r' || r == '\\n' || r == '\\t'\n\t})\n}\n\nconst YES = \"Yes\"\n\nconst NO = \"No\"\n\nfunc solve(S string) string {\n\tif S[2] == S[3] && S[4] == S[5] {\n\t\treturn YES\n\t} else {\n\t\treturn NO\n\t}\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar S string\n\tscanner.Scan()\n\tS = scanner.Text()\n\tfmt.Println(solve(S))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 345713, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s795391951", "group_id": "codeNet:p02723", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar S, ans string\n\tfmt.Scan(&S)\n\tif S[2] == S[3] && S[4] == S[5] {\n\t\tans = \"Yes\"\n\t} else {\n\t\tans = \"No\"\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1585876170, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/Go/s795391951.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s795391951", "user_id": "u163829702"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar S, ans string\n\tfmt.Scan(&S)\n\tif S[2] == S[3] && S[4] == S[5] {\n\t\tans = \"Yes\"\n\t} else {\n\t\tans = \"No\"\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 169, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s548089032", "group_id": "codeNet:p02723", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\tif str[2] == str[3] && str[4] == str[5] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585444898, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/Go/s548089032.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s548089032", "user_id": "u422903328"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\tif str[2] == str[3] && str[4] == str[5] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 173, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s936924473", "group_id": "codeNet:p02723", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanString() (s string) {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tinput := scanString()\n\tif input[2] == input[3] && input[4] == input[5] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585443819, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/Go/s936924473.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s936924473", "user_id": "u723383064"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanString() (s string) {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tinput := scanString()\n\tif input[2] == input[3] && input[4] == input[5] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 292, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s911549007", "group_id": "codeNet:p02724", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int64\n\tfmt.Scan(&x)\n\n\tb500 := x / 500\n\tx -= b500 * 500\n\tb5 := x / 5\n\n\tfmt.Println(b500*1000 + b5*5)\n\n}\n", "language": "Go", "metadata": {"date": 1585446465, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02724.html", "problem_id": "p02724", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02724/input.txt", "sample_output_relpath": "derived/input_output/data/p02724/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02724/Go/s911549007.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s911549007", "user_id": "u422017528"}, "prompt_components": {"gold_output": "2020\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int64\n\tfmt.Scan(&x)\n\n\tb500 := x / 500\n\tx -= b500 * 500\n\tb5 := x / 5\n\n\tfmt.Println(b500*1000 + b5*5)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "sample_input": "1024\n"}, "reference_outputs": ["2020\n"], "source_document_id": "p02724", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 152, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s135391806", "group_id": "codeNet:p02724", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\ta := x / 500\n\tb := (x % 500) / 5\n\tres := a*1000 + b*5\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1585444360, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02724.html", "problem_id": "p02724", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02724/input.txt", "sample_output_relpath": "derived/input_output/data/p02724/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02724/Go/s135391806.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s135391806", "user_id": "u950580836"}, "prompt_components": {"gold_output": "2020\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\ta := x / 500\n\tb := (x % 500) / 5\n\tres := a*1000 + b*5\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "sample_input": "1024\n"}, "reference_outputs": ["2020\n"], "source_document_id": "p02724", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 147, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s166729603", "group_id": "codeNet:p02725", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscan_init()\n\tk := scanInt()\n\tn := scanInt()\n\t// a := make([]int,n)\n\tcircle := make(map[int]int)\n\tfor i:=0; i i{\n\t\t\tstart = i\n\t\t}\n\t\tif end < i {\n\t\t\tend = i\n\t\t}\n\t}\n\n\tsum := end-start\n\tsecondstart := k+1\n\tsecondend := 0\n\tsecondsum := 0\n\tfor i,_ := range circle {\n\t\tif secondstart > k-i{\n\t\t\tsecondstart = k-i\n\t\t}\n\t\tif secondend < k-i {\n\t\t\tsecondend = k-i\n\t\t}\n\t}\n\tsecondsum = secondend - secondstart\n\tif sum > secondsum {\n\t\tsum = secondsum\n\t}\n\tfmt.Println(sum)\n}\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scan_init () {\n\tsc.Split(bufio.ScanWords)\n}\nfunc scanInt () int{\nsc.Scan()\n\ti,_ := strconv.Atoi(sc.Text())\n\treturn i\n}\n//func scan () string{\n// sc.Scan()\n//\treturn sc.Text()\n//}\n", "language": "Go", "metadata": {"date": 1592497164, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02725/input.txt", "sample_output_relpath": "derived/input_output/data/p02725/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02725/Go/s166729603.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s166729603", "user_id": "u184577857"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscan_init()\n\tk := scanInt()\n\tn := scanInt()\n\t// a := make([]int,n)\n\tcircle := make(map[int]int)\n\tfor i:=0; i i{\n\t\t\tstart = i\n\t\t}\n\t\tif end < i {\n\t\t\tend = i\n\t\t}\n\t}\n\n\tsum := end-start\n\tsecondstart := k+1\n\tsecondend := 0\n\tsecondsum := 0\n\tfor i,_ := range circle {\n\t\tif secondstart > k-i{\n\t\t\tsecondstart = k-i\n\t\t}\n\t\tif secondend < k-i {\n\t\t\tsecondend = k-i\n\t\t}\n\t}\n\tsecondsum = secondend - secondstart\n\tif sum > secondsum {\n\t\tsum = secondsum\n\t}\n\tfmt.Println(sum)\n}\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scan_init () {\n\tsc.Split(bufio.ScanWords)\n}\nfunc scanInt () int{\nsc.Scan()\n\ti,_ := strconv.Atoi(sc.Text())\n\treturn i\n}\n//func scan () string{\n// sc.Scan()\n//\treturn sc.Text()\n//}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 899, "cpu_time_ms": 109, "memory_kb": 11776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s408528912", "group_id": "codeNet:p02725", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar N,M int\n\tfmt.Scan(&N,&M)\n\tvar A string\n \tbuf := make([]byte, 1000000)\n \tsc.Buffer(buf, 1000000000)\n\tif sc.Scan() {\n\t\tA = sc.Text()\n\t}\n\tmax := 0\n\tvar diff,val_before,A_0 int\n\tvar distace_diff []int\n\tfor index, i := range strings.Fields(A) {\n\t\tvalue, _ := strconv.Atoi(i)\n\t\tif index > 0{\n\t\t\tdiff = value - val_before\n\t\t\tdistace_diff = append(distace_diff,diff)\n\t\t\tif max < diff{\n\t\t\t\tmax = diff\n\t\t\t}\n\t\t} else {\n\t\t\tA_0 = value\n\t\t}\n\t\tif len(distace_diff) == M-1 {\n\t\t\tdistace_diff = append(distace_diff,A_0 + (N - value))\n\t\t\tdiff = A_0 + (N - value)\n\t\t\tif max < diff{\n\t\t\t\tmax = diff\n\t\t\t}\n\t\t}\n\t\tval_before = value\n\t}\n\tvar count int\n\tvar total int \n\tfor _,i := range distace_diff {\n\t\tif (count == 0 ) && (i == max){\n\t\t\tcount += 1\n\t\t} else {\n\t\t\ttotal += i\n\t\t}\n\t}\n\tfmt.Println(total)\n}", "language": "Go", "metadata": {"date": 1587669784, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02725/input.txt", "sample_output_relpath": "derived/input_output/data/p02725/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02725/Go/s408528912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s408528912", "user_id": "u022107614"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar N,M int\n\tfmt.Scan(&N,&M)\n\tvar A string\n \tbuf := make([]byte, 1000000)\n \tsc.Buffer(buf, 1000000000)\n\tif sc.Scan() {\n\t\tA = sc.Text()\n\t}\n\tmax := 0\n\tvar diff,val_before,A_0 int\n\tvar distace_diff []int\n\tfor index, i := range strings.Fields(A) {\n\t\tvalue, _ := strconv.Atoi(i)\n\t\tif index > 0{\n\t\t\tdiff = value - val_before\n\t\t\tdistace_diff = append(distace_diff,diff)\n\t\t\tif max < diff{\n\t\t\t\tmax = diff\n\t\t\t}\n\t\t} else {\n\t\t\tA_0 = value\n\t\t}\n\t\tif len(distace_diff) == M-1 {\n\t\t\tdistace_diff = append(distace_diff,A_0 + (N - value))\n\t\t\tdiff = A_0 + (N - value)\n\t\t\tif max < diff{\n\t\t\t\tmax = diff\n\t\t\t}\n\t\t}\n\t\tval_before = value\n\t}\n\tvar count int\n\tvar total int \n\tfor _,i := range distace_diff {\n\t\tif (count == 0 ) && (i == max){\n\t\t\tcount += 1\n\t\t} else {\n\t\t\ttotal += i\n\t\t}\n\t}\n\tfmt.Println(total)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 909, "cpu_time_ms": 62, "memory_kb": 14336}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s471072690", "group_id": "codeNet:p02725", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar K, N, ans int\n\tfmt.Scan(&K, &N)\n\tA := make([]int, N)\n\n\tfor i := 0 ; i < N ; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\t\n\tif A[1] - A[0] < K-A[N-1]+A[0]{\n\t\tfor i := 1 ; i < N ; i++{\n\t\t\tans += A[i]-A[i-1]\n\t\t\t//fmt.Println(ans)\n\t\t}\n\t}else{\n\t\tfor i := 2 ; i < N ; i++ {\n\t\t\tans += A[i]-A[i-1]\n\t\t}\n\t\tif N > 3 {\n\t\t\tans += K-A[N-1]+A[0]\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1585448063, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02725/input.txt", "sample_output_relpath": "derived/input_output/data/p02725/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02725/Go/s471072690.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s471072690", "user_id": "u283295031"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar K, N, ans int\n\tfmt.Scan(&K, &N)\n\tA := make([]int, N)\n\n\tfor i := 0 ; i < N ; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\t\n\tif A[1] - A[0] < K-A[N-1]+A[0]{\n\t\tfor i := 1 ; i < N ; i++{\n\t\t\tans += A[i]-A[i-1]\n\t\t\t//fmt.Println(ans)\n\t\t}\n\t}else{\n\t\tfor i := 2 ; i < N ; i++ {\n\t\t\tans += A[i]-A[i-1]\n\t\t}\n\t\tif N > 3 {\n\t\t\tans += K-A[N-1]+A[0]\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 387, "cpu_time_ms": 980, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s634921132", "group_id": "codeNet:p02725", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanIntNums() (nums []int) {\n\tsc.Scan()\n\tnumString := strings.Split(sc.Text(), \" \")\n\n\tnums = make([]int, len(numString))\n\tvar err error\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tnums[i], err = strconv.Atoi(numString[i])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn nums\n}\n\nfunc main() {\n\tinputs := scanIntNums()\n\tK := inputs[0]\n\tN := inputs[1]\n\n\tdistances := scanIntNums()\n\n\tvar dist int\n\tmax := K - distances[N-1] + distances[0]\n\tfor i := 0; i < N-1; i++ {\n\t\tdist = distances[i+1] - distances[i]\n\t\tif max < dist {\n\t\t\tmax = dist\n\t\t}\n\t}\n\n\tfmt.Println(K - max)\n}\n", "language": "Go", "metadata": {"date": 1585444967, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02725/input.txt", "sample_output_relpath": "derived/input_output/data/p02725/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02725/Go/s634921132.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s634921132", "user_id": "u723383064"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanIntNums() (nums []int) {\n\tsc.Scan()\n\tnumString := strings.Split(sc.Text(), \" \")\n\n\tnums = make([]int, len(numString))\n\tvar err error\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tnums[i], err = strconv.Atoi(numString[i])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn nums\n}\n\nfunc main() {\n\tinputs := scanIntNums()\n\tK := inputs[0]\n\tN := inputs[1]\n\n\tdistances := scanIntNums()\n\n\tvar dist int\n\tmax := K - distances[N-1] + distances[0]\n\tfor i := 0; i < N-1; i++ {\n\t\tdist = distances[i+1] - distances[i]\n\t\tif max < dist {\n\t\t\tmax = dist\n\t\t}\n\t}\n\n\tfmt.Println(K - max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 670, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s043137064", "group_id": "codeNet:p02725", "input_text": "package main\n\nimport \"fmt\"\n\nvar k, n int\nvar as []int\n\nfunc main() {\n\tfmt.Scan(&k, &n)\n\tas = make([]int, n)\n\tfor i := range as {\n\t\tfmt.Scan(&as[i])\n\t}\n\tans := as[n-1] - as[0]\n\tfor i := 1; i < n; i++ {\n\t\tchmin(&ans, k + as[i-1] - as[i])\n\t}\n\tfmt.Println(ans)\n}\n\nconst INF = 1 << 60\n\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\n\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585444412, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02725/input.txt", "sample_output_relpath": "derived/input_output/data/p02725/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02725/Go/s043137064.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s043137064", "user_id": "u883678669"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar k, n int\nvar as []int\n\nfunc main() {\n\tfmt.Scan(&k, &n)\n\tas = make([]int, n)\n\tfor i := range as {\n\t\tfmt.Scan(&as[i])\n\t}\n\tans := as[n-1] - as[0]\n\tfor i := 1; i < n; i++ {\n\t\tchmin(&ans, k + as[i-1] - as[i])\n\t}\n\tfmt.Println(ans)\n}\n\nconst INF = 1 << 60\n\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\n\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 1023, "memory_kb": 6784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s650379108", "group_id": "codeNet:p02726", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\tn, x, y := io.NextInt(), io.NextInt()-1, io.NextInt()-1\n\tdp := make([][]int, n)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, n)\n\t\tfor j := range dp[i] {\n\t\t\tif i == j {\n\t\t\t\tdp[i][j] = 0\n\t\t\t} else if j == i-1 || j == i+1 {\n\t\t\t\tdp[i][j] = 1\n\t\t\t} else if (i == x && j == y) || (i == y && j == x) {\n\t\t\t\tdp[i][j] = 1\n\t\t\t} else {\n\t\t\t\tdp[i][j] = inf\n\t\t\t}\n\t\t}\n\t}\n\tfor k := 0; k < n; k++ {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif dp[i][k] == inf || dp[k][j] == inf {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdp[i][j] = Min(dp[i][j], dp[i][k]+dp[k][j])\n\t\t\t}\n\t\t}\n\t}\n\tcnt := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tcnt[dp[i][j]]++\n\t\t}\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tio.Println(cnt[i])\n\t}\n}\n\nconst inf = math.MaxInt64\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Min returns minimum value of inputs\nfunc Min(a ...int) (min int) {\n\tfor i, ai := range a {\n\t\tif i == 0 || ai < min {\n\t\t\tmin = ai\n\t\t}\n\t}\n\treturn min\n}\n", "language": "Go", "metadata": {"date": 1595618270, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02726.html", "problem_id": "p02726", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02726/input.txt", "sample_output_relpath": "derived/input_output/data/p02726/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02726/Go/s650379108.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s650379108", "user_id": "u914096063"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\tn, x, y := io.NextInt(), io.NextInt()-1, io.NextInt()-1\n\tdp := make([][]int, n)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, n)\n\t\tfor j := range dp[i] {\n\t\t\tif i == j {\n\t\t\t\tdp[i][j] = 0\n\t\t\t} else if j == i-1 || j == i+1 {\n\t\t\t\tdp[i][j] = 1\n\t\t\t} else if (i == x && j == y) || (i == y && j == x) {\n\t\t\t\tdp[i][j] = 1\n\t\t\t} else {\n\t\t\t\tdp[i][j] = inf\n\t\t\t}\n\t\t}\n\t}\n\tfor k := 0; k < n; k++ {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif dp[i][k] == inf || dp[k][j] == inf {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdp[i][j] = Min(dp[i][j], dp[i][k]+dp[k][j])\n\t\t\t}\n\t\t}\n\t}\n\tcnt := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tcnt[dp[i][j]]++\n\t\t}\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tio.Println(cnt[i])\n\t}\n}\n\nconst inf = math.MaxInt64\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Min returns minimum value of inputs\nfunc Min(a ...int) (min int) {\n\tfor i, ai := range a {\n\t\tif i == 0 || ai < min {\n\t\t\tmin = ai\n\t\t}\n\t}\n\treturn min\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "sample_input": "5 2 4\n"}, "reference_outputs": ["5\n4\n1\n0\n"], "source_document_id": "p02726", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2220, "cpu_time_ms": 2207, "memory_kb": 35320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s226445417", "group_id": "codeNet:p02726", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nvar n, x, y int\nvar graph [][]int\n\ntype Que []int\n\nfunc (q *Que) push(x int) {\n\t*q = append(*q, x)\n}\nfunc (q *Que) pop() int {\n\ttop := (*q)[0]\n\t*q = (*q)[1:]\n\treturn top\n}\n\nfunc main() {\n\tfmt.Scan(&n, &x, &y)\n\tgraph = make([][]int, n)\n\t// build\n\tfor i := 0; i < n-1; i++ {\n\t\tgraph[i] = append(graph[i], i+1)\n\t\tgraph[i+1] = append(graph[i+1], i)\n\t}\n\tgraph[x-1] = append(graph[x-1], y-1)\n\tgraph[y-1] = append(graph[y-1], x-1)\n\n\tdist := make([][]int, n)\n\tdists := make(map[int]int)\n\tfor i := range dist {\n\t\tdist[i] = make([]int, n)\n\t\tfor j := range dist[i] {\n\t\t\tdist[i][j] = -1\n\t\t}\n\t\tdist[i][i] = 0\n\t\tdists[0] += 2\n\t}\n\n\tfor i := range dist {\n\t\tque := make(Que, 0)\n\t\tque.push(i)\n\t\tfor len(que) > 0 {\n\t\t\tj := que.pop()\n\t\t\td := dist[i][j]\n\t\t\tfor _, nv := range graph[j] {\n\t\t\t\tif dist[i][nv] != -1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdist[i][nv] = d + 1\n\t\t\t\tdists[d+1]++\n\t\t\t\tque.push(nv)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(os.Stderr, dist)\n\tfor k := 1; k < n; k++ {\n\t\tfmt.Println(dists[k] / 2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585447416, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02726.html", "problem_id": "p02726", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02726/input.txt", "sample_output_relpath": "derived/input_output/data/p02726/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02726/Go/s226445417.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s226445417", "user_id": "u883678669"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nvar n, x, y int\nvar graph [][]int\n\ntype Que []int\n\nfunc (q *Que) push(x int) {\n\t*q = append(*q, x)\n}\nfunc (q *Que) pop() int {\n\ttop := (*q)[0]\n\t*q = (*q)[1:]\n\treturn top\n}\n\nfunc main() {\n\tfmt.Scan(&n, &x, &y)\n\tgraph = make([][]int, n)\n\t// build\n\tfor i := 0; i < n-1; i++ {\n\t\tgraph[i] = append(graph[i], i+1)\n\t\tgraph[i+1] = append(graph[i+1], i)\n\t}\n\tgraph[x-1] = append(graph[x-1], y-1)\n\tgraph[y-1] = append(graph[y-1], x-1)\n\n\tdist := make([][]int, n)\n\tdists := make(map[int]int)\n\tfor i := range dist {\n\t\tdist[i] = make([]int, n)\n\t\tfor j := range dist[i] {\n\t\t\tdist[i][j] = -1\n\t\t}\n\t\tdist[i][i] = 0\n\t\tdists[0] += 2\n\t}\n\n\tfor i := range dist {\n\t\tque := make(Que, 0)\n\t\tque.push(i)\n\t\tfor len(que) > 0 {\n\t\t\tj := que.pop()\n\t\t\td := dist[i][j]\n\t\t\tfor _, nv := range graph[j] {\n\t\t\t\tif dist[i][nv] != -1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdist[i][nv] = d + 1\n\t\t\t\tdists[d+1]++\n\t\t\t\tque.push(nv)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(os.Stderr, dist)\n\tfor k := 1; k < n; k++ {\n\t\tfmt.Println(dists[k] / 2)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "sample_input": "5 2 4\n"}, "reference_outputs": ["5\n4\n1\n0\n"], "source_document_id": "p02726", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n\nFor each i=1,2,...,N-1, there is an edge between Vertex i and Vertex i+1.\n\nThere is an edge between Vertex X and Vertex Y.\n\nFor each k=1,2,...,N-1, solve the problem below:\n\nFind the number of pairs of integers (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j in G is k.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq X,Y \\leq N\n\nX+1 < Y\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X Y\n\nOutput\n\nFor each k=1, 2, ..., N-1 in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n5\n4\n1\n0\n\nThe graph in this input is as follows:\n\nThere are five pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 1: (1,2)\\,,(2,3)\\,,(2,4)\\,,(3,4)\\,,(4,5).\n\nThere are four pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 2: (1,3)\\,,(1,4)\\,,(2,5)\\,,(3,5).\n\nThere is one pair (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 3: (1,5).\n\nThere are no pairs (i,j) (1 \\leq i < j \\leq N) such that the shortest distance between Vertex i and Vertex j is 4.\n\nSample Input 2\n\n3 1 3\n\nSample Output 2\n\n3\n0\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n7 3 7\n\nSample Output 3\n\n7\n8\n4\n2\n0\n0\n\nSample Input 4\n\n10 4 8\n\nSample Output 4\n\n10\n12\n10\n8\n4\n1\n0\n0\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1013, "cpu_time_ms": 1539, "memory_kb": 133504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s732450388", "group_id": "codeNet:p02728", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tg := make([][]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := scanInt()-1, scanInt()-1\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tdp := make([]int, n)\n\tcnt := make([]int, n)\n\tpar := make([]int, n)\n\tfactorialInit(n)\n\tmemo := make([]int, 0, n)\n\n\tvar dfs func(v, p int) int\n\tdfs = func(v, p int) int {\n\t\tmemo = append(memo, v)\n\t\tpar[v] = p\n\t\tdp[v] = 1\n\t\tfor _, to := range g[v] {\n\t\t\tif to == p {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc := dfs(to, v)\n\t\t\tcnt[v] += c\n\t\t\tdp[v] = (dp[v] * dp[to]) % mod\n\t\t\tdp[v] = (dp[v] * ifac[c]) % mod\n\t\t}\n\t\tdp[v] = (dp[v] * fac[cnt[v]]) % mod\n\n\t\tcnt[v]++\n\t\treturn cnt[v]\n\t}\n\n\tdfs(0, 0)\n\n\tans := make([]int, n)\n\tdp2 := make([]int, n)\n\tdp2[0] = 1\n\tans[0] = dp[0]\n\n\tfor i := 1; i < n; i++ {\n\t\tv := memo[i]\n\t\tp := par[v]\n\t\tdp2[v] = dp[p] * ifac[cnt[p]-1] % mod * fac[cnt[v]] % mod * fac[n-1-cnt[v]] % mod * ifac[n-cnt[p]] % mod\n\t\tdp2[v] = div(dp2[v], dp[v]) * dp2[p] % mod\n\t\tans[v] = dp[v] * dp2[v] % mod * ifac[cnt[v]-1] % mod * fac[n-1] % mod * ifac[n-cnt[v]] % mod\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprintln(wr, ans[i])\n\t}\n\n}\n\nconst mod = 1000000007\n\nvar fac, ifac, inv []int\n\nfunc factorialInit(n int) {\n\tfac = make([]int, n+1)\n\tifac = make([]int, n+1)\n\tinv = make([]int, n+1)\n\n\tfac[0], fac[1] = 1, 1\n\tifac[0], ifac[1] = 1, 1\n\tinv[1] = 1\n\n\tfor i := 1; i < n; i++ {\n\t\tfac[i+1] = fac[i] * (i + 1) % mod\n\t\tinv[i+1] = mod - inv[mod%(i+1)]*(mod/(i+1))%mod\n\t\tifac[i+1] = ifac[i] * inv[i+1] % mod\n\t}\n}\n\nfunc div(b, c int) int {\n\ta, p, x, u := c, mod, 1, 0\n\tfor p != 0 {\n\t\tt := a / p\n\t\ta, p = p, a-t*p\n\t\tx, u = u, x-t*u\n\t}\n\tres := b * x % mod\n\tif res < 0 {\n\t\tres += mod\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1593926533, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02728.html", "problem_id": "p02728", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02728/input.txt", "sample_output_relpath": "derived/input_output/data/p02728/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02728/Go/s732450388.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s732450388", "user_id": "u548992197"}, "prompt_components": {"gold_output": "2\n1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tg := make([][]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := scanInt()-1, scanInt()-1\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tdp := make([]int, n)\n\tcnt := make([]int, n)\n\tpar := make([]int, n)\n\tfactorialInit(n)\n\tmemo := make([]int, 0, n)\n\n\tvar dfs func(v, p int) int\n\tdfs = func(v, p int) int {\n\t\tmemo = append(memo, v)\n\t\tpar[v] = p\n\t\tdp[v] = 1\n\t\tfor _, to := range g[v] {\n\t\t\tif to == p {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc := dfs(to, v)\n\t\t\tcnt[v] += c\n\t\t\tdp[v] = (dp[v] * dp[to]) % mod\n\t\t\tdp[v] = (dp[v] * ifac[c]) % mod\n\t\t}\n\t\tdp[v] = (dp[v] * fac[cnt[v]]) % mod\n\n\t\tcnt[v]++\n\t\treturn cnt[v]\n\t}\n\n\tdfs(0, 0)\n\n\tans := make([]int, n)\n\tdp2 := make([]int, n)\n\tdp2[0] = 1\n\tans[0] = dp[0]\n\n\tfor i := 1; i < n; i++ {\n\t\tv := memo[i]\n\t\tp := par[v]\n\t\tdp2[v] = dp[p] * ifac[cnt[p]-1] % mod * fac[cnt[v]] % mod * fac[n-1-cnt[v]] % mod * ifac[n-cnt[p]] % mod\n\t\tdp2[v] = div(dp2[v], dp[v]) * dp2[p] % mod\n\t\tans[v] = dp[v] * dp2[v] % mod * ifac[cnt[v]-1] % mod * fac[n-1] % mod * ifac[n-cnt[v]] % mod\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprintln(wr, ans[i])\n\t}\n\n}\n\nconst mod = 1000000007\n\nvar fac, ifac, inv []int\n\nfunc factorialInit(n int) {\n\tfac = make([]int, n+1)\n\tifac = make([]int, n+1)\n\tinv = make([]int, n+1)\n\n\tfac[0], fac[1] = 1, 1\n\tifac[0], ifac[1] = 1, 1\n\tinv[1] = 1\n\n\tfor i := 1; i < n; i++ {\n\t\tfac[i+1] = fac[i] * (i + 1) % mod\n\t\tinv[i+1] = mod - inv[mod%(i+1)]*(mod/(i+1))%mod\n\t\tifac[i+1] = ifac[i] * inv[i+1] % mod\n\t}\n}\n\nfunc div(b, c int) int {\n\ta, p, x, u := c, mod, 1, 0\n\tfor p != 0 {\n\t\tt := a / p\n\t\ta, p = p, a-t*p\n\t\tx, u = u, x-t*u\n\t}\n\tres := b * x % mod\n\tif res < 0 {\n\t\tres += mod\n\t}\n\treturn res\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i.\nFor each k=1, ..., N, solve the problem below:\n\nConsider writing a number on each vertex in the tree in the following manner:\n\nFirst, write 1 on Vertex k.\n\nThen, for each of the numbers 2, ..., N in this order, write the number on the vertex chosen as follows:\n\nChoose a vertex that still does not have a number written on it and is adjacent to a vertex with a number already written on it. If there are multiple such vertices, choose one of them at random.\n\nFind the number of ways in which we can write the numbers on the vertices, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq a_i,b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nFor each k=1, 2, ..., N in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n3\n1 2\n1 3\n\nSample Output 1\n\n2\n1\n1\n\nThe graph in this input is as follows:\n\nFor k=1, there are two ways in which we can write the numbers on the vertices, as follows:\n\nWriting 1, 2, 3 on Vertex 1, 2, 3, respectively\n\nWriting 1, 3, 2 on Vertex 1, 2, 3, respectively\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n1\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n5\n1 2\n2 3\n3 4\n3 5\n\nSample Output 3\n\n2\n8\n12\n3\n3\n\nThe graph in this input is as follows:\n\nSample Input 4\n\n8\n1 2\n2 3\n3 4\n3 5\n3 6\n6 7\n6 8\n\nSample Output 4\n\n40\n280\n840\n120\n120\n504\n72\n72\n\nThe graph in this input is as follows:", "sample_input": "3\n1 2\n1 3\n"}, "reference_outputs": ["2\n1\n1\n"], "source_document_id": "p02728", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i.\nFor each k=1, ..., N, solve the problem below:\n\nConsider writing a number on each vertex in the tree in the following manner:\n\nFirst, write 1 on Vertex k.\n\nThen, for each of the numbers 2, ..., N in this order, write the number on the vertex chosen as follows:\n\nChoose a vertex that still does not have a number written on it and is adjacent to a vertex with a number already written on it. If there are multiple such vertices, choose one of them at random.\n\nFind the number of ways in which we can write the numbers on the vertices, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq a_i,b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nFor each k=1, 2, ..., N in this order, print a line containing the answer to the problem.\n\nSample Input 1\n\n3\n1 2\n1 3\n\nSample Output 1\n\n2\n1\n1\n\nThe graph in this input is as follows:\n\nFor k=1, there are two ways in which we can write the numbers on the vertices, as follows:\n\nWriting 1, 2, 3 on Vertex 1, 2, 3, respectively\n\nWriting 1, 3, 2 on Vertex 1, 2, 3, respectively\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n1\n\nThe graph in this input is as follows:\n\nSample Input 3\n\n5\n1 2\n2 3\n3 4\n3 5\n\nSample Output 3\n\n2\n8\n12\n3\n3\n\nThe graph in this input is as follows:\n\nSample Input 4\n\n8\n1 2\n2 3\n3 4\n3 5\n3 6\n6 7\n6 8\n\nSample Output 4\n\n40\n280\n840\n120\n120\n504\n72\n72\n\nThe graph in this input is as follows:", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2659, "cpu_time_ms": 188, "memory_kb": 33464}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s838507535", "group_id": "codeNet:p02729", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc mul(x int) int {\n\tans := 1\n\tfor i := 1; i <= 2; i++ {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tscanner.Scan()\n\tM, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// 組み合わせ問題 Nの中から2つのパターンとMの中から2つのパターン\n\tanswer := ((N * (N - 1)) / mul(N)) + ((M * (M - 1)) / mul(M))\n\n\tfmt.Println(answer)\n}\n", "language": "Go", "metadata": {"date": 1595615639, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/Go/s838507535.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s838507535", "user_id": "u785064577"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc mul(x int) int {\n\tans := 1\n\tfor i := 1; i <= 2; i++ {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tscanner.Scan()\n\tM, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// 組み合わせ問題 Nの中から2つのパターンとMの中から2つのパターン\n\tanswer := ((N * (N - 1)) / mul(N)) + ((M * (M - 1)) / mul(M))\n\n\tfmt.Println(answer)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 609, "cpu_time_ms": 6, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s257220798", "group_id": "codeNet:p02729", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input1 int\n\tvar input2 int\n\n\n\t_, _ = fmt.Scan(&input1, &input2)\n\n\tans := input1 * (input1 - 1 ) /2 + input2 * (input2 - 1) / 2\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1587848972, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/Go/s257220798.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s257220798", "user_id": "u942427847"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input1 int\n\tvar input2 int\n\n\n\t_, _ = fmt.Scan(&input1, &input2)\n\n\tans := input1 * (input1 - 1 ) /2 + input2 * (input2 - 1) / 2\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 201, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s523136171", "group_id": "codeNet:p02729", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tN, M := sc.nextInt(), sc.nextInt()\n\teven := (N*N - N) / 2\n\tvar odd int\n\tif M >= 2 {\n\t\todd = (M*M - M) / 2\n\t}\n\tfmt.Println(odd + even)\n}\n\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Pair a\ntype Pair struct {\n\tfirst int\n\tsecond int\n}\n\n// Queue a\ntype Queue struct {\n\tv []Pair\n}\n\n// Push for queue\nfunc (q *Queue) Push(v Pair) {\n\tq.v = append(q.v, v)\n}\n\n// Pop for queue\nfunc (q *Queue) Pop() Pair {\n\tr := q.v[0]\n\tq.v = q.v[1:]\n\treturn r\n}\n\n// Front for queue\nfunc (q Queue) Front() Pair {\n\treturn q.v[0]\n}\n\n// Empty return true if empty\nfunc (q Queue) Empty() bool {\n\treturn len(q.v) == 0\n}\n", "language": "Go", "metadata": {"date": 1584925607, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/Go/s523136171.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s523136171", "user_id": "u799236543"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tN, M := sc.nextInt(), sc.nextInt()\n\teven := (N*N - N) / 2\n\tvar odd int\n\tif M >= 2 {\n\t\todd = (M*M - M) / 2\n\t}\n\tfmt.Println(odd + even)\n}\n\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Pair a\ntype Pair struct {\n\tfirst int\n\tsecond int\n}\n\n// Queue a\ntype Queue struct {\n\tv []Pair\n}\n\n// Push for queue\nfunc (q *Queue) Push(v Pair) {\n\tq.v = append(q.v, v)\n}\n\n// Pop for queue\nfunc (q *Queue) Pop() Pair {\n\tr := q.v[0]\n\tq.v = q.v[1:]\n\treturn r\n}\n\n// Front for queue\nfunc (q Queue) Front() Pair {\n\treturn q.v[0]\n}\n\n// Empty return true if empty\nfunc (q Queue) Empty() bool {\n\treturn len(q.v) == 0\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2744, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s493443904", "group_id": "codeNet:p02730", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := readString()\n\tn := len(s)\n\ts1 := s[0 : (n-1)/2]\n\ts2 := s[((n+3)/2)-1 : n]\n\n\tif isPalindrome(s) && isPalindrome(s1) && isPalindrome(s2) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc isPalindrome(s string) bool {\n\tn := len(s)\n\tfor i := 0; i < n; i++ {\n\t\tif i == n-i-1 {\n\t\t\tbreak\n\t\t}\n\t\tif s[i] != s[n-i-1] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1588512285, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02730.html", "problem_id": "p02730", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02730/input.txt", "sample_output_relpath": "derived/input_output/data/p02730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02730/Go/s493443904.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s493443904", "user_id": "u309370374"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := readString()\n\tn := len(s)\n\ts1 := s[0 : (n-1)/2]\n\ts2 := s[((n+3)/2)-1 : n]\n\n\tif isPalindrome(s) && isPalindrome(s1) && isPalindrome(s2) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc isPalindrome(s string) bool {\n\tn := len(s)\n\tfor i := 0; i < n; i++ {\n\t\tif i == n-i-1 {\n\t\t\tbreak\n\t\t}\n\t\tif s[i] != s[n-i-1] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "sample_input": "akasaka\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02730", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 806, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s909974011", "group_id": "codeNet:p02731", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Powerset1(nums []int) [][]int {\n\tif len(nums) == 0 {\n\t\treturn [][]int{ []int{} }\n\t}\n\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tfor i := 0; i < length; i++ {\n\t\tbi := i\n\t\ts := []int{}\n\t\tfor _, n := range nums {\n\t\t\tif bi % 2 != 0 {\n\t\t\t\ts = append(s, n)\n\t\t\t}\n\t\t\tbi = bi / 2\n\n\t\t}\n\t\tresult[i] = s\n\t}\n\n\treturn result\n}\n\n\n\nfunc Combination1(nums []int, n int) [][]int {\n\tps := Powerset2(nums)\n\tresult := make([][]int, CombinationCount(len(nums), n))\n\tindex := 0\n\tfor _, s := range ps {\n\t\tif len(s) == n {\n\t\t\tresult[index] = s\n\t\t\tindex++\n\t\t}\n\t}\n\treturn result\n}\n\n\nfunc CombinationCount(n, m int) int {\n\treturn Fact(n) / (Fact(n-m) * Fact(m))\n}\n\nfunc Fact(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn n * Fact(n-1)\n\t}\n}\nfunc Powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tL := nextInt()\n\ta := math.Pow(float64(L) / float64(3), 3)\n\tfmt.Printf(\"%.6f\\n\", a)\n\treturn\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc sumInt(a ...int) int {\n\ts := 0;\n\tfor _, v := range a {\n\t\ts += v\n\t};\n\treturn s\n}\nfunc maxInt(a ...int) int {\n\tm := a[0];\n\tfor _, x := range a {\n\t\tif x > m {\n\t\t\tm = x\n\t\t}\n\t};\n\treturn m\n}\nfunc minInt(a ...int) int {\n\tm := a[0];\n\tfor _, x := range a {\n\t\tif x < m {\n\t\t\tm = x\n\t\t}\n\t};\n\treturn m\n}\n\nfunc readInt() (N int) {\n\tfmt.Scan(&N)\n\treturn\n}\n\nfunc readChar() (s string) {\n\tfmt.Scan(&s)\n\treturn\n}\n\n// 指定の要素数の数列を読み込んでスライスで返す関数\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\n// 指定の要素数の文字列群を読み込んでスライスで返す関数\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n\n// 絶対値\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\n// 2乗\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\n\nfunc minInt64(nums ...int64) int64 {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int64(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\n// 文字列群aの中に文字列bが含まれるかどうかを判定する。\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// 1行の文字列を入力\n// Example:\n// -----------------\n// hogehoge\n// -----------------\nfunc StrStdin() string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\treturn strings.TrimSpace(scanner.Text())\n}\n\n// 1つの符号付き整数値(64bit)入力\n// Exapmle:\n// ------------------\n// 1000000007\n// ------------------\nfunc Int64Stdin() int64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseInt(strings.TrimSpace(stringInput), 10, 64)\n\treturn num\n}\n\n// 1つの符号なし整数値(64bit)入力\n// Exapmle:\n// ------------------\n// 1000000007\n// ------------------\nfunc Uint64Stdin() uint64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseUint(strings.TrimSpace(stringInput), 10, 64)\n\treturn num\n}\n\n// 1つの符号付き浮動小数点数(64bit)の入力\n// Exapmle:\n// ------------------\n// 33.4\n// ------------------\nfunc Float64Stdin() float64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseFloat(strings.TrimSpace(stringInput), 64)\n\treturn num\n}\n\n// 空白や空文字だけの値を除去したSplit\nfunc SplitWithoutEmpty(stringTargeted string, delim string) []string {\n\tstringSplited := strings.Split(stringTargeted, delim)\n\tstrs := []string{}\n\n\tfor _, str := range stringSplited {\n\t\tif str != \"\" {\n\t\t\tstrs = append(strs, str)\n\t\t}\n\t}\n\treturn strs\n}\n\n// 空白区切りで複数の文字列を1行で入力\n// Example:\n// --------------------\n// hoge fuga hage\n// --------------------\nfunc SliceStrsStdin(delim string) []string {\n\tstringInput := StrStdin()\n\treturn SplitWithoutEmpty(stringInput, delim)\n}\n\n// 空白区切りで複数の符号付き整数値(64bit)を1行で入力\n// Example:\n// --------------------\n// 45 -100 23\n// --------------------\nfunc SliceInt64Stdin() []int64 {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tint64Slice := []int64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseInt(stringSplited[ni], 10, 64)\n\t\tint64Slice = append(int64Slice, num)\n\t}\n\n\treturn int64Slice\n}\n\n// 空白区切りで複数の符号付き整数値を1行で入力\n// Example:\n// --------------------\n// 45 -100 23\n// --------------------\nfunc SliceIntStdin() []int {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tintSlice := []int{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.Atoi(stringSplited[ni])\n\t\tintSlice = append(intSlice, num)\n\t}\n\n\treturn intSlice\n}\n\n// 空白区切りで複数の符号なし整数値(64bit)を1行で入力\n// Example:\n// --------------------\n// 43 7 21\n// --------------------\nfunc SliceUint64Stdin() []uint64 {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tuint64Slice := []uint64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseUint(stringSplited[ni], 10, 64)\n\t\tuint64Slice = append(uint64Slice, num)\n\t}\n\n\treturn uint64Slice\n}\n\n// 空白区切りで複数の符号付き浮動小数点数(64bit)を入力\n// Example:\n// --------------------\n// 45.0 -62.1 11.7\n// --------------------\nfunc SliceFloat64Stdin() []float64 {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tfloat64Slice := []float64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseFloat(stringSplited[ni], 64)\n\t\tfloat64Slice = append(float64Slice, num)\n\t}\n\n\treturn float64Slice\n}\n", "language": "Go", "metadata": {"date": 1588481209, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02731.html", "problem_id": "p02731", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02731/input.txt", "sample_output_relpath": "derived/input_output/data/p02731/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02731/Go/s909974011.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909974011", "user_id": "u275242455"}, "prompt_components": {"gold_output": "1.000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Powerset1(nums []int) [][]int {\n\tif len(nums) == 0 {\n\t\treturn [][]int{ []int{} }\n\t}\n\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tfor i := 0; i < length; i++ {\n\t\tbi := i\n\t\ts := []int{}\n\t\tfor _, n := range nums {\n\t\t\tif bi % 2 != 0 {\n\t\t\t\ts = append(s, n)\n\t\t\t}\n\t\t\tbi = bi / 2\n\n\t\t}\n\t\tresult[i] = s\n\t}\n\n\treturn result\n}\n\n\n\nfunc Combination1(nums []int, n int) [][]int {\n\tps := Powerset2(nums)\n\tresult := make([][]int, CombinationCount(len(nums), n))\n\tindex := 0\n\tfor _, s := range ps {\n\t\tif len(s) == n {\n\t\t\tresult[index] = s\n\t\t\tindex++\n\t\t}\n\t}\n\treturn result\n}\n\n\nfunc CombinationCount(n, m int) int {\n\treturn Fact(n) / (Fact(n-m) * Fact(m))\n}\n\nfunc Fact(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn n * Fact(n-1)\n\t}\n}\nfunc Powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tL := nextInt()\n\ta := math.Pow(float64(L) / float64(3), 3)\n\tfmt.Printf(\"%.6f\\n\", a)\n\treturn\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc sumInt(a ...int) int {\n\ts := 0;\n\tfor _, v := range a {\n\t\ts += v\n\t};\n\treturn s\n}\nfunc maxInt(a ...int) int {\n\tm := a[0];\n\tfor _, x := range a {\n\t\tif x > m {\n\t\t\tm = x\n\t\t}\n\t};\n\treturn m\n}\nfunc minInt(a ...int) int {\n\tm := a[0];\n\tfor _, x := range a {\n\t\tif x < m {\n\t\t\tm = x\n\t\t}\n\t};\n\treturn m\n}\n\nfunc readInt() (N int) {\n\tfmt.Scan(&N)\n\treturn\n}\n\nfunc readChar() (s string) {\n\tfmt.Scan(&s)\n\treturn\n}\n\n// 指定の要素数の数列を読み込んでスライスで返す関数\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\n// 指定の要素数の文字列群を読み込んでスライスで返す関数\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n\n// 絶対値\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\n// 2乗\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\n\nfunc minInt64(nums ...int64) int64 {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int64(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\n// 文字列群aの中に文字列bが含まれるかどうかを判定する。\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// 1行の文字列を入力\n// Example:\n// -----------------\n// hogehoge\n// -----------------\nfunc StrStdin() string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\treturn strings.TrimSpace(scanner.Text())\n}\n\n// 1つの符号付き整数値(64bit)入力\n// Exapmle:\n// ------------------\n// 1000000007\n// ------------------\nfunc Int64Stdin() int64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseInt(strings.TrimSpace(stringInput), 10, 64)\n\treturn num\n}\n\n// 1つの符号なし整数値(64bit)入力\n// Exapmle:\n// ------------------\n// 1000000007\n// ------------------\nfunc Uint64Stdin() uint64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseUint(strings.TrimSpace(stringInput), 10, 64)\n\treturn num\n}\n\n// 1つの符号付き浮動小数点数(64bit)の入力\n// Exapmle:\n// ------------------\n// 33.4\n// ------------------\nfunc Float64Stdin() float64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseFloat(strings.TrimSpace(stringInput), 64)\n\treturn num\n}\n\n// 空白や空文字だけの値を除去したSplit\nfunc SplitWithoutEmpty(stringTargeted string, delim string) []string {\n\tstringSplited := strings.Split(stringTargeted, delim)\n\tstrs := []string{}\n\n\tfor _, str := range stringSplited {\n\t\tif str != \"\" {\n\t\t\tstrs = append(strs, str)\n\t\t}\n\t}\n\treturn strs\n}\n\n// 空白区切りで複数の文字列を1行で入力\n// Example:\n// --------------------\n// hoge fuga hage\n// --------------------\nfunc SliceStrsStdin(delim string) []string {\n\tstringInput := StrStdin()\n\treturn SplitWithoutEmpty(stringInput, delim)\n}\n\n// 空白区切りで複数の符号付き整数値(64bit)を1行で入力\n// Example:\n// --------------------\n// 45 -100 23\n// --------------------\nfunc SliceInt64Stdin() []int64 {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tint64Slice := []int64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseInt(stringSplited[ni], 10, 64)\n\t\tint64Slice = append(int64Slice, num)\n\t}\n\n\treturn int64Slice\n}\n\n// 空白区切りで複数の符号付き整数値を1行で入力\n// Example:\n// --------------------\n// 45 -100 23\n// --------------------\nfunc SliceIntStdin() []int {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tintSlice := []int{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.Atoi(stringSplited[ni])\n\t\tintSlice = append(intSlice, num)\n\t}\n\n\treturn intSlice\n}\n\n// 空白区切りで複数の符号なし整数値(64bit)を1行で入力\n// Example:\n// --------------------\n// 43 7 21\n// --------------------\nfunc SliceUint64Stdin() []uint64 {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tuint64Slice := []uint64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseUint(stringSplited[ni], 10, 64)\n\t\tuint64Slice = append(uint64Slice, num)\n\t}\n\n\treturn uint64Slice\n}\n\n// 空白区切りで複数の符号付き浮動小数点数(64bit)を入力\n// Example:\n// --------------------\n// 45.0 -62.1 11.7\n// --------------------\nfunc SliceFloat64Stdin() []float64 {\n\tstringSplited := SliceStrsStdin(\" \")\n\n\tfloat64Slice := []float64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseFloat(stringSplited[ni], 64)\n\t\tfloat64Slice = append(float64Slice, num)\n\t}\n\n\treturn float64Slice\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer L.\nFind the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\n\nConstraints\n\n1 ≤ L ≤ 1000\n\nL is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\n\nOutput\n\nPrint the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\nYour output is considered correct if its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1.000000000000\n\nFor example, a rectangular cuboid whose dimensions are 0.8, 1, and 1.2 has a volume of 0.96.\n\nOn the other hand, if the dimensions are 1, 1, and 1, the volume of the rectangular cuboid is 1, which is greater.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n36926037.000000000000", "sample_input": "3\n"}, "reference_outputs": ["1.000000000000\n"], "source_document_id": "p02731", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer L.\nFind the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\n\nConstraints\n\n1 ≤ L ≤ 1000\n\nL is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL\n\nOutput\n\nPrint the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\nYour output is considered correct if its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1.000000000000\n\nFor example, a rectangular cuboid whose dimensions are 0.8, 1, and 1.2 has a volume of 0.96.\n\nOn the other hand, if the dimensions are 1, 1, and 1, the volume of the rectangular cuboid is 1, which is greater.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n36926037.000000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6833, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s764761603", "group_id": "codeNet:p02732", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\t// ベースがあってそこから引いていけると気づけば勝てる\n\tN := nextInt()\n\tA := nextInts(N)\n\tT, D := make(map[int]int), make(map[int]int)\n\n\tfor _, a := range A {\n\t\tif _, ok := T[a]; ok {\n\t\t\tT[a] += 1\n\t\t} else {\n\t\t\tT[a] = 1\n\t\t}\n\t}\n\tans := 0\n\tfor k, v := range T {\n\t\tif _, ok := D[k]; !ok {\n\t\t\tD[k] = ncr(v, 2)\n\t\t\tans += D[k]\n\t\t}\n\t}\n\tfor _, a := range A {\n\t\tfmt.Fprintln(out, ans-(T[a]-1))\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-\n// * Structures *\n// -*-*-*-*-*-*-*-\n\n// Queue ... only for integers\ntype Queue struct {\n\tqueue []int\n}\n\n// Enqueue ... the so-called enqueue\nfunc (q *Queue) Enqueue(x int) {\n\tq.queue = append(q.queue, x)\n}\n\n// Dequeue ... the so-called dequeue\nfunc (q *Queue) Dequeue() (ret int) {\n\tret, q.queue = q.queue[0], q.queue[1:]\n\treturn\n}\n\n// Len ... return length of queue\nfunc (q *Queue) Len() (ret int) {\n\treturn len(q.queue)\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc min(a, b int) int {\n\tx, y := toFloat64(a), toFloat64(b)\n\tif x < y {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc max(a, b int) int {\n\tx, y := toFloat64(a), toFloat64(b)\n\tif x > y {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc toFloat64(v interface{}) float64 {\n\tr := reflect.ValueOf(v)\n\tif r.IsValid() {\n\t\tswitch r.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n\t\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,\n\t\t\treflect.Float32, reflect.Float64:\n\t\t\tvar x float64\n\t\t\treturn r.Convert(reflect.TypeOf(x)).Interface().(float64)\n\t\tdefault:\n\t\t\treturn 0\n\n\t\t}\n\t}\n\treturn 0\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n\nfunc ncr(n, r int) int {\n\t// せいぜいn<10^2くらいの精度しかなくない?\n\tres := 1\n\tfor i := 1; i <= r; i++ {\n\t\tres = res * (n - i + 1) / i\n\t}\n\treturn res\n}\n\nfunc ncrMod(n, r, mod int) int {\n\t// 呼び出すたびにテーブルを作るのは愚です(どうしようかね)\n\t_n := 1000000\n\tg1 := make([]int, _n+1)\n\tg1[0], g1[1] = 1, 1\n\tg2 := make([]int, _n+1)\n\tg2[0], g2[1] = 1, 1\n\tinverse := make([]int, _n+1)\n\tinverse[0], inverse[1] = 0, 1\n\tfor i := 2; i <= _n; i++ {\n\t\tg1[i] = (g1[i-1] * i) % mod\n\t\tinverse[i] = mod - inverse[mod%i]*(mod/i)%mod\n\t\tg2[i] = (g2[i-1] * inverse[i]) % mod\n\t}\n\n\treturn g1[n] * (g2[r] * g2[n-r] % mod) % mod\n}\n\nfunc next_permutation(arr []int) func() []int {\n\t/*\n\t\thow to use it:\n\t\t\tthis is a generator, so should be invoked such as below example.\n\n\t\t\t\"\"\"code\"\"\"\n\t\t\tnp := next_permutation(arr)\n\t\t\tfor{\n\t\t\t\tlis := np()\n\t\t\t\tif len(lis) == 0{\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tfmt.Println(lis)\n\t\t\t}\n\t\t\t\"\"\"code end\"\"\"\n\t*/\n\tfirst := true\n\tret := append([]int{}, arr...)\n\t_next_permutation := func() []int {\n\t\tif first {\n\t\t\tfirst = false\n\t\t\treturn arr\n\t\t}\n\t\tn := len(ret)\n\t\tfor i := n - 2; i >= 0; i-- {\n\t\t\tif ret[i] < ret[i+1] {\n\t\t\t\tj := n\n\t\t\t\tfor {\n\t\t\t\t\tj -= 1\n\t\t\t\t\tif ret[i] < ret[j] {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tret[i], ret[j] = ret[j], ret[i]\n\t\t\t\tfor k := n - 1; i < k; i, k = i+1, k-1 {\n\t\t\t\t\tret[i+1], ret[k] = ret[k], ret[i+1]\n\t\t\t\t}\n\t\t\t\treturn ret\n\t\t\t}\n\t\t}\n\t\treturn []int{}\n\t}\n\treturn _next_permutation\n}\n", "language": "Go", "metadata": {"date": 1587057512, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/Go/s764761603.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s764761603", "user_id": "u445624660"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\t// ベースがあってそこから引いていけると気づけば勝てる\n\tN := nextInt()\n\tA := nextInts(N)\n\tT, D := make(map[int]int), make(map[int]int)\n\n\tfor _, a := range A {\n\t\tif _, ok := T[a]; ok {\n\t\t\tT[a] += 1\n\t\t} else {\n\t\t\tT[a] = 1\n\t\t}\n\t}\n\tans := 0\n\tfor k, v := range T {\n\t\tif _, ok := D[k]; !ok {\n\t\t\tD[k] = ncr(v, 2)\n\t\t\tans += D[k]\n\t\t}\n\t}\n\tfor _, a := range A {\n\t\tfmt.Fprintln(out, ans-(T[a]-1))\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-\n// * Structures *\n// -*-*-*-*-*-*-*-\n\n// Queue ... only for integers\ntype Queue struct {\n\tqueue []int\n}\n\n// Enqueue ... the so-called enqueue\nfunc (q *Queue) Enqueue(x int) {\n\tq.queue = append(q.queue, x)\n}\n\n// Dequeue ... the so-called dequeue\nfunc (q *Queue) Dequeue() (ret int) {\n\tret, q.queue = q.queue[0], q.queue[1:]\n\treturn\n}\n\n// Len ... return length of queue\nfunc (q *Queue) Len() (ret int) {\n\treturn len(q.queue)\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc min(a, b int) int {\n\tx, y := toFloat64(a), toFloat64(b)\n\tif x < y {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc max(a, b int) int {\n\tx, y := toFloat64(a), toFloat64(b)\n\tif x > y {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc toFloat64(v interface{}) float64 {\n\tr := reflect.ValueOf(v)\n\tif r.IsValid() {\n\t\tswitch r.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n\t\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,\n\t\t\treflect.Float32, reflect.Float64:\n\t\t\tvar x float64\n\t\t\treturn r.Convert(reflect.TypeOf(x)).Interface().(float64)\n\t\tdefault:\n\t\t\treturn 0\n\n\t\t}\n\t}\n\treturn 0\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n\nfunc ncr(n, r int) int {\n\t// せいぜいn<10^2くらいの精度しかなくない?\n\tres := 1\n\tfor i := 1; i <= r; i++ {\n\t\tres = res * (n - i + 1) / i\n\t}\n\treturn res\n}\n\nfunc ncrMod(n, r, mod int) int {\n\t// 呼び出すたびにテーブルを作るのは愚です(どうしようかね)\n\t_n := 1000000\n\tg1 := make([]int, _n+1)\n\tg1[0], g1[1] = 1, 1\n\tg2 := make([]int, _n+1)\n\tg2[0], g2[1] = 1, 1\n\tinverse := make([]int, _n+1)\n\tinverse[0], inverse[1] = 0, 1\n\tfor i := 2; i <= _n; i++ {\n\t\tg1[i] = (g1[i-1] * i) % mod\n\t\tinverse[i] = mod - inverse[mod%i]*(mod/i)%mod\n\t\tg2[i] = (g2[i-1] * inverse[i]) % mod\n\t}\n\n\treturn g1[n] * (g2[r] * g2[n-r] % mod) % mod\n}\n\nfunc next_permutation(arr []int) func() []int {\n\t/*\n\t\thow to use it:\n\t\t\tthis is a generator, so should be invoked such as below example.\n\n\t\t\t\"\"\"code\"\"\"\n\t\t\tnp := next_permutation(arr)\n\t\t\tfor{\n\t\t\t\tlis := np()\n\t\t\t\tif len(lis) == 0{\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tfmt.Println(lis)\n\t\t\t}\n\t\t\t\"\"\"code end\"\"\"\n\t*/\n\tfirst := true\n\tret := append([]int{}, arr...)\n\t_next_permutation := func() []int {\n\t\tif first {\n\t\t\tfirst = false\n\t\t\treturn arr\n\t\t}\n\t\tn := len(ret)\n\t\tfor i := n - 2; i >= 0; i-- {\n\t\t\tif ret[i] < ret[i+1] {\n\t\t\t\tj := n\n\t\t\t\tfor {\n\t\t\t\t\tj -= 1\n\t\t\t\t\tif ret[i] < ret[j] {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tret[i], ret[j] = ret[j], ret[i]\n\t\t\t\tfor k := n - 1; i < k; i, k = i+1, k-1 {\n\t\t\t\t\tret[i+1], ret[k] = ret[k], ret[i+1]\n\t\t\t\t}\n\t\t\t\treturn ret\n\t\t\t}\n\t\t}\n\t\treturn []int{}\n\t}\n\treturn _next_permutation\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5750, "cpu_time_ms": 161, "memory_kb": 23168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s678089529", "group_id": "codeNet:p02732", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype combMemo map[int]int\n\nvar (\n\treadString func() string\n\tcombs = make(combMemo)\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\nfunc comb(m, n int) int {\n\tif m > n && n > 0 {\n\t\tc, ok := combs[m]\n\t\tif ok {\n\t\t\treturn c\n\t\t}\n\t\tcombs[m] = comb(m-1, n-1) + comb(m-1, n)\n\t\treturn combs[m]\n\t}\n\treturn 1\n}\n\nfunc main() {\n\tn := readInt()\n\ta_c := make(map[int]int, n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tin := readInt()\n\t\ta[i] = in\n\t\ta_c[in] = a_c[in] + 1\n\t}\n\n\tfor i := range a {\n\t\tc := 0\n\t\tfor k := range a_c {\n\t\t\tif k == a[i] {\n\t\t\t\tex := a_c[k] - 1\n\t\t\t\tif ex < 2 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tc = c + comb(ex, 2)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tin := a_c[k]\n\t\t\tif in < 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc = c + comb(in, 2)\n\t\t}\n\t\tfmt.Println(c)\n\t}\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc subL(list []int) []int {\n\tsl := make([]int, len(list)-1)\n\tfor i := range list {\n\t\tif i == len(list)-1 {\n\t\t\tcontinue\n\t\t}\n\t\tsub := list[i+1] - list[i]\n\t\tsl[i] = sub\n\t}\n\treturn sl\n}\n\nfunc Combinations(n, k int) [][]int {\n\tcombins := binomial(n, k)\n\tdata := make([][]int, combins)\n\tif len(data) == 0 {\n\t\treturn data\n\t}\n\tdata[0] = make([]int, k)\n\tfor i := range data[0] {\n\t\tdata[0][i] = i\n\t}\n\tfor i := 1; i < combins; i++ {\n\t\tnext := make([]int, k)\n\t\tcopy(next, data[i-1])\n\t\tnextCombination(next, n, k)\n\t\tdata[i] = next\n\t}\n\treturn data\n}\n\nfunc nextCombination(s []int, n, k int) {\n\tfor j := k - 1; j >= 0; j-- {\n\t\tif s[j] == n+j-k {\n\t\t\tcontinue\n\t\t}\n\t\ts[j]++\n\t\tfor l := j + 1; l < k; l++ {\n\t\t\ts[l] = s[j] + l - j\n\t\t}\n\t\tbreak\n\t}\n}\n\nfunc binomial(n, k int) int {\n\terrNegInput := \"combin: negative input\"\n\tbadSetSize := \"combin: n < k\"\n\tif n < 0 || k < 0 {\n\t\tpanic(errNegInput)\n\t}\n\tif n < k {\n\t\tpanic(badSetSize)\n\t}\n\tif k > n/2 {\n\t\tk = n - k\n\t}\n\tb := 1\n\tfor i := 1; i <= k; i++ {\n\t\tb = (n - k + i) * b / i\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1587003905, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/Go/s678089529.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s678089529", "user_id": "u183912232"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype combMemo map[int]int\n\nvar (\n\treadString func() string\n\tcombs = make(combMemo)\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\nfunc comb(m, n int) int {\n\tif m > n && n > 0 {\n\t\tc, ok := combs[m]\n\t\tif ok {\n\t\t\treturn c\n\t\t}\n\t\tcombs[m] = comb(m-1, n-1) + comb(m-1, n)\n\t\treturn combs[m]\n\t}\n\treturn 1\n}\n\nfunc main() {\n\tn := readInt()\n\ta_c := make(map[int]int, n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tin := readInt()\n\t\ta[i] = in\n\t\ta_c[in] = a_c[in] + 1\n\t}\n\n\tfor i := range a {\n\t\tc := 0\n\t\tfor k := range a_c {\n\t\t\tif k == a[i] {\n\t\t\t\tex := a_c[k] - 1\n\t\t\t\tif ex < 2 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tc = c + comb(ex, 2)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tin := a_c[k]\n\t\t\tif in < 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc = c + comb(in, 2)\n\t\t}\n\t\tfmt.Println(c)\n\t}\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc subL(list []int) []int {\n\tsl := make([]int, len(list)-1)\n\tfor i := range list {\n\t\tif i == len(list)-1 {\n\t\t\tcontinue\n\t\t}\n\t\tsub := list[i+1] - list[i]\n\t\tsl[i] = sub\n\t}\n\treturn sl\n}\n\nfunc Combinations(n, k int) [][]int {\n\tcombins := binomial(n, k)\n\tdata := make([][]int, combins)\n\tif len(data) == 0 {\n\t\treturn data\n\t}\n\tdata[0] = make([]int, k)\n\tfor i := range data[0] {\n\t\tdata[0][i] = i\n\t}\n\tfor i := 1; i < combins; i++ {\n\t\tnext := make([]int, k)\n\t\tcopy(next, data[i-1])\n\t\tnextCombination(next, n, k)\n\t\tdata[i] = next\n\t}\n\treturn data\n}\n\nfunc nextCombination(s []int, n, k int) {\n\tfor j := k - 1; j >= 0; j-- {\n\t\tif s[j] == n+j-k {\n\t\t\tcontinue\n\t\t}\n\t\ts[j]++\n\t\tfor l := j + 1; l < k; l++ {\n\t\t\ts[l] = s[j] + l - j\n\t\t}\n\t\tbreak\n\t}\n}\n\nfunc binomial(n, k int) int {\n\terrNegInput := \"combin: negative input\"\n\tbadSetSize := \"combin: n < k\"\n\tif n < 0 || k < 0 {\n\t\tpanic(errNegInput)\n\t}\n\tif n < k {\n\t\tpanic(badSetSize)\n\t}\n\tif k > n/2 {\n\t\tk = n - k\n\t}\n\tb := 1\n\tfor i := 1; i <= k; i++ {\n\t\tb = (n - k + i) * b / i\n\t}\n\treturn b\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2537, "cpu_time_ms": 2108, "memory_kb": 39424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s231197426", "group_id": "codeNet:p02732", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar isProduct = false\n\nvar memo = map[int]int{}\n\nfunc getTotal(t int) int {\n\n\tif t < 2 {\n\t\treturn 0\n\t}\n\tif t == 2 {\n\t\treturn 1\n\t}\n\n\tif _, ok := memo[t]; !ok {\n\t\tmemo[t] = getTotal(t-1) * (t / (t - 2))\n\t}\n\n\treturn memo[t]\n}\n\nfunc main() {\n\tnextReader = newScanner()\n\n\tN := nextInt()\n\tA := nextInts(N)\n\n\td := map[int]int{}\n\n\tfor _, a := range A {\n\t\td[a]++\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\ts := A[i]\n\t\tt := 0\n\n\t\tfor key, count := range d {\n\t\t\tif key == s {\n\t\t\t\tc := count - 1\n\t\t\t\tif c < 1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt += getTotal(c)\n\t\t\t} else {\n\t\t\t\tt += getTotal(count)\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(t)\n\t}\n\n}\n\n/* --------------------------------------------------------------------------\n * sort\n * ------------------------------------------------------------------------- */\n\n// type S struct {\n// sort int\n// }\n// type Sorter []S\n\n// func (a Sorter) Len() int { return len(a) }\n// func (a Sorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n// func (a Sorter) Less(i, j int) bool { return a[i].sort < a[j].sort }\n\n// type Sorter []Sortable\n\n// func (a Sorter) Len() int { return len(a) }\n// func (a Sorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n// func (a Sorter) Less(i, j int) bool { return a[i].Axis < a[j].Axis }\n\n/* --------------------------------------------------------------------------\n * math\n * ------------------------------------------------------------------------- */\nfunc lcm(x, y int) int {\n\treturn x * y / gcd(x, y)\n}\n\nfunc gcd(x, y int) int {\n\ttmp := x % y\n\tif tmp > 0 {\n\t\treturn gcd(y, tmp)\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc abs(i int) int {\n\treturn int(math.Abs(float64(i)))\n}\n\n//prime\ntype PrimeGenerator struct {\n\tNext func() uint32\n}\n\nfunc NewPrimeGenerator() *PrimeGenerator {\n\tprimeGenerator := PrimeGenerator{}\n\n\tmultiples := map[uint32]uint32{}\n\tvar num uint32\n\tvar d uint32 // ←ココ\n\tprimeGenerator.Next = func() uint32 {\n\t\tif num == 0 {\n\t\t\tnum = 1\n\t\t\treturn 2\n\t\t}\n\t\tif d == 0 { // ←ココ\n\t\t\td = 4\n\t\t\treturn 3\n\t\t}\n\n\t\tfor {\n\t\t\tnum += d\n\t\t\td = 6 - d\n\t\t\tvar k uint32 = 2 // ←ココ\n\n\t\t\tfactor, hasFactor := multiples[num]\n\t\t\tif hasFactor {\n\t\t\t\tdelete(multiples, num)\n\t\t\t\t// ↓ココ\n\t\t\t\tif (num+factor)%3 == 0 {\n\t\t\t\t\tk = 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfactor = num\n\t\t\t}\n\n\t\t\t// ↓ココ\n\t\t\tfor newNum := num + (factor << k); ; newNum += factor << k {\n\t\t\t\t_, hasNewFactor := multiples[newNum]\n\t\t\t\tif !hasNewFactor {\n\t\t\t\t\tmultiples[newNum] = factor\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tk ^= 3 // ←ココ\n\t\t\t}\n\n\t\t\tif !hasFactor {\n\t\t\t\treturn num\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &primeGenerator\n}\n\n/* --------------------------------------------------------------------------\n * debug\n * ------------------------------------------------------------------------- */\nfunc debugln(s ...interface{}) {\n\tif !isProduct {\n\t\tfmt.Println(s...)\n\t}\n}\n\nfunc debug(s ...interface{}) {\n\tif !isProduct {\n\t\tfmt.Print(s...)\n\t}\n}\nfunc debugf(f string, s ...interface{}) {\n\tif !isProduct {\n\t\tfmt.Printf(f, s...)\n\t}\n}\n\n/* --------------------------------------------------------------------------\n * std.io\n * ------------------------------------------------------------------------- */\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextInt64s(n int) []int64 {\n\tr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt64()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\n/* --------------------------------------------------------------------------\n * memo\n * ------------------------------------------------------------------------- */\n", "language": "Go", "metadata": {"date": 1584930986, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/Go/s231197426.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s231197426", "user_id": "u867254940"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar isProduct = false\n\nvar memo = map[int]int{}\n\nfunc getTotal(t int) int {\n\n\tif t < 2 {\n\t\treturn 0\n\t}\n\tif t == 2 {\n\t\treturn 1\n\t}\n\n\tif _, ok := memo[t]; !ok {\n\t\tmemo[t] = getTotal(t-1) * (t / (t - 2))\n\t}\n\n\treturn memo[t]\n}\n\nfunc main() {\n\tnextReader = newScanner()\n\n\tN := nextInt()\n\tA := nextInts(N)\n\n\td := map[int]int{}\n\n\tfor _, a := range A {\n\t\td[a]++\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\ts := A[i]\n\t\tt := 0\n\n\t\tfor key, count := range d {\n\t\t\tif key == s {\n\t\t\t\tc := count - 1\n\t\t\t\tif c < 1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt += getTotal(c)\n\t\t\t} else {\n\t\t\t\tt += getTotal(count)\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(t)\n\t}\n\n}\n\n/* --------------------------------------------------------------------------\n * sort\n * ------------------------------------------------------------------------- */\n\n// type S struct {\n// sort int\n// }\n// type Sorter []S\n\n// func (a Sorter) Len() int { return len(a) }\n// func (a Sorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n// func (a Sorter) Less(i, j int) bool { return a[i].sort < a[j].sort }\n\n// type Sorter []Sortable\n\n// func (a Sorter) Len() int { return len(a) }\n// func (a Sorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n// func (a Sorter) Less(i, j int) bool { return a[i].Axis < a[j].Axis }\n\n/* --------------------------------------------------------------------------\n * math\n * ------------------------------------------------------------------------- */\nfunc lcm(x, y int) int {\n\treturn x * y / gcd(x, y)\n}\n\nfunc gcd(x, y int) int {\n\ttmp := x % y\n\tif tmp > 0 {\n\t\treturn gcd(y, tmp)\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc abs(i int) int {\n\treturn int(math.Abs(float64(i)))\n}\n\n//prime\ntype PrimeGenerator struct {\n\tNext func() uint32\n}\n\nfunc NewPrimeGenerator() *PrimeGenerator {\n\tprimeGenerator := PrimeGenerator{}\n\n\tmultiples := map[uint32]uint32{}\n\tvar num uint32\n\tvar d uint32 // ←ココ\n\tprimeGenerator.Next = func() uint32 {\n\t\tif num == 0 {\n\t\t\tnum = 1\n\t\t\treturn 2\n\t\t}\n\t\tif d == 0 { // ←ココ\n\t\t\td = 4\n\t\t\treturn 3\n\t\t}\n\n\t\tfor {\n\t\t\tnum += d\n\t\t\td = 6 - d\n\t\t\tvar k uint32 = 2 // ←ココ\n\n\t\t\tfactor, hasFactor := multiples[num]\n\t\t\tif hasFactor {\n\t\t\t\tdelete(multiples, num)\n\t\t\t\t// ↓ココ\n\t\t\t\tif (num+factor)%3 == 0 {\n\t\t\t\t\tk = 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfactor = num\n\t\t\t}\n\n\t\t\t// ↓ココ\n\t\t\tfor newNum := num + (factor << k); ; newNum += factor << k {\n\t\t\t\t_, hasNewFactor := multiples[newNum]\n\t\t\t\tif !hasNewFactor {\n\t\t\t\t\tmultiples[newNum] = factor\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tk ^= 3 // ←ココ\n\t\t\t}\n\n\t\t\tif !hasFactor {\n\t\t\t\treturn num\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &primeGenerator\n}\n\n/* --------------------------------------------------------------------------\n * debug\n * ------------------------------------------------------------------------- */\nfunc debugln(s ...interface{}) {\n\tif !isProduct {\n\t\tfmt.Println(s...)\n\t}\n}\n\nfunc debug(s ...interface{}) {\n\tif !isProduct {\n\t\tfmt.Print(s...)\n\t}\n}\nfunc debugf(f string, s ...interface{}) {\n\tif !isProduct {\n\t\tfmt.Printf(f, s...)\n\t}\n}\n\n/* --------------------------------------------------------------------------\n * std.io\n * ------------------------------------------------------------------------- */\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextInt64s(n int) []int64 {\n\tr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt64()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\n/* --------------------------------------------------------------------------\n * memo\n * ------------------------------------------------------------------------- */\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4151, "cpu_time_ms": 2108, "memory_kb": 34944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s493024369", "group_id": "codeNet:p02732", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc main() {\n\tN := nextInt()\n\tA := nextInts(N)\n\tcmb := NewCombination()\n\tcmb.build()\n\tcnt := map[int]int{}\n\tans := make([]int, N)\n\tfor _, a := range A {\n\t\tcnt[a]++\n\t}\n\tfor k := 0; k < N; k++ {\n\t\tcnt[A[k]] -= 1\n\t\tfor _, v := range cnt {\n\t\t\tans[k] += cmb.c(v, 2)\n\t\t}\n\t\tcnt[A[k]] += 1\n\t}\n\tfor k := 0; k < N; k++ {\n\t\tfmt.Println(ans[k])\n\t}\n}\n\ntype Combination struct {\n\tmax, mod int\n\tfact []int\n\tfactInv []int\n\tinv []int\n}\n\nfunc NewCombination() *Combination {\n\tc := &Combination{}\n\tc.max = 21000\n\tc.mod = 2147483647\n\tc.fact = make([]int, c.max)\n\tc.factInv = make([]int, c.max)\n\tc.inv = make([]int, c.max)\n\treturn c\n}\n\nfunc (c *Combination) build() {\n\tc.inv[1], c.fact[0], c.factInv[0] = 1, 1, 1\n\tvar i int\n\tfor i = 2; i < c.max; i++ {\n\t\tc.inv[i] = c.inv[c.mod%i] * (c.mod - c.mod/i) % c.mod\n\t}\n\tfor i = 1; i < c.max; i++ {\n\t\tc.fact[i] = c.fact[i-1] * i % c.mod\n\t\tc.factInv[i] = c.factInv[i-1] * c.inv[i] % c.mod\n\t}\n}\n\nfunc (c *Combination) c(n, k int) int {\n\tif n < 0 || k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn c.fact[n] * c.factInv[k] % c.mod * c.factInv[n-k] % c.mod\n}\n\nfunc (c *Combination) p(n, k int) int {\n\tif k < 0 || k > n {\n\t\treturn 0\n\t}\n\treturn c.fact[n] * c.factInv[n-k] % c.mod\n}\n\nfunc (c *Combination) h(n, k int) int {\n\tif n == 0 && k == 0 {\n\t\treturn 1\n\t}\n\treturn c.c(n+k-1, k)\n}\n\n// c:N 個の整数の中から,相異なる K 個の整数を選ぶパターンの数C(N,K)\n// p:N 個の整数の中から,相異なる K 個の整数を選び,順番に並べるパターンの数P(N,K)\n// h:N 個の整数の中から,重複を許して K 個の整数を選ぶパターンの数H(N,K)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1584929724, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/Go/s493024369.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s493024369", "user_id": "u696272993"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc main() {\n\tN := nextInt()\n\tA := nextInts(N)\n\tcmb := NewCombination()\n\tcmb.build()\n\tcnt := map[int]int{}\n\tans := make([]int, N)\n\tfor _, a := range A {\n\t\tcnt[a]++\n\t}\n\tfor k := 0; k < N; k++ {\n\t\tcnt[A[k]] -= 1\n\t\tfor _, v := range cnt {\n\t\t\tans[k] += cmb.c(v, 2)\n\t\t}\n\t\tcnt[A[k]] += 1\n\t}\n\tfor k := 0; k < N; k++ {\n\t\tfmt.Println(ans[k])\n\t}\n}\n\ntype Combination struct {\n\tmax, mod int\n\tfact []int\n\tfactInv []int\n\tinv []int\n}\n\nfunc NewCombination() *Combination {\n\tc := &Combination{}\n\tc.max = 21000\n\tc.mod = 2147483647\n\tc.fact = make([]int, c.max)\n\tc.factInv = make([]int, c.max)\n\tc.inv = make([]int, c.max)\n\treturn c\n}\n\nfunc (c *Combination) build() {\n\tc.inv[1], c.fact[0], c.factInv[0] = 1, 1, 1\n\tvar i int\n\tfor i = 2; i < c.max; i++ {\n\t\tc.inv[i] = c.inv[c.mod%i] * (c.mod - c.mod/i) % c.mod\n\t}\n\tfor i = 1; i < c.max; i++ {\n\t\tc.fact[i] = c.fact[i-1] * i % c.mod\n\t\tc.factInv[i] = c.factInv[i-1] * c.inv[i] % c.mod\n\t}\n}\n\nfunc (c *Combination) c(n, k int) int {\n\tif n < 0 || k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn c.fact[n] * c.factInv[k] % c.mod * c.factInv[n-k] % c.mod\n}\n\nfunc (c *Combination) p(n, k int) int {\n\tif k < 0 || k > n {\n\t\treturn 0\n\t}\n\treturn c.fact[n] * c.factInv[n-k] % c.mod\n}\n\nfunc (c *Combination) h(n, k int) int {\n\tif n == 0 && k == 0 {\n\t\treturn 1\n\t}\n\treturn c.c(n+k-1, k)\n}\n\n// c:N 個の整数の中から,相異なる K 個の整数を選ぶパターンの数C(N,K)\n// p:N 個の整数の中から,相異なる K 個の整数を選び,順番に並べるパターンの数P(N,K)\n// h:N 個の整数の中から,重複を許して K 個の整数を選ぶパターンの数H(N,K)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3089, "cpu_time_ms": 2108, "memory_kb": 17172}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s715252554", "group_id": "codeNet:p02732", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tcount := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\tcount[a[i]]++\n\t}\n\n\tcombs := make(map[int]int)\n\tsum := 0\n\tfor k, v := range count {\n\t\tcomb := v * (v - 1) / 2\n\t\tcombs[k] = comb\n\t\tsum += comb\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tans := sum - combs[a[i]]\n\t\tc := count[a[i]] - 1\n\t\tans += c * (c - 1) / 2\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584927369, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/Go/s715252554.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s715252554", "user_id": "u275316733"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tcount := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\tcount[a[i]]++\n\t}\n\n\tcombs := make(map[int]int)\n\tsum := 0\n\tfor k, v := range count {\n\t\tcomb := v * (v - 1) / 2\n\t\tcombs[k] = comb\n\t\tsum += comb\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tans := sum - combs[a[i]]\n\t\tc := count[a[i]] - 1\n\t\tans += c * (c - 1) / 2\n\t\tfmt.Println(ans)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 992, "cpu_time_ms": 548, "memory_kb": 23040}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s030469383", "group_id": "codeNet:p02741", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k int\n array := [...]int{1, 1, 1, 2, 1, 2, 1, 5,\n 2, 2, 1, 5, 1, 2, 1, 14,\n 1, 5, 1, 5, 2, 2, 1, 15,\n 2, 2, 5, 4, 1, 4, 1, 51}\n fmt.Scan(&k)\n \n fmt.Println(array[k-1])\n}", "language": "Go", "metadata": {"date": 1585191106, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02741.html", "problem_id": "p02741", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02741/input.txt", "sample_output_relpath": "derived/input_output/data/p02741/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02741/Go/s030469383.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s030469383", "user_id": "u610801172"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k int\n array := [...]int{1, 1, 1, 2, 1, 2, 1, 5,\n 2, 2, 1, 5, 1, 2, 1, 14,\n 1, 5, 1, 5, 2, 2, 1, 15,\n 2, 2, 5, 4, 1, 4, 1, 51}\n fmt.Scan(&k)\n \n fmt.Println(array[k-1])\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "sample_input": "6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02741", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 275, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992912084", "group_id": "codeNet:p02742", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar H, W int\n\tvar area int\n\tvar ans int\n\n\tfmt.Scanf(\"%d %d\", &H, &W)\n\tarea = H * W\n\tif area%2 == 1 {\n\t\tans = area/2 + 1\n\t} else if area%2 == 0 {\n\t\tans = area / 2\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1584235077, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02742.html", "problem_id": "p02742", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02742/input.txt", "sample_output_relpath": "derived/input_output/data/p02742/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02742/Go/s992912084.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s992912084", "user_id": "u831067059"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar H, W int\n\tvar area int\n\tvar ans int\n\n\tfmt.Scanf(\"%d %d\", &H, &W)\n\tarea = H * W\n\tif area%2 == 1 {\n\t\tans = area/2 + 1\n\t} else if area%2 == 0 {\n\t\tans = area / 2\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "sample_input": "4 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02742", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 233, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s515187887", "group_id": "codeNet:p02742", "input_text": "package main\n\nimport \"fmt\"\n\nvar (\n\tH int\n\tW int\n)\n\nfunc main() {\n\tfmt.Scanln(&H, &W)\n\tmulti := H * W\n\tresult := 0\n\tif multi%2 == 0 {\n\t\tresult = multi / 2\n\t} else {\n\t\tresult = (multi / 2) + 1\n\t}\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1584234844, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02742.html", "problem_id": "p02742", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02742/input.txt", "sample_output_relpath": "derived/input_output/data/p02742/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02742/Go/s515187887.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s515187887", "user_id": "u891051541"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar (\n\tH int\n\tW int\n)\n\nfunc main() {\n\tfmt.Scanln(&H, &W)\n\tmulti := H * W\n\tresult := 0\n\tif multi%2 == 0 {\n\t\tresult = multi / 2\n\t} else {\n\t\tresult = (multi / 2) + 1\n\t}\n\tfmt.Println(result)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "sample_input": "4 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02742", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 217, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s302033305", "group_id": "codeNet:p02742", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nconst (\n\tmaxBufSize = 1024 * 1024\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, 1)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc solve(h int64, w int64) int64 {\n\treturn ((w + 1)/ 2) * ((h + 1) / 2) + (w /2 ) * (h / 2)\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\th := nextInt()\n\tw := nextInt()\n\tres := solve(h, w)\n\tfmt.Fprintln(out, res)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn []byte(sc.Text())\n}\n\nfunc nextInt() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int64) []int64 {\n\tret := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextFloats(n int64) []float64 {\n\tret := make([]float64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextFloat()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int64) []string {\n\tret := make([]string, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n}\n\n// mapからkeysとvaluesを返す\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1584234459, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02742.html", "problem_id": "p02742", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02742/input.txt", "sample_output_relpath": "derived/input_output/data/p02742/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02742/Go/s302033305.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s302033305", "user_id": "u478530879"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nconst (\n\tmaxBufSize = 1024 * 1024\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, 1)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc solve(h int64, w int64) int64 {\n\treturn ((w + 1)/ 2) * ((h + 1) / 2) + (w /2 ) * (h / 2)\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\th := nextInt()\n\tw := nextInt()\n\tres := solve(h, w)\n\tfmt.Fprintln(out, res)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn []byte(sc.Text())\n}\n\nfunc nextInt() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int64) []int64 {\n\tret := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextFloats(n int64) []float64 {\n\tret := make([]float64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextFloat()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int64) []string {\n\tret := make([]string, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n}\n\n// mapからkeysとvaluesを返す\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n\treturn\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "sample_input": "4 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02742", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2055, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s554643907", "group_id": "codeNet:p02744", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar n int\n\nfunc dfs(s []byte, x, kind int) {\n\tif x == n {\n\t\tputf(\"%s\\n\", string(s))\n\t\treturn\n\t}\n\tfor i := 0; i < kind; i++ {\n\t\ts[x] = byte('a' + i)\n\t\tif i < kind-1 {\n\t\t\tdfs(s, x+1, kind)\n\t\t} else {\n\t\t\tdfs(s, x+1, kind+1)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn = nextInt()\n\n\tdfs(make([]byte, n), 0, 1)\n}\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "language": "Go", "metadata": {"date": 1584240867, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02744.html", "problem_id": "p02744", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02744/input.txt", "sample_output_relpath": "derived/input_output/data/p02744/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02744/Go/s554643907.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s554643907", "user_id": "u502813058"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar n int\n\nfunc dfs(s []byte, x, kind int) {\n\tif x == n {\n\t\tputf(\"%s\\n\", string(s))\n\t\treturn\n\t}\n\tfor i := 0; i < kind; i++ {\n\t\ts[x] = byte('a' + i)\n\t\tif i < kind-1 {\n\t\t\tdfs(s, x+1, kind)\n\t\t} else {\n\t\t\tdfs(s, x+1, kind+1)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn = nextInt()\n\n\tdfs(make([]byte, n), 0, 1)\n}\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn this problem, we only consider strings consisting of lowercase English letters.\n\nStrings s and t are said to be isomorphic when the following conditions are satisfied:\n\n|s| = |t| holds.\n\nFor every pair i, j, one of the following holds:\n\ns_i = s_j and t_i = t_j.\n\ns_i \\neq s_j and t_i \\neq t_j.\n\nFor example, abcac and zyxzx are isomorphic, while abcac and ppppp are not.\n\nA string s is said to be in normal form when the following condition is satisfied:\n\nFor every string t that is isomorphic to s, s \\leq t holds. Here \\leq denotes lexicographic comparison.\n\nFor example, abcac is in normal form, but zyxzx is not since it is isomorphic to abcac, which is lexicographically smaller than zyxzx.\n\nYou are given an integer N.\nPrint all strings of length N that are in normal form, in lexicographically ascending order.\n\nConstraints\n\n1 \\leq N \\leq 10\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nAssume that there are K strings of length N that are in normal form: w_1, \\ldots, w_K in lexicographical order.\nOutput should be in the following format:\n\nw_1\n:\nw_K\n\nSample Input 1\n\n1\n\nSample Output 1\n\na\n\nSample Input 2\n\n2\n\nSample Output 2\n\naa\nab", "sample_input": "1\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02744", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn this problem, we only consider strings consisting of lowercase English letters.\n\nStrings s and t are said to be isomorphic when the following conditions are satisfied:\n\n|s| = |t| holds.\n\nFor every pair i, j, one of the following holds:\n\ns_i = s_j and t_i = t_j.\n\ns_i \\neq s_j and t_i \\neq t_j.\n\nFor example, abcac and zyxzx are isomorphic, while abcac and ppppp are not.\n\nA string s is said to be in normal form when the following condition is satisfied:\n\nFor every string t that is isomorphic to s, s \\leq t holds. Here \\leq denotes lexicographic comparison.\n\nFor example, abcac is in normal form, but zyxzx is not since it is isomorphic to abcac, which is lexicographically smaller than zyxzx.\n\nYou are given an integer N.\nPrint all strings of length N that are in normal form, in lexicographically ascending order.\n\nConstraints\n\n1 \\leq N \\leq 10\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nAssume that there are K strings of length N that are in normal form: w_1, \\ldots, w_K in lexicographical order.\nOutput should be in the following format:\n\nw_1\n:\nw_K\n\nSample Input 1\n\n1\n\nSample Output 1\n\na\n\nSample Input 2\n\n2\n\nSample Output 2\n\naa\nab", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 840, "cpu_time_ms": 37, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s475070827", "group_id": "codeNet:p02748", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\ntype discount struct {\n\ta int\n\tb int\n\tprice int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tA, B, M := nextInt(), nextInt(), nextInt()\n\n\ta := make([]int, A)\n\tfor i := 0; i < A; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tb := make([]int, B)\n\tfor i := 0; i < B; i++ {\n\t\tb[i] = nextInt()\n\t}\n\n\tm := make([]discount, M)\n\tfor i := 0; i < M; i++ {\n\t\tm[i] = discount{nextInt(), nextInt(), nextInt()}\n\t}\n\n\tmin_a := getMin(a)\n\tmin_b := getMin(b)\n\n\tmin := min_a + min_b\n\tfor _, d := range m {\n\t\tprice := a[d.a-1] + b[d.b-1] - d.price\n\t\tif price < min {\n\t\t\tmin = price\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n\nfunc getMin(x []int) int {\n\tmin := 100000\n\tfor _, v := range x {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n", "language": "Go", "metadata": {"date": 1584249613, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02748.html", "problem_id": "p02748", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02748/input.txt", "sample_output_relpath": "derived/input_output/data/p02748/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02748/Go/s475070827.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s475070827", "user_id": "u309370374"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\ntype discount struct {\n\ta int\n\tb int\n\tprice int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tA, B, M := nextInt(), nextInt(), nextInt()\n\n\ta := make([]int, A)\n\tfor i := 0; i < A; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tb := make([]int, B)\n\tfor i := 0; i < B; i++ {\n\t\tb[i] = nextInt()\n\t}\n\n\tm := make([]discount, M)\n\tfor i := 0; i < M; i++ {\n\t\tm[i] = discount{nextInt(), nextInt(), nextInt()}\n\t}\n\n\tmin_a := getMin(a)\n\tmin_b := getMin(b)\n\n\tmin := min_a + min_b\n\tfor _, d := range m {\n\t\tprice := a[d.a-1] + b[d.b-1] - d.price\n\t\tif price < min {\n\t\t\tmin = price\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n\nfunc getMin(x []int) int {\n\tmin := 100000\n\tfor _, v := range x {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "sample_input": "2 3 1\n3 3\n3 3 3\n1 2 1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02748", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 902, "cpu_time_ms": 89, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s228260150", "group_id": "codeNet:p02749", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\tn, _ := strconv.Atoi(stringLineScan())\n\ttree := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tt := make([]int, 0)\n\t\ttree[i] = t\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\ta, _ := strconv.Atoi(stringLineScan())\n\t\tb, _ := strconv.Atoi(stringLineScan())\n\t\ta--\n\t\tb--\n\t\ttree[a] = append(tree[a], b)\n\t\ttree[b] = append(tree[b], a)\n\t}\n\tthree := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tt := make([]int, 0)\n\t\tthree[i] = t\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tsearched := make([]bool, n)\n\t\tmatch := make([]int, 0)\n\t\tsearched, match = dfs(i, 0, tree, searched, match)\n\t\tthree[i] = match\n\t}\n\tm1 := make([]int, 0)\n\tm2 := make([]int, 0)\n\tm3 := make([]int, 0)\n\tf1, f2, f3, can := true, true, true, true\n\tfor i := 1; i <= n; i += 3 {\n\t\tm1 = append(m1, i)\n\t}\n\tfor i := 2; i <= n; i += 3 {\n\t\tm2 = append(m2, i)\n\t}\n\tfor i := 3; i <= n; i += 3 {\n\t\tm3 = append(m3, i)\n\t}\n\tl1, l2, l3 := len(m1), len(m2), len(m3)\n\ti1, i2, i3 := 0, 0, 0\n\tans := make([]int, n)\n\tans[0] = m1[i1]\n\ti1++\n\tcount := 1\n\tfor i, list := range three {\n\t\tif ans[i] == 0 {\n\t\t\tif f1 {\n\t\t\t\tans[i] = m1[i1]\n\t\t\t\ti1++\n\t\t\t\tcount++\n\t\t\t\tif i1 == l1 {\n\t\t\t\t\tf1 = false\n\t\t\t\t}\n\t\t\t} else if f2 {\n\t\t\t\tans[i] = m2[i2]\n\t\t\t\ti2++\n\t\t\t\tcount++\n\t\t\t\tif i2 == l2 {\n\t\t\t\t\tf2 = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans[i] = m3[i3]\n\t\t\t\ti3++\n\t\t\t\tcount++\n\t\t\t\tif i3 == l3 {\n\t\t\t\t\tf3 = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tz := ans[i] % 3\n\t\tfor _, v := range list {\n\t\t\tif ans[v] == 0 {\n\t\t\t\tm := 0\n\t\t\t\tif f1 && z == 0 {\n\t\t\t\t\tm = 1\n\t\t\t\t} else if f2 && z == 0 {\n\t\t\t\t\tm = 2\n\t\t\t\t} else if f1 && z == 2 {\n\t\t\t\t\tm = 1\n\t\t\t\t} else if f2 && z == 1 {\n\t\t\t\t\tm = 2\n\t\t\t\t} else if f3 {\n\t\t\t\t\tm = 3\n\t\t\t\t}\n\t\t\t\tif m == 0 {\n\t\t\t\t\tcan = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif m == 1 {\n\t\t\t\t\tans[v] = m1[i1]\n\t\t\t\t\ti1++\n\t\t\t\t\tcount++\n\t\t\t\t\tif i1 == l1 {\n\t\t\t\t\t\tf1 = false\n\t\t\t\t\t}\n\t\t\t\t} else if m == 2 {\n\t\t\t\t\tans[v] = m2[i2]\n\t\t\t\t\ti2++\n\t\t\t\t\tcount++\n\t\t\t\t\tif i2 == l2 {\n\t\t\t\t\t\tf2 = false\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans[v] = m3[i3]\n\t\t\t\t\ti3++\n\t\t\t\t\tcount++\n\t\t\t\t\tif i3 == l3 {\n\t\t\t\t\t\tf3 = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (z + ans[v])%3 != 0{\n\t\t\t\t\tcan = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif count == n {\n\t\t\tbreak\n\t\t}\n\t\tif !can {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif ans[i] == 0 {\n\t\t\tif f1 {\n\t\t\t\tans[i] = m1[i1]\n\t\t\t\ti1++\n\t\t\t\tcount++\n\t\t\t\tif i1 == l1 {\n\t\t\t\t\tf1 = false\n\t\t\t\t}\n\t\t\t} else if f2 {\n\t\t\t\tans[i] = m2[i2]\n\t\t\t\ti2++\n\t\t\t\tcount++\n\t\t\t\tif i2 == l2 {\n\t\t\t\t\tf2 = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans[i] = m3[i3]\n\t\t\t\ti3++\n\t\t\t\tcount++\n\t\t\t\tif i3 == l3 {\n\t\t\t\t\tf3 = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif can {\n\t\tfmt.Println(strings.Trim(fmt.Sprint(ans), \"[]\"))\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\nfunc dfs(init int, depth int, tree [][]int, searched []bool, match []int) ([]bool, []int) {\n\tdepth++\n\tsearched[init] = true\n\tfor _, i := range tree[init] {\n\t\tif depth == 3 && searched[i] == false {\n\t\t\tmatch = append(match, i)\n\t\t\tsearched[i] = true\n\t\t} else if searched[i] == false {\n\t\t\tsearched[i] = true\n\t\t\tsearched, match = dfs(i, depth, tree, searched, match)\n\t\t}\n\t}\n\treturn searched, match\n}\n", "language": "Go", "metadata": {"date": 1583722505, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02749.html", "problem_id": "p02749", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02749/input.txt", "sample_output_relpath": "derived/input_output/data/p02749/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02749/Go/s228260150.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s228260150", "user_id": "u843722521"}, "prompt_components": {"gold_output": "1 2 5 4 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\tn, _ := strconv.Atoi(stringLineScan())\n\ttree := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tt := make([]int, 0)\n\t\ttree[i] = t\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\ta, _ := strconv.Atoi(stringLineScan())\n\t\tb, _ := strconv.Atoi(stringLineScan())\n\t\ta--\n\t\tb--\n\t\ttree[a] = append(tree[a], b)\n\t\ttree[b] = append(tree[b], a)\n\t}\n\tthree := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tt := make([]int, 0)\n\t\tthree[i] = t\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tsearched := make([]bool, n)\n\t\tmatch := make([]int, 0)\n\t\tsearched, match = dfs(i, 0, tree, searched, match)\n\t\tthree[i] = match\n\t}\n\tm1 := make([]int, 0)\n\tm2 := make([]int, 0)\n\tm3 := make([]int, 0)\n\tf1, f2, f3, can := true, true, true, true\n\tfor i := 1; i <= n; i += 3 {\n\t\tm1 = append(m1, i)\n\t}\n\tfor i := 2; i <= n; i += 3 {\n\t\tm2 = append(m2, i)\n\t}\n\tfor i := 3; i <= n; i += 3 {\n\t\tm3 = append(m3, i)\n\t}\n\tl1, l2, l3 := len(m1), len(m2), len(m3)\n\ti1, i2, i3 := 0, 0, 0\n\tans := make([]int, n)\n\tans[0] = m1[i1]\n\ti1++\n\tcount := 1\n\tfor i, list := range three {\n\t\tif ans[i] == 0 {\n\t\t\tif f1 {\n\t\t\t\tans[i] = m1[i1]\n\t\t\t\ti1++\n\t\t\t\tcount++\n\t\t\t\tif i1 == l1 {\n\t\t\t\t\tf1 = false\n\t\t\t\t}\n\t\t\t} else if f2 {\n\t\t\t\tans[i] = m2[i2]\n\t\t\t\ti2++\n\t\t\t\tcount++\n\t\t\t\tif i2 == l2 {\n\t\t\t\t\tf2 = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans[i] = m3[i3]\n\t\t\t\ti3++\n\t\t\t\tcount++\n\t\t\t\tif i3 == l3 {\n\t\t\t\t\tf3 = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tz := ans[i] % 3\n\t\tfor _, v := range list {\n\t\t\tif ans[v] == 0 {\n\t\t\t\tm := 0\n\t\t\t\tif f1 && z == 0 {\n\t\t\t\t\tm = 1\n\t\t\t\t} else if f2 && z == 0 {\n\t\t\t\t\tm = 2\n\t\t\t\t} else if f1 && z == 2 {\n\t\t\t\t\tm = 1\n\t\t\t\t} else if f2 && z == 1 {\n\t\t\t\t\tm = 2\n\t\t\t\t} else if f3 {\n\t\t\t\t\tm = 3\n\t\t\t\t}\n\t\t\t\tif m == 0 {\n\t\t\t\t\tcan = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif m == 1 {\n\t\t\t\t\tans[v] = m1[i1]\n\t\t\t\t\ti1++\n\t\t\t\t\tcount++\n\t\t\t\t\tif i1 == l1 {\n\t\t\t\t\t\tf1 = false\n\t\t\t\t\t}\n\t\t\t\t} else if m == 2 {\n\t\t\t\t\tans[v] = m2[i2]\n\t\t\t\t\ti2++\n\t\t\t\t\tcount++\n\t\t\t\t\tif i2 == l2 {\n\t\t\t\t\t\tf2 = false\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans[v] = m3[i3]\n\t\t\t\t\ti3++\n\t\t\t\t\tcount++\n\t\t\t\t\tif i3 == l3 {\n\t\t\t\t\t\tf3 = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (z + ans[v])%3 != 0{\n\t\t\t\t\tcan = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif count == n {\n\t\t\tbreak\n\t\t}\n\t\tif !can {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif ans[i] == 0 {\n\t\t\tif f1 {\n\t\t\t\tans[i] = m1[i1]\n\t\t\t\ti1++\n\t\t\t\tcount++\n\t\t\t\tif i1 == l1 {\n\t\t\t\t\tf1 = false\n\t\t\t\t}\n\t\t\t} else if f2 {\n\t\t\t\tans[i] = m2[i2]\n\t\t\t\ti2++\n\t\t\t\tcount++\n\t\t\t\tif i2 == l2 {\n\t\t\t\t\tf2 = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans[i] = m3[i3]\n\t\t\t\ti3++\n\t\t\t\tcount++\n\t\t\t\tif i3 == l3 {\n\t\t\t\t\tf3 = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif can {\n\t\tfmt.Println(strings.Trim(fmt.Sprint(ans), \"[]\"))\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\nfunc dfs(init int, depth int, tree [][]int, searched []bool, match []int) ([]bool, []int) {\n\tdepth++\n\tsearched[init] = true\n\tfor _, i := range tree[init] {\n\t\tif depth == 3 && searched[i] == false {\n\t\t\tmatch = append(match, i)\n\t\t\tsearched[i] = true\n\t\t} else if searched[i] == false {\n\t\t\tsearched[i] = true\n\t\t\tsearched, match = dfs(i, depth, tree, searched, match)\n\t\t}\n\t}\n\treturn searched, match\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The vertices are numbered 1 to N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nTakahashi loves the number 3. He is seeking a permutation p_1, p_2, \\ldots , p_N of integers from 1 to N satisfying the following condition:\n\nFor every pair of vertices (i, j), if the distance between Vertex i and Vertex j is 3, the sum or product of p_i and p_j is a multiple of 3.\n\nHere the distance between Vertex i and Vertex j is the number of edges contained in the shortest path from Vertex i to Vertex j.\n\nHelp Takahashi by finding a permutation that satisfies the condition.\n\nConstraints\n\n2\\leq N\\leq 2\\times 10^5\n\n1\\leq a_i, b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nIf no permutation satisfies the condition, print -1.\n\nOtherwise, print a permutation satisfying the condition, with space in between.\nIf there are multiple solutions, you can print any of them.\n\nSample Input 1\n\n5\n1 2\n1 3\n3 4\n3 5\n\nSample Output 1\n\n1 2 5 4 3\n\nThe distance between two vertices is 3 for the two pairs (2, 4) and (2, 5).\n\np_2 + p_4 = 6\n\np_2\\times p_5 = 6\n\nThus, this permutation satisfies the condition.", "sample_input": "5\n1 2\n1 3\n3 4\n3 5\n"}, "reference_outputs": ["1 2 5 4 3\n"], "source_document_id": "p02749", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The vertices are numbered 1 to N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nTakahashi loves the number 3. He is seeking a permutation p_1, p_2, \\ldots , p_N of integers from 1 to N satisfying the following condition:\n\nFor every pair of vertices (i, j), if the distance between Vertex i and Vertex j is 3, the sum or product of p_i and p_j is a multiple of 3.\n\nHere the distance between Vertex i and Vertex j is the number of edges contained in the shortest path from Vertex i to Vertex j.\n\nHelp Takahashi by finding a permutation that satisfies the condition.\n\nConstraints\n\n2\\leq N\\leq 2\\times 10^5\n\n1\\leq a_i, b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nIf no permutation satisfies the condition, print -1.\n\nOtherwise, print a permutation satisfying the condition, with space in between.\nIf there are multiple solutions, you can print any of them.\n\nSample Input 1\n\n5\n1 2\n1 3\n3 4\n3 5\n\nSample Output 1\n\n1 2 5 4 3\n\nThe distance between two vertices is 3 for the two pairs (2, 4) and (2, 5).\n\np_2 + p_4 = 6\n\np_2\\times p_5 = 6\n\nThus, this permutation satisfies the condition.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3173, "cpu_time_ms": 2145, "memory_kb": 626028}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s904846092", "group_id": "codeNet:p02753", "input_text": "package main\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if s == \"AAA\" || s == \"BBB\" {\n fmt.Println(\"No\")\n } else {\n fmt.Println(\"Yes\")\n }\n}", "language": "Go", "metadata": {"date": 1583633093, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02753.html", "problem_id": "p02753", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02753/input.txt", "sample_output_relpath": "derived/input_output/data/p02753/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02753/Go/s904846092.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s904846092", "user_id": "u952288497"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if s == \"AAA\" || s == \"BBB\" {\n fmt.Println(\"No\")\n } else {\n fmt.Println(\"Yes\")\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "sample_input": "ABA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02753", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 194, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s086794068", "group_id": "codeNet:p02753", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tS := sc.nextStr()\n\tif S[0] == S[1] && S[1] == S[2] {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583632951, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02753.html", "problem_id": "p02753", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02753/input.txt", "sample_output_relpath": "derived/input_output/data/p02753/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02753/Go/s086794068.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s086794068", "user_id": "u924691798"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tS := sc.nextStr()\n\tif S[0] == S[1] && S[1] == S[2] {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "sample_input": "ABA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02753", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2052, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s730752010", "group_id": "codeNet:p02754", "input_text": "package main \nimport (\"fmt\")\n\nfunc main(){\n\n var a int;\n var b int;\n var c int;\n \n var ret int;\n \n var fl int;\n \n fmt.Scanf(\"%d %d %d\", &a, &b, &c );\n \n for; fl <=a ;{\n for i :=0; i 0 {\n\t\t\t\tb++\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\n\tif int(float64(b)*8.0/100.0) != int(A) {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\n\tfmt.Printf(\"%d\", b)\n\treturn\n}\n\nfunc minf(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc mini(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc paw(f float64, num int) float64 {\n\tvar result float64\n\tfor i := 0; num > i; i++ {\n\t\tresult *= result\n\t}\n\treturn result\n}\n\n//StrStdin Read standard input data\nfunc StrStdin(line int) [][]string {\n\tvar stringInput [][]string\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < line; i++ {\n\t\tscanner.Scan()\n\t\tif s := scanner.Text(); s != \"\" {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((scanner.Text())), \" \"))\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn stringInput\n}\n\n//rLine Read standard input data\nfunc rLine(line int) [][]string {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar stringInput [][]string\n\n\tfor i := 0; i < line; {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((string(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn stringInput\n}\n\nfunc irLine(i int) [][]int {\n\treturn alitoas(rLine(i))\n}\n\n//itoa converts string to integer\nfunc itoa(s string) int {\n\tvar i, _ = strconv.Atoi(s)\n\treturn i\n}\n\nfunc itoas(S []string) []int {\n\tvar result = make([]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoa(s)\n\t}\n\treturn result\n}\n\nfunc alitoas(S [][]string) [][]int {\n\tvar result = make([][]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoas(s)\n\t}\n\treturn result\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd3(a, b, c int) int {\n\treturn gcd(gcd(a, b), c)\n}\n", "language": "Go", "metadata": {"date": 1586894474, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02755.html", "problem_id": "p02755", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02755/input.txt", "sample_output_relpath": "derived/input_output/data/p02755/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02755/Go/s825436705.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s825436705", "user_id": "u051492823"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar input = irLine(1)\n\tvar A, B = float64(input[0][0]), float64(input[0][1])\n\n\tvar a int = int(A / 8.00 * 100.00)\n\n\t// fmt.Printf(\"A:%f B:%f a:%d\\n\", A, B, a)\n\n\tvar b int = a\n\n\tfor i := 0; ; b-- {\n\t\tif int(float64(b)/100.0*10.0) < int(B) {\n\t\t\tif i > 0 {\n\t\t\t\tb++\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\n\tif int(float64(b)*8.0/100.0) != int(A) {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\n\tfmt.Printf(\"%d\", b)\n\treturn\n}\n\nfunc minf(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc mini(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc paw(f float64, num int) float64 {\n\tvar result float64\n\tfor i := 0; num > i; i++ {\n\t\tresult *= result\n\t}\n\treturn result\n}\n\n//StrStdin Read standard input data\nfunc StrStdin(line int) [][]string {\n\tvar stringInput [][]string\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < line; i++ {\n\t\tscanner.Scan()\n\t\tif s := scanner.Text(); s != \"\" {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((scanner.Text())), \" \"))\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn stringInput\n}\n\n//rLine Read standard input data\nfunc rLine(line int) [][]string {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar stringInput [][]string\n\n\tfor i := 0; i < line; {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((string(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn stringInput\n}\n\nfunc irLine(i int) [][]int {\n\treturn alitoas(rLine(i))\n}\n\n//itoa converts string to integer\nfunc itoa(s string) int {\n\tvar i, _ = strconv.Atoi(s)\n\treturn i\n}\n\nfunc itoas(S []string) []int {\n\tvar result = make([]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoa(s)\n\t}\n\treturn result\n}\n\nfunc alitoas(S [][]string) [][]int {\n\tvar result = make([][]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoas(s)\n\t}\n\treturn result\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd3(a, b, c int) int {\n\treturn gcd(gcd(a, b), c)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "sample_input": "2 2\n"}, "reference_outputs": ["25\n"], "source_document_id": "p02755", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2125, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s355369210", "group_id": "codeNet:p02755", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\n\n\tfor ans := 1; ans <= 10000; ans++ {\n\t\tif (ans*108-((ans*108)%100)-ans*100 == A*100) && (ans*110-((ans*110)%100)-ans*100 == B*100) {\n\t\t\tfmt.Println(ans)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n", "language": "Go", "metadata": {"date": 1584539729, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02755.html", "problem_id": "p02755", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02755/input.txt", "sample_output_relpath": "derived/input_output/data/p02755/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02755/Go/s355369210.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s355369210", "user_id": "u498467508"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\n\n\tfor ans := 1; ans <= 10000; ans++ {\n\t\tif (ans*108-((ans*108)%100)-ans*100 == A*100) && (ans*110-((ans*110)%100)-ans*100 == B*100) {\n\t\t\tfmt.Println(ans)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "sample_input": "2 2\n"}, "reference_outputs": ["25\n"], "source_document_id": "p02755", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 271, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s075369187", "group_id": "codeNet:p02755", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\ta, _ := strconv.Atoi(stringLineScan())\n\tb, _ := strconv.Atoi(stringLineScan())\n\tans := -1\n\tfor i := 1; i <= 100000; i++ {\n\t\tx := i * 8 / 100\n\t\ty := i * 10 / 100\n\t\tif x == a && y == b {\n\t\t\tans = i\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1583634016, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02755.html", "problem_id": "p02755", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02755/input.txt", "sample_output_relpath": "derived/input_output/data/p02755/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02755/Go/s075369187.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s075369187", "user_id": "u843722521"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\ta, _ := strconv.Atoi(stringLineScan())\n\tb, _ := strconv.Atoi(stringLineScan())\n\tans := -1\n\tfor i := 1; i <= 100000; i++ {\n\t\tx := i * 8 / 100\n\t\ty := i * 10 / 100\n\t\tif x == a && y == b {\n\t\t\tans = i\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "sample_input": "2 2\n"}, "reference_outputs": ["25\n"], "source_document_id": "p02755", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)\n\nHere, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.\n\nIf multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print -1.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n25\n\nIf the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 25 \\times 0.08 \\rfloor = \\lfloor 2 \\rfloor = 2 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 25 \\times 0.1 \\rfloor = \\lfloor 2.5 \\rfloor = 2 yen.\n\nThus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.\n\nSample Input 2\n\n8 10\n\nSample Output 2\n\n100\n\nIf the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:\n\nWhen the consumption tax rate is 8 percent: \\lfloor 100 \\times 0.08 \\rfloor = 8 yen.\n\nWhen the consumption tax rate is 10 percent: \\lfloor 100 \\times 0.1 \\rfloor = 10 yen.\n\nSample Input 3\n\n19 99\n\nSample Output 3\n\n-1\n\nThere is no price before tax satisfying this condition, so print -1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 484, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s625476616", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\ts := next()\n\tinitS := s\n\tq := nextInt()\n\treverse := false\n\thead := make([]byte, q)\n\ttail := make([]byte, q)\n\tfor i := 0; i < q; i++ {\n\t\tquery := nextInt()\n\t\tif query == 1 {\n\t\t\treverse = !reverse\n\t\t} else {\n\t\t\tf := nextInt()\n\t\t\tc := next()\n\t\t\tif (f == 1 && !reverse) || (f == 2 && reverse) {\n\t\t\t\t// s = c + s\n\t\t\t\thead = append(head, []byte(c)...)\n\t\t\t} else {\n\t\t\t\t// s = s + c\n\t\t\t\ttail = append(tail, []byte(c)...)\n\t\t\t}\n\t\t}\n\t}\n\tif reverse {\n\t\t// s = reverseStr(s)\n\t\tswap(tail)\n\t\t// fmt.Println(s)\n\t\tfmt.Println(string(tail) + initS + string(head))\n\t} else {\n\t\tswap(head)\n\t\t// fmt.Println(s)\n\t\tfmt.Println(string(head) + initS + string(tail))\n\t}\n\n}\n\nfunc swap(arr []byte) {\n\tfor i := 0; i < len(arr)/2; i++ {\n\t\tarr[i], arr[len(arr)-1-i] = arr[len(arr)-1-i], arr[i]\n\t}\n}\n\nfunc reverseStr(s string) string {\n\trs := []rune(s)\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\trs[i], rs[j] = rs[j], rs[i]\n\t}\n\treturn string(rs)\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc max(a, b int) int {\n\treturn int(max64(int64(a), int64(b)))\n}\n\nfunc max64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\treturn int(min64(int64(a), int64(b)))\n}\n\nfunc min64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1590851799, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/Go/s625476616.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s625476616", "user_id": "u532762536"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\ts := next()\n\tinitS := s\n\tq := nextInt()\n\treverse := false\n\thead := make([]byte, q)\n\ttail := make([]byte, q)\n\tfor i := 0; i < q; i++ {\n\t\tquery := nextInt()\n\t\tif query == 1 {\n\t\t\treverse = !reverse\n\t\t} else {\n\t\t\tf := nextInt()\n\t\t\tc := next()\n\t\t\tif (f == 1 && !reverse) || (f == 2 && reverse) {\n\t\t\t\t// s = c + s\n\t\t\t\thead = append(head, []byte(c)...)\n\t\t\t} else {\n\t\t\t\t// s = s + c\n\t\t\t\ttail = append(tail, []byte(c)...)\n\t\t\t}\n\t\t}\n\t}\n\tif reverse {\n\t\t// s = reverseStr(s)\n\t\tswap(tail)\n\t\t// fmt.Println(s)\n\t\tfmt.Println(string(tail) + initS + string(head))\n\t} else {\n\t\tswap(head)\n\t\t// fmt.Println(s)\n\t\tfmt.Println(string(head) + initS + string(tail))\n\t}\n\n}\n\nfunc swap(arr []byte) {\n\tfor i := 0; i < len(arr)/2; i++ {\n\t\tarr[i], arr[len(arr)-1-i] = arr[len(arr)-1-i], arr[i]\n\t}\n}\n\nfunc reverseStr(s string) string {\n\trs := []rune(s)\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\trs[i], rs[j] = rs[j], rs[i]\n\t}\n\treturn string(rs)\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc max(a, b int) int {\n\treturn int(max64(int64(a), int64(b)))\n}\n\nfunc max64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\treturn int(min64(int64(a), int64(b)))\n}\n\nfunc min64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3132, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187827025", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tcenter := make([]string, len(S))\n\tfor i, c := range []rune(S) {\n\t\tcenter[i] = string(c)\n\t}\n\tvar Q int\n\tfmt.Scan(&Q)\n\tpre, epi := []string{\"\"}, []string{\"\"}\n\treverseCount := 0\n\tfor i := 0; i < Q; i++ {\n\t\tvar T int\n\t\tfmt.Scan(&T)\n\t\tif T == 1 {\n\t\t\tpre, epi = epi, pre\n\t\t\treverseCount += 1\n\t\t} else {\n\t\t\tvar F int\n\t\t\tvar C string\n\t\t\tfmt.Scan(&F, &C)\n\t\t\tif F == 1 {\n\t\t\t\tif reverseCount%2 == 0 {\n\t\t\t\t\tpre = append([]string{C}, pre...)\n\t\t\t\t} else {\n\t\t\t\t\tepi = append(epi, C)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif reverseCount%2 == 0 {\n\t\t\t\t\tpre = append(pre, C)\n\t\t\t\t} else {\n\t\t\t\t\tepi = append([]string{C}, epi...)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif reverseCount%2 == 1 {\n\t\t// reverseAny(pre)\n\t\t// reverseAny(center)\n\t\t// reverseAny(epi)\n\t\tpre = oldSkoolFuckinAdHocReverseForAtCoderGolangVer(pre)\n\t\tcenter = oldSkoolFuckinAdHocReverseForAtCoderGolangVer(center)\n\t\tepi = oldSkoolFuckinAdHocReverseForAtCoderGolangVer(epi)\n\t}\n\tans := \"\"\n\tfor _, p := range pre {\n\t\tans += p\n\t}\n\tfor _, c := range center {\n\t\tans += c\n\t}\n\tfor _, e := range epi {\n\t\tans += e\n\t}\n\tfmt.Println(ans)\n}\n\nfunc oldSkoolFuckinAdHocReverseForAtCoderGolangVer(arr []string) []string {\n\tret := make([]string, len(arr))\n\tfor i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {\n\t\tret[i], ret[j] = arr[j], arr[i]\n\t}\n\treturn ret\n}\n\n// func reverseAny(slice interface{}) {\n// \tn := reflect.ValueOf(slice).Len()\n// \tswap := reflect.Swapper(slice)\n// \tfor i, j := 0, n-1; i < j; i, j = i+1, j-1 {\n// \t\tswap(i, j)\n// \t}\n// }\n", "language": "Go", "metadata": {"date": 1588362744, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/Go/s187827025.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s187827025", "user_id": "u445624660"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tcenter := make([]string, len(S))\n\tfor i, c := range []rune(S) {\n\t\tcenter[i] = string(c)\n\t}\n\tvar Q int\n\tfmt.Scan(&Q)\n\tpre, epi := []string{\"\"}, []string{\"\"}\n\treverseCount := 0\n\tfor i := 0; i < Q; i++ {\n\t\tvar T int\n\t\tfmt.Scan(&T)\n\t\tif T == 1 {\n\t\t\tpre, epi = epi, pre\n\t\t\treverseCount += 1\n\t\t} else {\n\t\t\tvar F int\n\t\t\tvar C string\n\t\t\tfmt.Scan(&F, &C)\n\t\t\tif F == 1 {\n\t\t\t\tif reverseCount%2 == 0 {\n\t\t\t\t\tpre = append([]string{C}, pre...)\n\t\t\t\t} else {\n\t\t\t\t\tepi = append(epi, C)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif reverseCount%2 == 0 {\n\t\t\t\t\tpre = append(pre, C)\n\t\t\t\t} else {\n\t\t\t\t\tepi = append([]string{C}, epi...)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif reverseCount%2 == 1 {\n\t\t// reverseAny(pre)\n\t\t// reverseAny(center)\n\t\t// reverseAny(epi)\n\t\tpre = oldSkoolFuckinAdHocReverseForAtCoderGolangVer(pre)\n\t\tcenter = oldSkoolFuckinAdHocReverseForAtCoderGolangVer(center)\n\t\tepi = oldSkoolFuckinAdHocReverseForAtCoderGolangVer(epi)\n\t}\n\tans := \"\"\n\tfor _, p := range pre {\n\t\tans += p\n\t}\n\tfor _, c := range center {\n\t\tans += c\n\t}\n\tfor _, e := range epi {\n\t\tans += e\n\t}\n\tfmt.Println(ans)\n}\n\nfunc oldSkoolFuckinAdHocReverseForAtCoderGolangVer(arr []string) []string {\n\tret := make([]string, len(arr))\n\tfor i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {\n\t\tret[i], ret[j] = arr[j], arr[i]\n\t}\n\treturn ret\n}\n\n// func reverseAny(slice interface{}) {\n// \tn := reflect.ValueOf(slice).Len()\n// \tswap := reflect.Swapper(slice)\n// \tfor i, j := 0, n-1; i < j; i, j = i+1, j-1 {\n// \t\tswap(i, j)\n// \t}\n// }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1520, "cpu_time_ms": 2108, "memory_kb": 9344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s833108361", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// +=での文字列連結はパフォーマンス的にあまりよろしくないらしい\n// https://qiita.com/ruiu/items/2bb83b29baeae2433a79\n// https://qiita.com/ono_matope/items/d5e70d8a9ff2b54d5c37\n// https://drken1215.hatenablog.com/entry/2020/03/08/144800\n// いくつか別解があるらしい\nfunc main() {\n\tvar S, t, l string\n\tvar Q, rev int\n\tfmt.Scan(&S, &Q)\n\tfor i := 0; i < Q; i++ {\n\t\tvar T int\n\t\tfmt.Scan(&T)\n\t\tswitch T {\n\t\tcase 1:\n\t\t\t// 0と1を反転させる\n\t\t\trev = 1 - rev\n\t\tcase 2:\n\t\t\tvar F int\n\t\t\tvar C string\n\t\t\tfmt.Scan(&F, &C)\n\t\t\tF--\n\t\t\tif rev == 1 {\n\t\t\t\tF = 1 - F\n\t\t\t}\n\t\t\tif F == 0 {\n\t\t\t\tt = C + t\n\t\t\t} else {\n\t\t\t\tl = t + C\n\t\t\t}\n\t\t}\n\t}\n\tif rev == 1 {\n\t\tfmt.Println(Reverse(l) + Reverse(S) + Reverse(t))\n\t} else {\n\t\tfmt.Println(t + S + l)\n\t}\n}\n\nfunc Reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n", "language": "Go", "metadata": {"date": 1586591246, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/Go/s833108361.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s833108361", "user_id": "u605443479"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// +=での文字列連結はパフォーマンス的にあまりよろしくないらしい\n// https://qiita.com/ruiu/items/2bb83b29baeae2433a79\n// https://qiita.com/ono_matope/items/d5e70d8a9ff2b54d5c37\n// https://drken1215.hatenablog.com/entry/2020/03/08/144800\n// いくつか別解があるらしい\nfunc main() {\n\tvar S, t, l string\n\tvar Q, rev int\n\tfmt.Scan(&S, &Q)\n\tfor i := 0; i < Q; i++ {\n\t\tvar T int\n\t\tfmt.Scan(&T)\n\t\tswitch T {\n\t\tcase 1:\n\t\t\t// 0と1を反転させる\n\t\t\trev = 1 - rev\n\t\tcase 2:\n\t\t\tvar F int\n\t\t\tvar C string\n\t\t\tfmt.Scan(&F, &C)\n\t\t\tF--\n\t\t\tif rev == 1 {\n\t\t\t\tF = 1 - F\n\t\t\t}\n\t\t\tif F == 0 {\n\t\t\t\tt = C + t\n\t\t\t} else {\n\t\t\t\tl = t + C\n\t\t\t}\n\t\t}\n\t}\n\tif rev == 1 {\n\t\tfmt.Println(Reverse(l) + Reverse(S) + Reverse(t))\n\t} else {\n\t\tfmt.Println(t + S + l)\n\t}\n}\n\nfunc Reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 982, "cpu_time_ms": 2112, "memory_kb": 7936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s949637153", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport \"fmt\"\n\n// O(n)\nfunc reverse(s string) string {\n\tans := \"\"\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tans += string(s[i])\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar s, c string\n\tvar q, t, f int\n\tvar isReverse bool = false\n\tfmt.Scan(&s)\n\tfmt.Scan(&q)\n\tfor i := 1; i <= q; i++ {\n\t\tfmt.Scan(&t)\n\t\tswitch t {\n\t\tcase 1:\n\t\t\tif isReverse {\n\t\t\t\tisReverse = false\n\t\t\t} else {\n\t\t\t\tisReverse = true\n\t\t\t}\n\t\tcase 2:\n\t\t\tfmt.Scan(&f, &c)\n\t\t\tswitch f {\n\t\t\tcase 1:\n\t\t\t\tif isReverse {\n\t\t\t\t\ts = s + c\n\t\t\t\t} else {\n\t\t\t\t\ts = c + s\n\t\t\t\t}\n\t\t\tcase 2:\n\t\t\t\tif isReverse {\n\t\t\t\t\ts = c + s\n\t\t\t\t} else {\n\t\t\t\t\ts = s + c\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor isReverse {\n\t\treverse(s)\n\t}\n\tfmt.Println(s)\n}\n", "language": "Go", "metadata": {"date": 1583691090, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/Go/s949637153.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s949637153", "user_id": "u363118893"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\n// O(n)\nfunc reverse(s string) string {\n\tans := \"\"\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tans += string(s[i])\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar s, c string\n\tvar q, t, f int\n\tvar isReverse bool = false\n\tfmt.Scan(&s)\n\tfmt.Scan(&q)\n\tfor i := 1; i <= q; i++ {\n\t\tfmt.Scan(&t)\n\t\tswitch t {\n\t\tcase 1:\n\t\t\tif isReverse {\n\t\t\t\tisReverse = false\n\t\t\t} else {\n\t\t\t\tisReverse = true\n\t\t\t}\n\t\tcase 2:\n\t\t\tfmt.Scan(&f, &c)\n\t\t\tswitch f {\n\t\t\tcase 1:\n\t\t\t\tif isReverse {\n\t\t\t\t\ts = s + c\n\t\t\t\t} else {\n\t\t\t\t\ts = c + s\n\t\t\t\t}\n\t\t\tcase 2:\n\t\t\t\tif isReverse {\n\t\t\t\t\ts = c + s\n\t\t\t\t} else {\n\t\t\t\t\ts = s + c\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor isReverse {\n\t\treverse(s)\n\t}\n\tfmt.Println(s)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 667, "cpu_time_ms": 2111, "memory_kb": 9728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s125109074", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ta, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanByte() byte {\n\tscanner.Scan()\n\treturn []byte(scanner.Text())[0]\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\ts := scanText()\n\n\tspace := make([]byte, 5*int(math.Pow(10, 5)))\n\tsi := 2 * int(math.Pow(10, 5))\n\tei := si + len(s)\n\tfor i := si; i < ei; i++ {\n\t\tspace[i] = s[i-si]\n\t}\n\n\tb := false\n\n\tq := scanInt()\n\tfor i := 0; i < q; i++ {\n\t\tt := scanInt()\n\t\tif t == 1 {\n\t\t\tb = !b\n\t\t} else { // t == 2\n\t\t\tf := scanInt()\n\t\t\tc := scanByte()\n\t\t\tif f == 1 && !b || f == 2 && b { // 先頭\n\t\t\t\tsi--\n\t\t\t\tspace[si] = c\n\t\t\t} else {\n\t\t\t\tei++\n\t\t\t\tspace[ei-1] = c\n\t\t\t}\n\t\t}\n\t}\n\n\tif !b {\n\t\tfmt.Println(string(space[si:ei]))\n\n\t} else {\n\t\tsub := space[si:ei]\n\t\tfor left, right := 0, len(sub)-1; left < right; left, right = left+1, right-1 {\n\t\t\tsub[left], sub[right] = sub[right], sub[left]\n\t\t}\n\t\tfmt.Println(string(sub))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583637092, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/Go/s125109074.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s125109074", "user_id": "u605983940"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ta, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanByte() byte {\n\tscanner.Scan()\n\treturn []byte(scanner.Text())[0]\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\ts := scanText()\n\n\tspace := make([]byte, 5*int(math.Pow(10, 5)))\n\tsi := 2 * int(math.Pow(10, 5))\n\tei := si + len(s)\n\tfor i := si; i < ei; i++ {\n\t\tspace[i] = s[i-si]\n\t}\n\n\tb := false\n\n\tq := scanInt()\n\tfor i := 0; i < q; i++ {\n\t\tt := scanInt()\n\t\tif t == 1 {\n\t\t\tb = !b\n\t\t} else { // t == 2\n\t\t\tf := scanInt()\n\t\t\tc := scanByte()\n\t\t\tif f == 1 && !b || f == 2 && b { // 先頭\n\t\t\t\tsi--\n\t\t\t\tspace[si] = c\n\t\t\t} else {\n\t\t\t\tei++\n\t\t\t\tspace[ei-1] = c\n\t\t\t}\n\t\t}\n\t}\n\n\tif !b {\n\t\tfmt.Println(string(space[si:ei]))\n\n\t} else {\n\t\tsub := space[si:ei]\n\t\tfor left, right := 0, len(sub)-1; left < right; left, right = left+1, right-1 {\n\t\t\tsub[left], sub[right] = sub[right], sub[left]\n\t\t}\n\t\tfmt.Println(string(sub))\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1123, "cpu_time_ms": 5, "memory_kb": 1152}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s199014666", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\trev := false\n\ts1 := make([]rune, 300000)\n\ts2 := make([]rune, 200000)\n\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tr := []rune(s)\n\tfor i := 0; i < len(r); i++ {\n\t\ts1[i] = r[i]\n\t}\n\tlen1, len2 := len(s), 0\n\n\tvar Q int\n\tfmt.Scanf(\"%d\", &Q)\n\tfor Q > 0 {\n\t\tQ--\n\t\tvar t int\n\t\tfmt.Scanf(\"%d\", &t)\n\t\tif t == 1 {\n\t\t\trev = !rev\n\t\t\tcontinue\n\t\t}\n\t\tvar f int\n\t\tvar c string\n\t\tfmt.Scanf(\"%d %s\", &f, &c)\n\t\tif (f == 1 && rev) || (f == 2 && !rev) {\n\t\t\ts1[len1] = []rune(c)[0]\n\t\t\tlen1++\n\t\t} else {\n\t\t\ts2[len2] = []rune(c)[0]\n\t\t\tlen2++\n\t\t}\n\t}\n\ts1 = s1[:len1]\n\ts2 = s2[:len2]\n\tif rev {\n\t\ts1, s2 = s2, s1\n\t}\n\tfmt.Printf(\"%s\\n\", string(append(reverse(s2), s1...)))\n}\n\nfunc reverse(s []rune) []rune {\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\ts[i], s[j] = s[j], s[i]\n\t}\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1583635955, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/Go/s199014666.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s199014666", "user_id": "u226445453"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\trev := false\n\ts1 := make([]rune, 300000)\n\ts2 := make([]rune, 200000)\n\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tr := []rune(s)\n\tfor i := 0; i < len(r); i++ {\n\t\ts1[i] = r[i]\n\t}\n\tlen1, len2 := len(s), 0\n\n\tvar Q int\n\tfmt.Scanf(\"%d\", &Q)\n\tfor Q > 0 {\n\t\tQ--\n\t\tvar t int\n\t\tfmt.Scanf(\"%d\", &t)\n\t\tif t == 1 {\n\t\t\trev = !rev\n\t\t\tcontinue\n\t\t}\n\t\tvar f int\n\t\tvar c string\n\t\tfmt.Scanf(\"%d %s\", &f, &c)\n\t\tif (f == 1 && rev) || (f == 2 && !rev) {\n\t\t\ts1[len1] = []rune(c)[0]\n\t\t\tlen1++\n\t\t} else {\n\t\t\ts2[len2] = []rune(c)[0]\n\t\t\tlen2++\n\t\t}\n\t}\n\ts1 = s1[:len1]\n\ts2 = s2[:len2]\n\tif rev {\n\t\ts1, s2 = s2, s1\n\t}\n\tfmt.Printf(\"%s\\n\", string(append(reverse(s2), s1...)))\n}\n\nfunc reverse(s []rune) []rune {\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\ts[i], s[j] = s[j], s[i]\n\t}\n\treturn s\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 810, "cpu_time_ms": 1296, "memory_kb": 6784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s637449417", "group_id": "codeNet:p02757", "input_text": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n \"strings\"\n)\n\nfunc calc(p int, s string, c map[string]bool) bool {\n t := strings.TrimLeft(s, \"0\")\n r, ok := c[t]\n if ok {\n return r\n }\n if len(t) < 10 {\n v, _ := strconv.Atoi(t)\n c[t] = int(v)%p == 0\n return c[t]\n }\n v, _ := strconv.Atoi(t[0:10])\n s = s[10:]\n u := v % p\n for len(s) > 0 {\n v, _ := strconv.Atoi(t[0:1])\n u = (u*10 + v) % p\n s = s[1:]\n }\n c[t] = u == 0\n return c[t]\n\n}\nfunc main() {\n var N, P int\n fmt.Scanf(\"%d %d\", &N, &P)\n lp := len(fmt.Sprintf(\"%d\", P))\n c := map[string]bool{}\n var S string\n fmt.Scanf(\"%s\", &S)\n ret := 0\n for i := 0; i <= N-lp; i++ {\n for j := i + lp - 1; j <= N; j++ {\n if calc(P, S[i:j], c) {\n ret += 1\n }\n }\n }\n fmt.Println(ret)\n}", "language": "Go", "metadata": {"date": 1583639155, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02757.html", "problem_id": "p02757", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02757/input.txt", "sample_output_relpath": "derived/input_output/data/p02757/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02757/Go/s637449417.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s637449417", "user_id": "u657357805"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n \"strings\"\n)\n\nfunc calc(p int, s string, c map[string]bool) bool {\n t := strings.TrimLeft(s, \"0\")\n r, ok := c[t]\n if ok {\n return r\n }\n if len(t) < 10 {\n v, _ := strconv.Atoi(t)\n c[t] = int(v)%p == 0\n return c[t]\n }\n v, _ := strconv.Atoi(t[0:10])\n s = s[10:]\n u := v % p\n for len(s) > 0 {\n v, _ := strconv.Atoi(t[0:1])\n u = (u*10 + v) % p\n s = s[1:]\n }\n c[t] = u == 0\n return c[t]\n\n}\nfunc main() {\n var N, P int\n fmt.Scanf(\"%d %d\", &N, &P)\n lp := len(fmt.Sprintf(\"%d\", P))\n c := map[string]bool{}\n var S string\n fmt.Scanf(\"%s\", &S)\n ret := 0\n for i := 0; i <= N-lp; i++ {\n for j := i + lp - 1; j <= N; j++ {\n if calc(P, S[i:j], c) {\n ret += 1\n }\n }\n }\n fmt.Println(ret)\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi has a string S of length N consisting of digits from 0 through 9.\n\nHe loves the prime number P. He wants to know how many non-empty (contiguous) substrings of S - there are N \\times (N + 1) / 2 of them - are divisible by P when regarded as integers written in base ten.\n\nHere substrings starting with a 0 also count, and substrings originated from different positions in S are distinguished, even if they are equal as strings or integers.\n\nCompute this count to help Takahashi.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS consists of digits.\n\n|S| = N\n\n2 \\leq P \\leq 10000\n\nP is a prime number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nS\n\nOutput\n\nPrint the number of non-empty (contiguous) substrings of S that are divisible by P when regarded as an integer written in base ten.\n\nSample Input 1\n\n4 3\n3543\n\nSample Output 1\n\n6\n\nHere S = 3543. There are ten non-empty (contiguous) substrings of S:\n\n3: divisible by 3.\n\n35: not divisible by 3.\n\n354: divisible by 3.\n\n3543: divisible by 3.\n\n5: not divisible by 3.\n\n54: divisible by 3.\n\n543: divisible by 3.\n\n4: not divisible by 3.\n\n43: not divisible by 3.\n\n3: divisible by 3.\n\nSix of these are divisible by 3, so print 6.\n\nSample Input 2\n\n4 2\n2020\n\nSample Output 2\n\n10\n\nHere S = 2020. There are ten non-empty (contiguous) substrings of S, all of which are divisible by 2, so print 10.\n\nNote that substrings beginning with a 0 also count.\n\nSample Input 3\n\n20 11\n33883322005544116655\n\nSample Output 3\n\n68", "sample_input": "4 3\n3543\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02757", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi has a string S of length N consisting of digits from 0 through 9.\n\nHe loves the prime number P. He wants to know how many non-empty (contiguous) substrings of S - there are N \\times (N + 1) / 2 of them - are divisible by P when regarded as integers written in base ten.\n\nHere substrings starting with a 0 also count, and substrings originated from different positions in S are distinguished, even if they are equal as strings or integers.\n\nCompute this count to help Takahashi.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS consists of digits.\n\n|S| = N\n\n2 \\leq P \\leq 10000\n\nP is a prime number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nS\n\nOutput\n\nPrint the number of non-empty (contiguous) substrings of S that are divisible by P when regarded as an integer written in base ten.\n\nSample Input 1\n\n4 3\n3543\n\nSample Output 1\n\n6\n\nHere S = 3543. There are ten non-empty (contiguous) substrings of S:\n\n3: divisible by 3.\n\n35: not divisible by 3.\n\n354: divisible by 3.\n\n3543: divisible by 3.\n\n5: not divisible by 3.\n\n54: divisible by 3.\n\n543: divisible by 3.\n\n4: not divisible by 3.\n\n43: not divisible by 3.\n\n3: divisible by 3.\n\nSix of these are divisible by 3, so print 6.\n\nSample Input 2\n\n4 2\n2020\n\nSample Output 2\n\n10\n\nHere S = 2020. There are ten non-empty (contiguous) substrings of S, all of which are divisible by 2, so print 10.\n\nNote that substrings beginning with a 0 also count.\n\nSample Input 3\n\n20 11\n33883322005544116655\n\nSample Output 3\n\n68", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1106, "cpu_time_ms": 2108, "memory_kb": 13184}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s191559587", "group_id": "codeNet:p02760", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\t// 100MB\n\tbufsize := 100 * 1024 * 1024\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, bufio.MaxScanTokenSize), bufsize)\n\tsc.Split(bufio.ScanWords)\n}\nfunc readInt() int { return readIntArray(1)[0] }\nfunc readInt2() (int, int) { a := readIntArray(2); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(3); return a[0], a[1], a[2] }\nfunc readIntArray(n int) []int {\n\ts := readStringArray(n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\nfunc readString() string { return readStringArray(1)[0] }\nfunc readString2() (string, string) { a := readStringArray(2); return a[0], a[1] }\nfunc readStringArray(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i] = sc.Text()\n\t}\n\treturn a\n}\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor _, n := range ns {\n\t\tif n > max {\n\t\t\tmax = n\n\t\t}\n\t}\n\treturn max\n}\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor _, n := range ns {\n\t\tif n < min {\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn min\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tA := make([][]int, 3)\n\tfor i := range A {\n\t\ta1, a2, a3 := readInt3()\n\t\tA[i] = []int{a1, a2, a3}\n\t}\n\tsuccess := [][]int{\n\t\tA[0], A[1], A[2],\n\t\t[]int{A[0][0], A[1][0], A[2][0]},\n\t\t[]int{A[0][1], A[1][1], A[2][1]},\n\t\t[]int{A[0][2], A[1][2], A[2][2]},\n\t\t[]int{A[0][0], A[1][1], A[2][2]},\n\t\t[]int{A[0][2], A[1][1], A[2][0]},\n\t}\n\n\tN := readInt()\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tb[i] = readInt()\n\t}\n\n\tfor i := range success {\n\t\tif check(success[i], b) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n\n}\n\nfunc check(l []int, b []int) bool {\n\tm := make(map[int]struct{})\n\tfor i := range b {\n\t\tm[b[i]] = struct{}{}\n\t}\n\n\tfor i := range l {\n\t\tif _, ok := m[l[i]]; !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1583115267, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02760.html", "problem_id": "p02760", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02760/input.txt", "sample_output_relpath": "derived/input_output/data/p02760/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02760/Go/s191559587.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s191559587", "user_id": "u502098699"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\t// 100MB\n\tbufsize := 100 * 1024 * 1024\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, bufio.MaxScanTokenSize), bufsize)\n\tsc.Split(bufio.ScanWords)\n}\nfunc readInt() int { return readIntArray(1)[0] }\nfunc readInt2() (int, int) { a := readIntArray(2); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(3); return a[0], a[1], a[2] }\nfunc readIntArray(n int) []int {\n\ts := readStringArray(n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\nfunc readString() string { return readStringArray(1)[0] }\nfunc readString2() (string, string) { a := readStringArray(2); return a[0], a[1] }\nfunc readStringArray(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i] = sc.Text()\n\t}\n\treturn a\n}\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor _, n := range ns {\n\t\tif n > max {\n\t\t\tmax = n\n\t\t}\n\t}\n\treturn max\n}\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor _, n := range ns {\n\t\tif n < min {\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn min\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tA := make([][]int, 3)\n\tfor i := range A {\n\t\ta1, a2, a3 := readInt3()\n\t\tA[i] = []int{a1, a2, a3}\n\t}\n\tsuccess := [][]int{\n\t\tA[0], A[1], A[2],\n\t\t[]int{A[0][0], A[1][0], A[2][0]},\n\t\t[]int{A[0][1], A[1][1], A[2][1]},\n\t\t[]int{A[0][2], A[1][2], A[2][2]},\n\t\t[]int{A[0][0], A[1][1], A[2][2]},\n\t\t[]int{A[0][2], A[1][1], A[2][0]},\n\t}\n\n\tN := readInt()\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tb[i] = readInt()\n\t}\n\n\tfor i := range success {\n\t\tif check(success[i], b) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n\n}\n\nfunc check(l []int, b []int) bool {\n\tm := make(map[int]struct{})\n\tfor i := range b {\n\t\tm[b[i]] = struct{}{}\n\t}\n\n\tfor i := range l {\n\t\tif _, ok := m[l[i]]; !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "sample_input": "84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02760", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1933, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s576228499", "group_id": "codeNet:p02762", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc sameUnion(g [][]int, a int) map[int]struct{} {\n\tset := make(map[int]struct{}, len(g))\n\tst := make([]int, 0, len(g))\n\tst = append(st, a)\n\tfor len(st) > 0 {\n\t\tcurrent := st[0]\n\t\tst = st[1:]\n\t\tset[current] = struct{}{}\n\t\tfor _, next := range g[current] {\n\t\t\t_, exist := set[next]\n\t\t\tif !exist {\n\t\t\t\tst = append([]int{next}, st...)\n\t\t\t}\n\t\t}\n\t}\n\treturn set\n}\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tg := make([][]int, n)\n\tbg := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg[i] = make([]int, 0, n)\n\t\tbg[i] = make([]int, 0, n)\n\t}\n\tm := nextInt()\n\tk := nextInt()\n\tfor i := 0; i < m; i++ {\n\t\tai := nextInt()\n\t\tbi := nextInt()\n\t\tg[ai-1] = append(g[ai-1], bi-1)\n\t\tg[bi-1] = append(g[bi-1], ai-1)\n\t}\n\tfor i := 0; i < k; i++ {\n\t\tci := nextInt()\n\t\tdi := nextInt()\n\t\tbg[ci-1] = append(bg[ci-1], di-1)\n\t\tbg[di-1] = append(bg[di-1], ci-1)\n\t}\n\t// fmt.Println(g)\n\t// fmt.Println(bg)\n\tans := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tu := sameUnion(g, i)\n\t\t// fmt.Println(u)\n\t\tvar fcount int\n\t\tfor _, x := range g[i] {\n\t\t\t_, exist := u[x]\n\t\t\tif exist {\n\t\t\t\tfcount++\n\t\t\t}\n\t\t}\n\t\tvar bcount int\n\t\tfor _, x := range bg[i] {\n\t\t\t_, exist := u[x]\n\t\t\tif exist {\n\t\t\t\tbcount++\n\t\t\t}\n\t\t}\n\t\tans[i] = strconv.Itoa(len(u) - fcount - bcount - 1)\n\t}\n\tfmt.Println(strings.Join(ans, \" \"))\n}\n", "language": "Go", "metadata": {"date": 1585611111, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02762.html", "problem_id": "p02762", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02762/input.txt", "sample_output_relpath": "derived/input_output/data/p02762/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02762/Go/s576228499.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s576228499", "user_id": "u452900140"}, "prompt_components": {"gold_output": "0 1 0 1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc sameUnion(g [][]int, a int) map[int]struct{} {\n\tset := make(map[int]struct{}, len(g))\n\tst := make([]int, 0, len(g))\n\tst = append(st, a)\n\tfor len(st) > 0 {\n\t\tcurrent := st[0]\n\t\tst = st[1:]\n\t\tset[current] = struct{}{}\n\t\tfor _, next := range g[current] {\n\t\t\t_, exist := set[next]\n\t\t\tif !exist {\n\t\t\t\tst = append([]int{next}, st...)\n\t\t\t}\n\t\t}\n\t}\n\treturn set\n}\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tg := make([][]int, n)\n\tbg := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg[i] = make([]int, 0, n)\n\t\tbg[i] = make([]int, 0, n)\n\t}\n\tm := nextInt()\n\tk := nextInt()\n\tfor i := 0; i < m; i++ {\n\t\tai := nextInt()\n\t\tbi := nextInt()\n\t\tg[ai-1] = append(g[ai-1], bi-1)\n\t\tg[bi-1] = append(g[bi-1], ai-1)\n\t}\n\tfor i := 0; i < k; i++ {\n\t\tci := nextInt()\n\t\tdi := nextInt()\n\t\tbg[ci-1] = append(bg[ci-1], di-1)\n\t\tbg[di-1] = append(bg[di-1], ci-1)\n\t}\n\t// fmt.Println(g)\n\t// fmt.Println(bg)\n\tans := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tu := sameUnion(g, i)\n\t\t// fmt.Println(u)\n\t\tvar fcount int\n\t\tfor _, x := range g[i] {\n\t\t\t_, exist := u[x]\n\t\t\tif exist {\n\t\t\t\tfcount++\n\t\t\t}\n\t\t}\n\t\tvar bcount int\n\t\tfor _, x := range bg[i] {\n\t\t\t_, exist := u[x]\n\t\t\tif exist {\n\t\t\t\tbcount++\n\t\t\t}\n\t\t}\n\t\tans[i] = strconv.Itoa(len(u) - fcount - bcount - 1)\n\t}\n\tfmt.Println(strings.Join(ans, \" \"))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAn SNS has N users - User 1, User 2, \\cdots, User N.\n\nBetween these N users, there are some relationships - M friendships and K blockships.\n\nFor each i = 1, 2, \\cdots, M, there is a bidirectional friendship between User A_i and User B_i.\n\nFor each i = 1, 2, \\cdots, K, there is a bidirectional blockship between User C_i and User D_i.\n\nWe define User a to be a friend candidate for User b when all of the following four conditions are satisfied:\n\na \\neq b.\n\nThere is not a friendship between User a and User b.\n\nThere is not a blockship between User a and User b.\n\nThere exists a sequence c_0, c_1, c_2, \\cdots, c_L consisting of integers between 1 and N (inclusive) such that c_0 = a, c_L = b, and there is a friendship between User c_i and c_{i+1} for each i = 0, 1, \\cdots, L - 1.\n\nFor each user i = 1, 2, ... N, how many friend candidates does it have?\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10^5\n\n0 \\leq M \\leq 10^5\n\n0 \\leq K \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\n1 \\leq C_i, D_i \\leq N\n\nC_i \\neq D_i\n\n(A_i, B_i) \\neq (A_j, B_j) (i \\neq j)\n\n(A_i, B_i) \\neq (B_j, A_j)\n\n(C_i, D_i) \\neq (C_j, D_j) (i \\neq j)\n\n(C_i, D_i) \\neq (D_j, C_j)\n\n(A_i, B_i) \\neq (C_j, D_j)\n\n(A_i, B_i) \\neq (D_j, C_j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M K\nA_1 B_1\n\\vdots\nA_M B_M\nC_1 D_1\n\\vdots\nC_K D_K\n\nOutput\n\nPrint the answers in order, with space in between.\n\nSample Input 1\n\n4 4 1\n2 1\n1 3\n3 2\n3 4\n4 1\n\nSample Output 1\n\n0 1 0 1\n\nThere is a friendship between User 2 and 3, and between 3 and 4. Also, there is no friendship or blockship between User 2 and 4. Thus, User 4 is a friend candidate for User 2.\n\nHowever, neither User 1 or 3 is a friend candidate for User 2, so User 2 has one friend candidate.\n\nSample Input 2\n\n5 10 0\n1 2\n1 3\n1 4\n1 5\n3 2\n2 4\n2 5\n4 3\n5 3\n4 5\n\nSample Output 2\n\n0 0 0 0 0\n\nEveryone is a friend of everyone else and has no friend candidate.\n\nSample Input 3\n\n10 9 3\n10 1\n6 7\n8 2\n2 5\n8 4\n7 3\n10 9\n6 4\n5 8\n2 6\n7 5\n3 1\n\nSample Output 3\n\n1 3 5 4 3 3 3 3 1 0", "sample_input": "4 4 1\n2 1\n1 3\n3 2\n3 4\n4 1\n"}, "reference_outputs": ["0 1 0 1\n"], "source_document_id": "p02762", "source_text": "Score : 400 points\n\nProblem Statement\n\nAn SNS has N users - User 1, User 2, \\cdots, User N.\n\nBetween these N users, there are some relationships - M friendships and K blockships.\n\nFor each i = 1, 2, \\cdots, M, there is a bidirectional friendship between User A_i and User B_i.\n\nFor each i = 1, 2, \\cdots, K, there is a bidirectional blockship between User C_i and User D_i.\n\nWe define User a to be a friend candidate for User b when all of the following four conditions are satisfied:\n\na \\neq b.\n\nThere is not a friendship between User a and User b.\n\nThere is not a blockship between User a and User b.\n\nThere exists a sequence c_0, c_1, c_2, \\cdots, c_L consisting of integers between 1 and N (inclusive) such that c_0 = a, c_L = b, and there is a friendship between User c_i and c_{i+1} for each i = 0, 1, \\cdots, L - 1.\n\nFor each user i = 1, 2, ... N, how many friend candidates does it have?\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10^5\n\n0 \\leq M \\leq 10^5\n\n0 \\leq K \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\n1 \\leq C_i, D_i \\leq N\n\nC_i \\neq D_i\n\n(A_i, B_i) \\neq (A_j, B_j) (i \\neq j)\n\n(A_i, B_i) \\neq (B_j, A_j)\n\n(C_i, D_i) \\neq (C_j, D_j) (i \\neq j)\n\n(C_i, D_i) \\neq (D_j, C_j)\n\n(A_i, B_i) \\neq (C_j, D_j)\n\n(A_i, B_i) \\neq (D_j, C_j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M K\nA_1 B_1\n\\vdots\nA_M B_M\nC_1 D_1\n\\vdots\nC_K D_K\n\nOutput\n\nPrint the answers in order, with space in between.\n\nSample Input 1\n\n4 4 1\n2 1\n1 3\n3 2\n3 4\n4 1\n\nSample Output 1\n\n0 1 0 1\n\nThere is a friendship between User 2 and 3, and between 3 and 4. Also, there is no friendship or blockship between User 2 and 4. Thus, User 4 is a friend candidate for User 2.\n\nHowever, neither User 1 or 3 is a friend candidate for User 2, so User 2 has one friend candidate.\n\nSample Input 2\n\n5 10 0\n1 2\n1 3\n1 4\n1 5\n3 2\n2 4\n2 5\n4 3\n5 3\n4 5\n\nSample Output 2\n\n0 0 0 0 0\n\nEveryone is a friend of everyone else and has no friend candidate.\n\nSample Input 3\n\n10 9 3\n10 1\n6 7\n8 2\n2 5\n8 4\n7 3\n10 9\n6 4\n5 8\n2 6\n7 5\n3 1\n\nSample Output 3\n\n1 3 5 4 3 3 3 3 1 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2477, "cpu_time_ms": 4015, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s606375049", "group_id": "codeNet:p02765", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sanka, hyouji int\n\tfmt.Scan(&sanka, &hyouji)\n\t// fmt.Printf(\"A %d, B %d\\n\", a, b)\n\n\tif sanka >= 10 {\n\t\tfmt.Printf(\"%d\\n\", hyouji)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", hyouji-100*(10-sanka))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583029969, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02765.html", "problem_id": "p02765", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02765/input.txt", "sample_output_relpath": "derived/input_output/data/p02765/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02765/Go/s606375049.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s606375049", "user_id": "u678848631"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sanka, hyouji int\n\tfmt.Scan(&sanka, &hyouji)\n\t// fmt.Printf(\"A %d, B %d\\n\", a, b)\n\n\tif sanka >= 10 {\n\t\tfmt.Printf(\"%d\\n\", hyouji)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", hyouji-100*(10-sanka))\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "sample_input": "2 2919\n"}, "reference_outputs": ["3719\n"], "source_document_id": "p02765", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 241, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s621944978", "group_id": "codeNet:p02766", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int64\n\tvar k int\n\tfmt.Scan(&n, &k)\n\ts := strconv.FormatInt(n, k)\n\tfmt.Println(len(s))\n}\n", "language": "Go", "metadata": {"date": 1584845462, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02766.html", "problem_id": "p02766", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02766/input.txt", "sample_output_relpath": "derived/input_output/data/p02766/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02766/Go/s621944978.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s621944978", "user_id": "u422017528"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int64\n\tvar k int\n\tfmt.Scan(&n, &k)\n\ts := strconv.FormatInt(n, k)\n\tfmt.Println(len(s))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "sample_input": "11 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02766", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 153, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s472161162", "group_id": "codeNet:p02766", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tvar digit int\n\ttmp := 1\n\tfor l := 0; ; l++ {\n\t\tif n < tmp {\n\t\t\tdigit = l + 1\n\t\t\tbreak\n\t\t}\n\t\ttmp *= k\n\t}\n\n\tfmt.Print(digit)\n}\n", "language": "Go", "metadata": {"date": 1584583565, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02766.html", "problem_id": "p02766", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02766/input.txt", "sample_output_relpath": "derived/input_output/data/p02766/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02766/Go/s472161162.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s472161162", "user_id": "u323338590"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tvar digit int\n\ttmp := 1\n\tfor l := 0; ; l++ {\n\t\tif n < tmp {\n\t\t\tdigit = l + 1\n\t\t\tbreak\n\t\t}\n\t\ttmp *= k\n\t}\n\n\tfmt.Print(digit)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "sample_input": "11 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02766", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 201, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218652447", "group_id": "codeNet:p02766", "input_text": "package main\n\nimport (\n\t\"fmt\"\n \t\"math\"\n)\n\nfunc main() {\n\tvar n,k float64\n\tfmt.Scan(&n,&k)\n\t\n\tfor i := 0.0; i < n; i++ {\n if n == 1 {\n \tfmt.Println(1)\n \treturn\n } else if n < math.Pow(k, i) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1583033604, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02766.html", "problem_id": "p02766", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02766/input.txt", "sample_output_relpath": "derived/input_output/data/p02766/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02766/Go/s218652447.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s218652447", "user_id": "u689167014"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n \t\"math\"\n)\n\nfunc main() {\n\tvar n,k float64\n\tfmt.Scan(&n,&k)\n\t\n\tfor i := 0.0; i < n; i++ {\n if n == 1 {\n \tfmt.Println(1)\n \treturn\n } else if n < math.Pow(k, i) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "sample_input": "11 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02766", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\nNotes\n\nFor information on base-K representation, see Positional notation - Wikipedia.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^9\n\n2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of digits that N has in base K.\n\nSample Input 1\n\n11 2\n\nSample Output 1\n\n4\n\nIn binary, 11 is represented as 1011.\n\nSample Input 2\n\n1010101 10\n\nSample Output 2\n\n7\n\nSample Input 3\n\n314159265 3\n\nSample Output 3\n\n18", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s658200551", "group_id": "codeNet:p02767", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\n\tmin := math.MaxInt32\n\tfor i := 1; i <= 100; i++ {\n\t\tsum := 0\n\t\tfor _, x := range xs {\n\t\t\tsum += (x - i) * (x - i)\n\t\t}\n\t\tif sum < min {\n\t\t\tmin = sum\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "language": "Go", "metadata": {"date": 1588301863, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02767.html", "problem_id": "p02767", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02767/input.txt", "sample_output_relpath": "derived/input_output/data/p02767/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02767/Go/s658200551.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s658200551", "user_id": "u367908963"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\n\tmin := math.MaxInt32\n\tfor i := 1; i <= 100; i++ {\n\t\tsum := 0\n\t\tfor _, x := range xs {\n\t\t\tsum += (x - i) * (x - i)\n\t\t}\n\t\tif sum < min {\n\t\t\tmin = sum\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "sample_input": "2\n1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 322, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s151711848", "group_id": "codeNet:p02767", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\tx := make([]int,n)\n\t\n\tfor i,_ := range x {\n\t\tfmt.Scan(&x[i])\n\t}\n\t\n\tsort.Ints(x)\n\t\n\n\tminSums := 1000000\n\tfor p := x[0]; p <= x[n-1]; p++ {\n\t\tsums := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tsums += square(x[i] - p)\n\t\t}\n\t\tif minSums > sums {\n\t\t\tminSums = sums\n\t\t}\n\t}\n\tfmt.Println(minSums)\t\n}\n\nfunc square(x int) int {\n\treturn x * x\n}", "language": "Go", "metadata": {"date": 1587772945, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02767.html", "problem_id": "p02767", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02767/input.txt", "sample_output_relpath": "derived/input_output/data/p02767/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02767/Go/s151711848.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s151711848", "user_id": "u689167014"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\tx := make([]int,n)\n\t\n\tfor i,_ := range x {\n\t\tfmt.Scan(&x[i])\n\t}\n\t\n\tsort.Ints(x)\n\t\n\n\tminSums := 1000000\n\tfor p := x[0]; p <= x[n-1]; p++ {\n\t\tsums := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tsums += square(x[i] - p)\n\t\t}\n\t\tif minSums > sums {\n\t\t\tminSums = sums\n\t\t}\n\t}\n\tfmt.Println(minSums)\t\n}\n\nfunc square(x int) int {\n\treturn x * x\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "sample_input": "2\n1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 405, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s570138059", "group_id": "codeNet:p02768", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar (\n\tfactorialMemo []int\n)\n\nfunc repeatedSquaring(n, p, m int) int {\n\tif p == 0 {\n\t\treturn 1\n\t}\n\tif p%2 == 0 {\n\t\tt := repeatedSquaring(n, p/2, m)\n\t\treturn t * t % m\n\t}\n\treturn n * repeatedSquaring(n, p-1, m) % m\n}\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n, &a, &b)\n\n\tdivisor := int(math.Pow10(9) + 7)\n\tall := repeatedSquaring(2, n, divisor) - 1\n\n\tfor _, k := range []int{a, b} {\n\t\tx := 1\n\t\ty := 1\n\t\tfor i := 0; i < k; i++ {\n\t\t\tx = x * (n - i) % divisor\n\t\t\ty = y * (i + 1) % divisor\n\t\t}\n\n\t\tr := x * repeatedSquaring(y, divisor-2, divisor) % divisor\n\t\t// fmt.Println(all, a, b, x, y, r, divisor)\n\t\tall -= r\n\t}\n\n\tif all < 0 {\n\t\tall += divisor\n\t}\n\n\tfmt.Println(all)\n}\n", "language": "Go", "metadata": {"date": 1582586541, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02768.html", "problem_id": "p02768", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02768/input.txt", "sample_output_relpath": "derived/input_output/data/p02768/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02768/Go/s570138059.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s570138059", "user_id": "u448258717"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar (\n\tfactorialMemo []int\n)\n\nfunc repeatedSquaring(n, p, m int) int {\n\tif p == 0 {\n\t\treturn 1\n\t}\n\tif p%2 == 0 {\n\t\tt := repeatedSquaring(n, p/2, m)\n\t\treturn t * t % m\n\t}\n\treturn n * repeatedSquaring(n, p-1, m) % m\n}\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n, &a, &b)\n\n\tdivisor := int(math.Pow10(9) + 7)\n\tall := repeatedSquaring(2, n, divisor) - 1\n\n\tfor _, k := range []int{a, b} {\n\t\tx := 1\n\t\ty := 1\n\t\tfor i := 0; i < k; i++ {\n\t\t\tx = x * (n - i) % divisor\n\t\t\ty = y * (i + 1) % divisor\n\t\t}\n\n\t\tr := x * repeatedSquaring(y, divisor-2, divisor) % divisor\n\t\t// fmt.Println(all, a, b, x, y, r, divisor)\n\t\tall -= r\n\t}\n\n\tif all < 0 {\n\t\tall += divisor\n\t}\n\n\tfmt.Println(all)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAkari has n kinds of flowers, one of each kind.\n\nShe is going to choose one or more of these flowers to make a bouquet.\n\nHowever, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b.\n\nHow many different bouquets are there that Akari can make?\n\nFind the count modulo (10^9 + 7).\n\nHere, two bouquets are considered different when there is a flower that is used in one of the bouquets but not in the other bouquet.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq n \\leq 10^9\n\n1 \\leq a < b \\leq \\textrm{min}(n, 2 \\times 10^5)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn a b\n\nOutput\n\nPrint the number of bouquets that Akari can make, modulo (10^9 + 7). (If there are no such bouquets, print 0.)\n\nSample Input 1\n\n4 1 3\n\nSample Output 1\n\n7\n\nIn this case, Akari can choose 2 or 4 flowers to make the bouquet.\n\nThere are 6 ways to choose 2 out of the 4 flowers, and 1 way to choose 4, so there are a total of 7 different bouquets that Akari can make.\n\nSample Input 2\n\n1000000000 141421 173205\n\nSample Output 2\n\n34076506\n\nPrint the count modulo (10^9 + 7).", "sample_input": "4 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02768", "source_text": "Score : 400 points\n\nProblem Statement\n\nAkari has n kinds of flowers, one of each kind.\n\nShe is going to choose one or more of these flowers to make a bouquet.\n\nHowever, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b.\n\nHow many different bouquets are there that Akari can make?\n\nFind the count modulo (10^9 + 7).\n\nHere, two bouquets are considered different when there is a flower that is used in one of the bouquets but not in the other bouquet.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq n \\leq 10^9\n\n1 \\leq a < b \\leq \\textrm{min}(n, 2 \\times 10^5)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn a b\n\nOutput\n\nPrint the number of bouquets that Akari can make, modulo (10^9 + 7). (If there are no such bouquets, print 0.)\n\nSample Input 1\n\n4 1 3\n\nSample Output 1\n\n7\n\nIn this case, Akari can choose 2 or 4 flowers to make the bouquet.\n\nThere are 6 ways to choose 2 out of the 4 flowers, and 1 way to choose 4, so there are a total of 7 different bouquets that Akari can make.\n\nSample Input 2\n\n1000000000 141421 173205\n\nSample Output 2\n\n34076506\n\nPrint the count modulo (10^9 + 7).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 710, "cpu_time_ms": 10, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s635947916", "group_id": "codeNet:p02768", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc mul(a int64, b int64) int64 {\n\treturn ((a * b) % mod)\n}\n\nfunc power(x int64, y int64) int64 {\n\tif y == 0 {\n\t\treturn 1\n\t} else if y%2 == 0 {\n\t\tans := int64(power(x, y/2)) % mod\n\t\tans = mul(ans, ans)\n\t\treturn ans\n\t} else {\n\t\tans := int64(power(x, y/2)) % mod\n\t\tans = mul(mul(ans, ans), x)\n\t\treturn ans\n\t}\n}\n\nvar mod = int64(1000000007)\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := nextInt()\n\tb := nextInt()\n\n\tfac := make([]int64, n+1, n+1)\n\tinvfac := make([]int64, n+1, n+1)\n\n\t// prepare factrorial\n\tfac[0] = 1\n\tinvfac[0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tfac[i] = (int64(i) * fac[i-1]) % mod\n\t}\n\tinvfac[n] = power(fac[n], mod-2)\n\tfor i := 1; i < n; i++ {\n\t\tinvfac[n-i] = (invfac[n-i+1] * int64(n-i+1)) % mod\n\t}\n\tvar ans int64\n\tans = mul(mul(fac[n], invfac[0]), invfac[n])\n\tfor i := 1; i < n/2; i++ {\n\t\tc := mul(mul(fac[n], invfac[n-i]), invfac[i])\n\t\tans = (ans + mul(2, c)) % mod\n\t}\n\tif n%2 == 0 {\n\t\tans = (ans + mul(mul(fac[n], invfac[n-n/2]), invfac[n/2])) % mod\n\t}\n\tca := mul(mul(fac[n], invfac[n-a]), invfac[a])\n\tcb := mul(mul(fac[n], invfac[n-b]), invfac[b])\n\tans = (ans - ca) % mod\n\tif ans < 0 {\n\t\tans = ans + mod\n\t}\n\tans = (ans - cb) % mod\n\tif ans < 0 {\n\t\tans = ans + mod\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1582407182, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02768.html", "problem_id": "p02768", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02768/input.txt", "sample_output_relpath": "derived/input_output/data/p02768/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02768/Go/s635947916.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s635947916", "user_id": "u452900140"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc mul(a int64, b int64) int64 {\n\treturn ((a * b) % mod)\n}\n\nfunc power(x int64, y int64) int64 {\n\tif y == 0 {\n\t\treturn 1\n\t} else if y%2 == 0 {\n\t\tans := int64(power(x, y/2)) % mod\n\t\tans = mul(ans, ans)\n\t\treturn ans\n\t} else {\n\t\tans := int64(power(x, y/2)) % mod\n\t\tans = mul(mul(ans, ans), x)\n\t\treturn ans\n\t}\n}\n\nvar mod = int64(1000000007)\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := nextInt()\n\tb := nextInt()\n\n\tfac := make([]int64, n+1, n+1)\n\tinvfac := make([]int64, n+1, n+1)\n\n\t// prepare factrorial\n\tfac[0] = 1\n\tinvfac[0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tfac[i] = (int64(i) * fac[i-1]) % mod\n\t}\n\tinvfac[n] = power(fac[n], mod-2)\n\tfor i := 1; i < n; i++ {\n\t\tinvfac[n-i] = (invfac[n-i+1] * int64(n-i+1)) % mod\n\t}\n\tvar ans int64\n\tans = mul(mul(fac[n], invfac[0]), invfac[n])\n\tfor i := 1; i < n/2; i++ {\n\t\tc := mul(mul(fac[n], invfac[n-i]), invfac[i])\n\t\tans = (ans + mul(2, c)) % mod\n\t}\n\tif n%2 == 0 {\n\t\tans = (ans + mul(mul(fac[n], invfac[n-n/2]), invfac[n/2])) % mod\n\t}\n\tca := mul(mul(fac[n], invfac[n-a]), invfac[a])\n\tcb := mul(mul(fac[n], invfac[n-b]), invfac[b])\n\tans = (ans - ca) % mod\n\tif ans < 0 {\n\t\tans = ans + mod\n\t}\n\tans = (ans - cb) % mod\n\tif ans < 0 {\n\t\tans = ans + mod\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAkari has n kinds of flowers, one of each kind.\n\nShe is going to choose one or more of these flowers to make a bouquet.\n\nHowever, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b.\n\nHow many different bouquets are there that Akari can make?\n\nFind the count modulo (10^9 + 7).\n\nHere, two bouquets are considered different when there is a flower that is used in one of the bouquets but not in the other bouquet.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq n \\leq 10^9\n\n1 \\leq a < b \\leq \\textrm{min}(n, 2 \\times 10^5)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn a b\n\nOutput\n\nPrint the number of bouquets that Akari can make, modulo (10^9 + 7). (If there are no such bouquets, print 0.)\n\nSample Input 1\n\n4 1 3\n\nSample Output 1\n\n7\n\nIn this case, Akari can choose 2 or 4 flowers to make the bouquet.\n\nThere are 6 ways to choose 2 out of the 4 flowers, and 1 way to choose 4, so there are a total of 7 different bouquets that Akari can make.\n\nSample Input 2\n\n1000000000 141421 173205\n\nSample Output 2\n\n34076506\n\nPrint the count modulo (10^9 + 7).", "sample_input": "4 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02768", "source_text": "Score : 400 points\n\nProblem Statement\n\nAkari has n kinds of flowers, one of each kind.\n\nShe is going to choose one or more of these flowers to make a bouquet.\n\nHowever, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b.\n\nHow many different bouquets are there that Akari can make?\n\nFind the count modulo (10^9 + 7).\n\nHere, two bouquets are considered different when there is a flower that is used in one of the bouquets but not in the other bouquet.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq n \\leq 10^9\n\n1 \\leq a < b \\leq \\textrm{min}(n, 2 \\times 10^5)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn a b\n\nOutput\n\nPrint the number of bouquets that Akari can make, modulo (10^9 + 7). (If there are no such bouquets, print 0.)\n\nSample Input 1\n\n4 1 3\n\nSample Output 1\n\n7\n\nIn this case, Akari can choose 2 or 4 flowers to make the bouquet.\n\nThere are 6 ways to choose 2 out of the 4 flowers, and 1 way to choose 4, so there are a total of 7 different bouquets that Akari can make.\n\nSample Input 2\n\n1000000000 141421 173205\n\nSample Output 2\n\n34076506\n\nPrint the count modulo (10^9 + 7).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2409, "cpu_time_ms": 2110, "memory_kb": 1014400}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s858529187", "group_id": "codeNet:p02772", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tlist := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\tresult := \"DENIED\"\n\n\tfor i := 0; i < n; i++ {\n\t\tif list[i]%2 == 0 {\n\t\t\tif list[i]%3 == 0 || list[i]%5 == 0 {\n\t\t\t\tresult = \"APPROVED\"\n\t\t\t} else {\n\t\t\t\tresult = \"DENIED\"\n\t\t\t\tfmt.Println(result)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1581883844, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02772.html", "problem_id": "p02772", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02772/input.txt", "sample_output_relpath": "derived/input_output/data/p02772/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02772/Go/s858529187.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s858529187", "user_id": "u346986631"}, "prompt_components": {"gold_output": "APPROVED\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tlist := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\tresult := \"DENIED\"\n\n\tfor i := 0; i < n; i++ {\n\t\tif list[i]%2 == 0 {\n\t\t\tif list[i]%3 == 0 || list[i]%5 == 0 {\n\t\t\t\tresult = \"APPROVED\"\n\t\t\t} else {\n\t\t\t\tresult = \"DENIED\"\n\t\t\t\tfmt.Println(result)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.\n\nAccording to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:\n\nAll even numbers written on the document are divisible by 3 or 5.\n\nIf the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.\n\nNotes\n\nThe condition in the statement can be rephrased as \"If x is an even number written on the document, x is divisible by 3 or 5\".\nHere \"if\" and \"or\" are logical terms.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nIf the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.\n\nSample Input 1\n\n5\n6 7 9 10 31\n\nSample Output 1\n\nAPPROVED\n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\nSample Input 2\n\n3\n28 27 24\n\nSample Output 2\n\nDENIED\n\n28 violates the condition, so the immigrant should not be allowed entry.", "sample_input": "5\n6 7 9 10 31\n"}, "reference_outputs": ["APPROVED\n"], "source_document_id": "p02772", "source_text": "Score: 200 points\n\nProblem Statement\n\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.\n\nAccording to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:\n\nAll even numbers written on the document are divisible by 3 or 5.\n\nIf the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.\n\nNotes\n\nThe condition in the statement can be rephrased as \"If x is an even number written on the document, x is divisible by 3 or 5\".\nHere \"if\" and \"or\" are logical terms.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nIf the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.\n\nSample Input 1\n\n5\n6 7 9 10 31\n\nSample Output 1\n\nAPPROVED\n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\nSample Input 2\n\n3\n28 27 24\n\nSample Output 2\n\nDENIED\n\n28 violates the condition, so the immigrant should not be allowed entry.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 387, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s288109064", "group_id": "codeNet:p02773", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ts := map[string]int{}\n\tmax := 1\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp string\n\t\tfmt.Scan(&tmp)\n\t\t_, exists := s[tmp]\n\t\tif !exists {\n\t\t\ts[tmp] = 1\n\t\t} else {\n\t\t\ts[tmp]++\n\t\t\tif max < s[tmp] {\n\t\t\t\tmax = s[tmp]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor k, v := range s {\n\t\tif v == max {\n\t\t\tfmt.Println(k)\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588023881, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02773.html", "problem_id": "p02773", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02773/input.txt", "sample_output_relpath": "derived/input_output/data/p02773/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02773/Go/s288109064.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s288109064", "user_id": "u432333240"}, "prompt_components": {"gold_output": "beet\nvet\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ts := map[string]int{}\n\tmax := 1\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp string\n\t\tfmt.Scan(&tmp)\n\t\t_, exists := s[tmp]\n\t\tif !exists {\n\t\t\ts[tmp] = 1\n\t\t} else {\n\t\t\ts[tmp]++\n\t\t\tif max < s[tmp] {\n\t\t\t\tmax = s[tmp]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor k, v := range s {\n\t\tif v == max {\n\t\t\tfmt.Println(k)\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "sample_input": "7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n"}, "reference_outputs": ["beet\nvet\n"], "source_document_id": "p02773", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 357, "cpu_time_ms": 1671, "memory_kb": 20480}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s119469186", "group_id": "codeNet:p02773", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tn := readi()\n\ts := make(map[string]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ttmp := reads()\n\t\ts[tmp]++\n\t}\n\ta := List{}\n\tb := List{}\n\tfor k, v := range s {\n\t\te := Entry{k, v}\n\t\ta = append(a, e)\n\t}\n\tsort.Sort(a)\n\n\tvar max int\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tif i == len(a)-1 {\n\t\t\tmax = a[i].value\n\t\t}\n\t\tif a[i].value != max {\n\t\t\tbreak\n\t\t}\n\t\te := Entry{a[i].name, a[i].value}\n\t\tb = append(b, e)\n\t}\n\tsort.Sort(b)\n\tfor i := 0; i < len(b); i++ {\n\t\tfmt.Println(b[i].name)\n\t}\n}\n\n// Entry hoge\ntype Entry struct {\n\tname string\n\tvalue int\n}\n\n// List hoge\ntype List []Entry\n\nfunc (l List) Len() int {\n\treturn len(l)\n}\n\nfunc (l List) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc (l List) Less(i, j int) bool {\n\tif l[i].value == l[j].value {\n\t\treturn (l[i].name < l[j].name)\n\t}\n\treturn (l[i].value < l[j].value)\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}", "language": "Go", "metadata": {"date": 1581885359, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02773.html", "problem_id": "p02773", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02773/input.txt", "sample_output_relpath": "derived/input_output/data/p02773/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02773/Go/s119469186.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s119469186", "user_id": "u963686413"}, "prompt_components": {"gold_output": "beet\nvet\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tn := readi()\n\ts := make(map[string]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ttmp := reads()\n\t\ts[tmp]++\n\t}\n\ta := List{}\n\tb := List{}\n\tfor k, v := range s {\n\t\te := Entry{k, v}\n\t\ta = append(a, e)\n\t}\n\tsort.Sort(a)\n\n\tvar max int\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tif i == len(a)-1 {\n\t\t\tmax = a[i].value\n\t\t}\n\t\tif a[i].value != max {\n\t\t\tbreak\n\t\t}\n\t\te := Entry{a[i].name, a[i].value}\n\t\tb = append(b, e)\n\t}\n\tsort.Sort(b)\n\tfor i := 0; i < len(b); i++ {\n\t\tfmt.Println(b[i].name)\n\t}\n}\n\n// Entry hoge\ntype Entry struct {\n\tname string\n\tvalue int\n}\n\n// List hoge\ntype List []Entry\n\nfunc (l List) Len() int {\n\treturn len(l)\n}\n\nfunc (l List) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc (l List) Less(i, j int) bool {\n\tif l[i].value == l[j].value {\n\t\treturn (l[i].name < l[j].name)\n\t}\n\treturn (l[i].value < l[j].value)\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "sample_input": "7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n"}, "reference_outputs": ["beet\nvet\n"], "source_document_id": "p02773", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3085, "cpu_time_ms": 1945, "memory_kb": 44416}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s938061101", "group_id": "codeNet:p02777", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s, t, u string\n\tvar a, b int\n\tfmt.Scan(&s, &t)\n\tfmt.Scan(&a, &b)\n\tfmt.Scan(&u)\n\n\tif u == s {\n\t\ta--\n\t} else if u == t {\n\t\tb--\n\t}\n\n\tfmt.Println(a, b)\n}\n", "language": "Go", "metadata": {"date": 1587679466, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02777.html", "problem_id": "p02777", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02777/input.txt", "sample_output_relpath": "derived/input_output/data/p02777/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02777/Go/s938061101.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938061101", "user_id": "u432333240"}, "prompt_components": {"gold_output": "2 4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s, t, u string\n\tvar a, b int\n\tfmt.Scan(&s, &t)\n\tfmt.Scan(&a, &b)\n\tfmt.Scan(&u)\n\n\tif u == s {\n\t\ta--\n\t} else if u == t {\n\t\tb--\n\t}\n\n\tfmt.Println(a, b)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "sample_input": "red blue\n3 4\nred\n"}, "reference_outputs": ["2 4\n"], "source_document_id": "p02777", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 202, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s575600119", "group_id": "codeNet:p02777", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := next()\n\tt := next()\n\n\ta := nextInt()\n\tb := nextInt()\n\n\tu := next()\n\n\tswitch u {\n\tcase s:\n\t\ta--\n\tcase t:\n\t\tb--\n\t}\n\n\tfmt.Printf(\"%d %d\\n\", a, b)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1581345442, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02777.html", "problem_id": "p02777", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02777/input.txt", "sample_output_relpath": "derived/input_output/data/p02777/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02777/Go/s575600119.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s575600119", "user_id": "u449989979"}, "prompt_components": {"gold_output": "2 4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := next()\n\tt := next()\n\n\ta := nextInt()\n\tb := nextInt()\n\n\tu := next()\n\n\tswitch u {\n\tcase s:\n\t\ta--\n\tcase t:\n\t\tb--\n\t}\n\n\tfmt.Printf(\"%d %d\\n\", a, b)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "sample_input": "red blue\n3 4\nred\n"}, "reference_outputs": ["2 4\n"], "source_document_id": "p02777", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 405, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s724385570", "group_id": "codeNet:p02778", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tcount := len(readLine())\n\tloop(0, count, func(i int) {\n\t\tfmt.Print(\"x\")\n\t})\n}\n\nfunc loop(start, end int, f func(i int)) {\n\tfor i := start; i < end; i++ {\n\t\tf(i)\n\t}\n}\n\nfunc readLine() string {\n\tvar v string\n\tfmt.Scanln(&v)\n\treturn v\n}", "language": "Go", "metadata": {"date": 1583702369, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02778.html", "problem_id": "p02778", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02778/input.txt", "sample_output_relpath": "derived/input_output/data/p02778/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02778/Go/s724385570.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s724385570", "user_id": "u121595121"}, "prompt_components": {"gold_output": "xxxxxxx\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tcount := len(readLine())\n\tloop(0, count, func(i int) {\n\t\tfmt.Print(\"x\")\n\t})\n}\n\nfunc loop(start, end int, f func(i int)) {\n\tfor i := start; i < end; i++ {\n\t\tf(i)\n\t}\n}\n\nfunc readLine() string {\n\tvar v string\n\tfmt.Scanln(&v)\n\treturn v\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "sample_input": "sardine\n"}, "reference_outputs": ["xxxxxxx\n"], "source_document_id": "p02778", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 281, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s756997191", "group_id": "codeNet:p02778", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar s string\n\tFscan(in, &s)\n\tFprintln(out, strings.Repeat(\"x\", len(s)))\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "language": "Go", "metadata": {"date": 1581867681, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02778.html", "problem_id": "p02778", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02778/input.txt", "sample_output_relpath": "derived/input_output/data/p02778/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02778/Go/s756997191.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s756997191", "user_id": "u235132324"}, "prompt_components": {"gold_output": "xxxxxxx\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar s string\n\tFscan(in, &s)\n\tFprintln(out, strings.Repeat(\"x\", len(s)))\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "sample_input": "sardine\n"}, "reference_outputs": ["xxxxxxx\n"], "source_document_id": "p02778", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 298, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s160167673", "group_id": "codeNet:p02778", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tfmt.Print(\"x\")\n\t}\n\tfmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1581278690, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02778.html", "problem_id": "p02778", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02778/input.txt", "sample_output_relpath": "derived/input_output/data/p02778/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02778/Go/s160167673.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s160167673", "user_id": "u461993794"}, "prompt_components": {"gold_output": "xxxxxxx\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tfmt.Print(\"x\")\n\t}\n\tfmt.Println()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "sample_input": "sardine\n"}, "reference_outputs": ["xxxxxxx\n"], "source_document_id": "p02778", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 139, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s426682821", "group_id": "codeNet:p02779", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[i] == a[j] && i != j {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1581281833, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02779/input.txt", "sample_output_relpath": "derived/input_output/data/p02779/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02779/Go/s426682821.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s426682821", "user_id": "u572998669"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[i] == a[j] && i != j {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "sample_input": "5\n2 6 1 4 5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02779", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 293, "cpu_time_ms": 2108, "memory_kb": 7040}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s689858487", "group_id": "codeNet:p02781", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Solve() {\n N := NextLine()\n var K int\n NextInt(&K)\n L := len(N)\n ans := 0\n C := make([][]int, len(N))\n for i := range C {\n C[i] = make([]int, 4)\n C[i][0] = 1\n C[i][1] = 9 * (L - 1 - i)\n C[i][2] = 81 * (L - 1 - i) * (L - 2 - i) / 2\n C[i][3] = 729 * (L - 1 - i) * (L - 2 - i) * (L - 3 - i) / 6\n }\n fixed := 0\n for i, s := range N {\n n := int(s) - int('0')\n if K < fixed { continue }\n ans += C[i][K - fixed]\n if fixed < K && 0 < n { ans += (n - 1) * C[i][K - fixed - 1] }\n fixed++\n }\n if fixed == K { ans++ }\n Write(ans)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1581281942, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02781.html", "problem_id": "p02781", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02781/input.txt", "sample_output_relpath": "derived/input_output/data/p02781/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02781/Go/s689858487.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s689858487", "user_id": "u415905784"}, "prompt_components": {"gold_output": "19\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Solve() {\n N := NextLine()\n var K int\n NextInt(&K)\n L := len(N)\n ans := 0\n C := make([][]int, len(N))\n for i := range C {\n C[i] = make([]int, 4)\n C[i][0] = 1\n C[i][1] = 9 * (L - 1 - i)\n C[i][2] = 81 * (L - 1 - i) * (L - 2 - i) / 2\n C[i][3] = 729 * (L - 1 - i) * (L - 2 - i) * (L - 3 - i) / 6\n }\n fixed := 0\n for i, s := range N {\n n := int(s) - int('0')\n if K < fixed { continue }\n ans += C[i][K - fixed]\n if fixed < K && 0 < n { ans += (n - 1) * C[i][K - fixed - 1] }\n fixed++\n }\n if fixed == K { ans++ }\n Write(ans)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFind the number of integers between 1 and N (inclusive) that contains exactly K non-zero digits when written in base ten.\n\nConstraints\n\n1 \\leq N < 10^{100}\n\n1 \\leq K \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n100\n1\n\nSample Output 1\n\n19\n\nThe following 19 integers satisfy the condition:\n\n1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100\n\nSample Input 2\n\n25\n2\n\nSample Output 2\n\n14\n\nThe following 14 integers satisfy the condition:\n\n11,12,13,14,15,16,17,18,19,21,22,23,24,25\n\nSample Input 3\n\n314159\n2\n\nSample Output 3\n\n937\n\nSample Input 4\n\n9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n3\n\nSample Output 4\n\n117879300", "sample_input": "100\n1\n"}, "reference_outputs": ["19\n"], "source_document_id": "p02781", "source_text": "Score : 500 points\n\nProblem Statement\n\nFind the number of integers between 1 and N (inclusive) that contains exactly K non-zero digits when written in base ten.\n\nConstraints\n\n1 \\leq N < 10^{100}\n\n1 \\leq K \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nK\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n100\n1\n\nSample Output 1\n\n19\n\nThe following 19 integers satisfy the condition:\n\n1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100\n\nSample Input 2\n\n25\n2\n\nSample Output 2\n\n14\n\nThe following 14 integers satisfy the condition:\n\n11,12,13,14,15,16,17,18,19,21,22,23,24,25\n\nSample Input 3\n\n314159\n2\n\nSample Output 3\n\n937\n\nSample Input 4\n\n9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n3\n\nSample Output 4\n\n117879300", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1862, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s422178878", "group_id": "codeNet:p02783", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n\nfunc next() int {\n sc.Scan()\n text, err := strconv.Atoi(sc.Text())\n if err != nil {\n panic(err)\n }\n return text\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n h := next()\n a := next()\n \n count := h / a\n if h % a != 0 {\n count++\n }\n fmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1581274040, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02783.html", "problem_id": "p02783", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02783/input.txt", "sample_output_relpath": "derived/input_output/data/p02783/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02783/Go/s422178878.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s422178878", "user_id": "u414021949"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n\nfunc next() int {\n sc.Scan()\n text, err := strconv.Atoi(sc.Text())\n if err != nil {\n panic(err)\n }\n return text\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n h := next()\n a := next()\n \n count := h / a\n if h % a != 0 {\n count++\n }\n fmt.Println(count)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "sample_input": "10 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02783", "source_text": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 370, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s726648758", "group_id": "codeNet:p02783", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar hp int\n\tvar ap int\n\tvar ans int\n\tfmt.Scan(&hp, &ap)\n\tans = hp/ap + 1\n\tfmt.Print(ans)\n}\n", "language": "Go", "metadata": {"date": 1580677695, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02783.html", "problem_id": "p02783", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02783/input.txt", "sample_output_relpath": "derived/input_output/data/p02783/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02783/Go/s726648758.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s726648758", "user_id": "u239559311"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar hp int\n\tvar ap int\n\tvar ans int\n\tfmt.Scan(&hp, &ap)\n\tans = hp/ap + 1\n\tfmt.Print(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "sample_input": "10 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02783", "source_text": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 134, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s823769327", "group_id": "codeNet:p02783", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h = 0\n\tvar a = 0\n\tfmt.Scan(&h, &a)\n\t\n\tfmt.Println( (h / a) + 1)\n}", "language": "Go", "metadata": {"date": 1580166952, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02783.html", "problem_id": "p02783", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02783/input.txt", "sample_output_relpath": "derived/input_output/data/p02783/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02783/Go/s823769327.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s823769327", "user_id": "u610770250"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h = 0\n\tvar a = 0\n\tfmt.Scan(&h, &a)\n\t\n\tfmt.Println( (h / a) + 1)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "sample_input": "10 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02783", "source_text": "Score : 100 points\n\nProblem Statement\n\nServal is fighting with a monster.\n\nThe health of the monster is H.\n\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\n\nServal wins when the monster's health becomes 0 or below.\n\nFind the number of attacks Serval needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq A \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH A\n\nOutput\n\nPrint the number of attacks Serval needs to make before winning.\n\nSample Input 1\n\n10 4\n\nSample Output 1\n\n3\n\nAfter one attack, the monster's health will be 6.\n\nAfter two attacks, the monster's health will be 2.\n\nAfter three attacks, the monster's health will be -2.\n\nThus, Serval needs to make three attacks to win.\n\nSample Input 2\n\n1 10000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n10000 1\n\nSample Output 3\n\n10000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 112, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s720714575", "group_id": "codeNet:p02784", "input_text": "package main\nimport \"fmt\"\nfunc main(){\n var h, n int\n fmt.Scan(&h,&n)\n var sum int\n for i := 0; i < n; i++{\n var a int\n fmt.Scan(&a)\n sum += a\n }\n if sum >= h{\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1580077873, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02784.html", "problem_id": "p02784", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02784/input.txt", "sample_output_relpath": "derived/input_output/data/p02784/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02784/Go/s720714575.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s720714575", "user_id": "u511854420"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\nimport \"fmt\"\nfunc main(){\n var h, n int\n fmt.Scan(&h,&n)\n var sum int\n for i := 0; i < n; i++{\n var a int\n fmt.Scan(&a)\n sum += a\n }\n if sum >= h{\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "sample_input": "10 3\n4 5 6\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02784", "source_text": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 271, "cpu_time_ms": 429, "memory_kb": 7684}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s820329373", "group_id": "codeNet:p02784", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, n int\n\tfmt.Scan(&h, &n)\n\n\tsum := 0\n\tvar a int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tsum += a\n\t}\n\n\tif h <= sum {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1580069084, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02784.html", "problem_id": "p02784", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02784/input.txt", "sample_output_relpath": "derived/input_output/data/p02784/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02784/Go/s820329373.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s820329373", "user_id": "u902409225"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, n int\n\tfmt.Scan(&h, &n)\n\n\tsum := 0\n\tvar a int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tsum += a\n\t}\n\n\tif h <= sum {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "sample_input": "10 3\n4 5 6\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02784", "source_text": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 223, "cpu_time_ms": 445, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s761312832", "group_id": "codeNet:p02786", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc solve(H int, ans int, count int) int {\n\n\tif H == 0 {\n\t\treturn ans\n\t}\n\tH = int(math.Floor(float64(H) / 2))\n\tans += count\n\tcount *= 2\n\treturn solve(H, ans, count)\n}\n\nfunc main() {\n\t// Code for D - Caracal vs Monster\n\tvar H int\n\tfmt.Scanf(\"%d\", &H)\n\n\tfmt.Println(solve(H, 0, 1))\n}\n", "language": "Go", "metadata": {"date": 1598930430, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02786.html", "problem_id": "p02786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02786/input.txt", "sample_output_relpath": "derived/input_output/data/p02786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02786/Go/s761312832.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s761312832", "user_id": "u128015095"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc solve(H int, ans int, count int) int {\n\n\tif H == 0 {\n\t\treturn ans\n\t}\n\tH = int(math.Floor(float64(H) / 2))\n\tans += count\n\tcount *= 2\n\treturn solve(H, ans, count)\n}\n\nfunc main() {\n\t// Code for D - Caracal vs Monster\n\tvar H int\n\tfmt.Scanf(\"%d\", &H)\n\n\tfmt.Println(solve(H, 0, 1))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "sample_input": "2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02786", "source_text": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 324, "cpu_time_ms": 3, "memory_kb": 1840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s409570798", "group_id": "codeNet:p02786", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\th := iScan()\n\tans := 0\n\tx := 1\n\tfor h != 0 {\n\t\tans += x\n\t\tx *= 2\n\t\th /= 2\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1597397419, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02786.html", "problem_id": "p02786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02786/input.txt", "sample_output_relpath": "derived/input_output/data/p02786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02786/Go/s409570798.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s409570798", "user_id": "u843722521"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\th := iScan()\n\tans := 0\n\tx := 1\n\tfor h != 0 {\n\t\tans += x\n\t\tx *= 2\n\t\th /= 2\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "sample_input": "2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02786", "source_text": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1299, "cpu_time_ms": 3, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s355763146", "group_id": "codeNet:p02786", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar H int\n\tfmt.Scan(&H)\n\n\tif H == 1 {\n\t\tH = 0\n\t}\n\n\tcnt := 1\n\tfor {\n\t\tH = H / 2\n\t\tcnt++\n\t\tif H <= 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(int(math.Pow(float64(2), float64(cnt))) - 1)\n}\n", "language": "Go", "metadata": {"date": 1582326378, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02786.html", "problem_id": "p02786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02786/input.txt", "sample_output_relpath": "derived/input_output/data/p02786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02786/Go/s355763146.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s355763146", "user_id": "u799236543"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar H int\n\tfmt.Scan(&H)\n\n\tif H == 1 {\n\t\tH = 0\n\t}\n\n\tcnt := 1\n\tfor {\n\t\tH = H / 2\n\t\tcnt++\n\t\tif H <= 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(int(math.Pow(float64(2), float64(cnt))) - 1)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "sample_input": "2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02786", "source_text": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 233, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s037517805", "group_id": "codeNet:p02786", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar H int\n\tEnemyCount := 1\n\tcount := 0\n\n\tfmt.Scanf(\"%d\", &H)\n\tEnemyHP := H\n\n\tfor {\n\t\tif H > 1 {\n\t\t\tcount += EnemyCount\n\t\t\tEnemyHP /= 2\n\t\t\tEnemyCount *= 2\n\t\t\tif EnemyHP == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Printf(\"%d\", count)\n\n}\n", "language": "Go", "metadata": {"date": 1580071792, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02786.html", "problem_id": "p02786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02786/input.txt", "sample_output_relpath": "derived/input_output/data/p02786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02786/Go/s037517805.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s037517805", "user_id": "u410825686"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar H int\n\tEnemyCount := 1\n\tcount := 0\n\n\tfmt.Scanf(\"%d\", &H)\n\tEnemyHP := H\n\n\tfor {\n\t\tif H > 1 {\n\t\t\tcount += EnemyCount\n\t\t\tEnemyHP /= 2\n\t\t\tEnemyCount *= 2\n\t\t\tif EnemyHP == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Printf(\"%d\", count)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "sample_input": "2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02786", "source_text": "Score : 400 points\n\nProblem Statement\n\nCaracal is fighting with a monster.\n\nThe health of the monster is H.\n\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\nIf the monster's health is 1, it drops to 0.\n\nIf the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \\lfloor X/2 \\rfloor.\n\n(\\lfloor r \\rfloor denotes the greatest integer not exceeding r.)\n\nCaracal wins when the healths of all existing monsters become 0 or below.\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\n\nOutput\n\nFind the minimum number of attacks Caracal needs to make before winning.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of 1.\n\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks.\n\nSample Input 2\n\n4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n1000000000000\n\nSample Output 3\n\n1099511627775", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 270, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s958326534", "group_id": "codeNet:p02788", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype BIT [2][]int\n\nfunc NewBIT(n int) *BIT {\n\tvar b BIT\n\tfor i := range b {\n\t\tb[i] = make([]int, n)\n\t}\n\treturn &b\n}\n\n// [l,r)にxを加算\nfunc (b *BIT) add(l, r, x int) {\n\tadd_sub := func(p, idx, x int) {\n\t\tfor idx < len(b[p]) {\n\t\t\tb[p][idx] += x\n\t\t\tidx += idx & (-idx)\n\t\t}\n\t}\n\tadd_sub(0, l, -x*(l-1))\n\tadd_sub(0, r, x*(r-1))\n\tadd_sub(1, l, x)\n\tadd_sub(1, r, -x)\n}\n\n// [l,r)の和\nfunc (b *BIT) sum(l, r int) int {\n\tsum_sub := func(p, idx int) int {\n\t\ts := 0\n\t\tfor idx > 0 {\n\t\t\ts += b[p][idx]\n\t\t\tidx -= idx & (-idx)\n\t\t}\n\t\treturn s\n\t}\n\treturn sum_sub(0, r-1) + sum_sub(1, r-1)*(r-1) - (sum_sub(0, l-1) + sum_sub(1, l-1)*(l-1))\n}\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\ntype Mon struct {\n\tx, h int\n}\n\ntype Mons []Mon\n\nfunc (a Mons) Len() int { return len(a) }\nfunc (a Mons) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Mons) Less(i, j int) bool {\n\treturn a[i].x < a[j].x\n}\n\nfunc upperBound(a []int, key int) int {\n\tl, r := 0, len(a)-1\n\tfor l <= r {\n\t\tmid := (l + r) / 2\n\t\tif a[mid] <= key {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid - 1\n\t\t}\n\t}\n\treturn l\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, d, a := nextInt(), nextInt(), nextInt()\n\tmons := make(Mons, n)\n\tfor i := 0; i < n; i++ {\n\t\tx, h := nextInt(), nextInt()\n\t\tmons[i] = Mon{x, h}\n\t}\n\tsort.Sort(mons)\n\tx, h := make([]int, n), make([]int, n)\n\tfor i := range mons {\n\t\tx[i], h[i] = mons[i].x, mons[i].h\n\t}\n\n\tbit := NewBIT(n + 10)\n\tfor i := 0; i < n; i++ {\n\t\tbit.add(i+1, i+2, h[i])\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tcur := bit.sum(i+1, i+2)\n\t\tif cur <= 0 {\n\t\t\tcontinue\n\t\t}\n\t\tneed := (cur + a - 1) / a\n\t\tr := upperBound(x, x[i]+2*d)\n\t\tbit.add(i+1, r+1, -need*a)\n\t\tans += need\n\t}\n\n\tputs(ans)\n}\n", "language": "Go", "metadata": {"date": 1592750350, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02788.html", "problem_id": "p02788", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02788/input.txt", "sample_output_relpath": "derived/input_output/data/p02788/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02788/Go/s958326534.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s958326534", "user_id": "u502813058"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype BIT [2][]int\n\nfunc NewBIT(n int) *BIT {\n\tvar b BIT\n\tfor i := range b {\n\t\tb[i] = make([]int, n)\n\t}\n\treturn &b\n}\n\n// [l,r)にxを加算\nfunc (b *BIT) add(l, r, x int) {\n\tadd_sub := func(p, idx, x int) {\n\t\tfor idx < len(b[p]) {\n\t\t\tb[p][idx] += x\n\t\t\tidx += idx & (-idx)\n\t\t}\n\t}\n\tadd_sub(0, l, -x*(l-1))\n\tadd_sub(0, r, x*(r-1))\n\tadd_sub(1, l, x)\n\tadd_sub(1, r, -x)\n}\n\n// [l,r)の和\nfunc (b *BIT) sum(l, r int) int {\n\tsum_sub := func(p, idx int) int {\n\t\ts := 0\n\t\tfor idx > 0 {\n\t\t\ts += b[p][idx]\n\t\t\tidx -= idx & (-idx)\n\t\t}\n\t\treturn s\n\t}\n\treturn sum_sub(0, r-1) + sum_sub(1, r-1)*(r-1) - (sum_sub(0, l-1) + sum_sub(1, l-1)*(l-1))\n}\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\ntype Mon struct {\n\tx, h int\n}\n\ntype Mons []Mon\n\nfunc (a Mons) Len() int { return len(a) }\nfunc (a Mons) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Mons) Less(i, j int) bool {\n\treturn a[i].x < a[j].x\n}\n\nfunc upperBound(a []int, key int) int {\n\tl, r := 0, len(a)-1\n\tfor l <= r {\n\t\tmid := (l + r) / 2\n\t\tif a[mid] <= key {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid - 1\n\t\t}\n\t}\n\treturn l\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, d, a := nextInt(), nextInt(), nextInt()\n\tmons := make(Mons, n)\n\tfor i := 0; i < n; i++ {\n\t\tx, h := nextInt(), nextInt()\n\t\tmons[i] = Mon{x, h}\n\t}\n\tsort.Sort(mons)\n\tx, h := make([]int, n), make([]int, n)\n\tfor i := range mons {\n\t\tx[i], h[i] = mons[i].x, mons[i].h\n\t}\n\n\tbit := NewBIT(n + 10)\n\tfor i := 0; i < n; i++ {\n\t\tbit.add(i+1, i+2, h[i])\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tcur := bit.sum(i+1, i+2)\n\t\tif cur <= 0 {\n\t\t\tcontinue\n\t\t}\n\t\tneed := (cur + a - 1) / a\n\t\tr := upperBound(x, x[i]+2*d)\n\t\tbit.add(i+1, r+1, -need*a)\n\t\tans += need\n\t}\n\n\tputs(ans)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSilver Fox is fighting with N monsters.\n\nThe monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the health of H_i.\n\nSilver Fox can use bombs to attack the monsters.\nUsing a bomb at the coordinate x decreases the healths of all monsters between the coordinates x-D and x+D (inclusive) by A.\nThere is no way other than bombs to decrease the monster's health.\n\nSilver Fox wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of bombs needed to win.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq D \\leq 10^9\n\n1 \\leq A \\leq 10^9\n\n0 \\leq X_i \\leq 10^9\n\n1 \\leq H_i \\leq 10^9\n\nX_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D A\nX_1 H_1\n:\nX_N H_N\n\nOutput\n\nPrint the minimum number of bombs needed to win.\n\nSample Input 1\n\n3 3 2\n1 2\n5 4\n9 2\n\nSample Output 1\n\n2\n\nFirst, let us use a bomb at the coordinate 4 to decrease the first and second monsters' health by 2.\n\nThen, use a bomb at the coordinate 6 to decrease the second and third monsters' health by 2.\n\nNow, all the monsters' healths are 0.\nWe cannot make all the monsters' health drop to 0 or below with just one bomb.\n\nSample Input 2\n\n9 4 1\n1 5\n2 4\n3 3\n4 2\n5 1\n6 2\n7 3\n8 4\n9 5\n\nSample Output 2\n\n5\n\nWe should use five bombs at the coordinate 5.\n\nSample Input 3\n\n3 0 1\n300000000 1000000000\n100000000 1000000000\n200000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 3 2\n1 2\n5 4\n9 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02788", "source_text": "Score : 600 points\n\nProblem Statement\n\nSilver Fox is fighting with N monsters.\n\nThe monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the health of H_i.\n\nSilver Fox can use bombs to attack the monsters.\nUsing a bomb at the coordinate x decreases the healths of all monsters between the coordinates x-D and x+D (inclusive) by A.\nThere is no way other than bombs to decrease the monster's health.\n\nSilver Fox wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of bombs needed to win.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq D \\leq 10^9\n\n1 \\leq A \\leq 10^9\n\n0 \\leq X_i \\leq 10^9\n\n1 \\leq H_i \\leq 10^9\n\nX_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D A\nX_1 H_1\n:\nX_N H_N\n\nOutput\n\nPrint the minimum number of bombs needed to win.\n\nSample Input 1\n\n3 3 2\n1 2\n5 4\n9 2\n\nSample Output 1\n\n2\n\nFirst, let us use a bomb at the coordinate 4 to decrease the first and second monsters' health by 2.\n\nThen, use a bomb at the coordinate 6 to decrease the second and third monsters' health by 2.\n\nNow, all the monsters' healths are 0.\nWe cannot make all the monsters' health drop to 0 or below with just one bomb.\n\nSample Input 2\n\n9 4 1\n1 5\n2 4\n3 3\n4 2\n5 1\n6 2\n7 3\n8 4\n9 5\n\nSample Output 2\n\n5\n\nWe should use five bombs at the coordinate 5.\n\nSample Input 3\n\n3 0 1\n300000000 1000000000\n100000000 1000000000\n200000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2077, "cpu_time_ms": 162, "memory_kb": 15500}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s387690525", "group_id": "codeNet:p02789", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tsetSpace()\n\n\tm, n := readN(), readN()\n\n\tif m == n {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\n// ------以下、ユーティリティ------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc setSpace() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readN() int {\n\tn, err := strconv.Atoi(read())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1580054208, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02789.html", "problem_id": "p02789", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02789/input.txt", "sample_output_relpath": "derived/input_output/data/p02789/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02789/Go/s387690525.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s387690525", "user_id": "u499497733"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tsetSpace()\n\n\tm, n := readN(), readN()\n\n\tif m == n {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\n// ------以下、ユーティリティ------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc setSpace() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readN() int {\n\tn, err := strconv.Atoi(read())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.\n\nThe problem has N test cases, all of which must be passed to get an AC verdict.\n\nTakahashi's submission has passed M cases out of the N test cases.\n\nDetermine whether Takahashi's submission gets an AC.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq M \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nIf Takahashi's submission gets an AC, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\nYes\n\nAll three test cases have been passed, so his submission gets an AC.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\nNo\n\nOnly two out of the three test cases have been passed, so his submission does not get an AC.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\nYes", "sample_input": "3 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02789", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.\n\nThe problem has N test cases, all of which must be passed to get an AC verdict.\n\nTakahashi's submission has passed M cases out of the N test cases.\n\nDetermine whether Takahashi's submission gets an AC.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq M \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nIf Takahashi's submission gets an AC, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\nYes\n\nAll three test cases have been passed, so his submission gets an AC.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\nNo\n\nOnly two out of the three test cases have been passed, so his submission does not get an AC.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 485, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s739828920", "group_id": "codeNet:p02790", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tvar A, B string\n\tfor i := 0; i < b; i++ {\n\t\tA += strconv.Itoa(a)\n\t}\n\tfor i := 0; i < a; i++ {\n\t\tB += strconv.Itoa(b)\n\t}\n\n\tif A < B {\n\t\tfmt.Println(A)\n\t} else {\n\t\tfmt.Println(B)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588791062, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02790.html", "problem_id": "p02790", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02790/input.txt", "sample_output_relpath": "derived/input_output/data/p02790/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02790/Go/s739828920.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s739828920", "user_id": "u214033538"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tvar A, B string\n\tfor i := 0; i < b; i++ {\n\t\tA += strconv.Itoa(a)\n\t}\n\tfor i := 0; i < a; i++ {\n\t\tB += strconv.Itoa(b)\n\t}\n\n\tif A < B {\n\t\tfmt.Println(A)\n\t} else {\n\t\tfmt.Println(B)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "sample_input": "4 3\n"}, "reference_outputs": ["3333\n"], "source_document_id": "p02790", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 274, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s647300698", "group_id": "codeNet:p02790", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tsetSpace()\n\ta, b := readN(), readN()\n\ts, l := 0, 0\n\tif a < b {\n\t\ts, l = a, b\n\t} else {\n\t\ts, l = b, a\n\t}\n\tfor i := 0; i < l; i++ {\n\t\tfmt.Printf(strconv.Itoa(s))\n\t}\n\tfmt.Println(\"\")\n}\n\n// ------以下、ユーティリティ------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc setSpace() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readN() int {\n\tn, err := strconv.Atoi(read())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1580054612, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02790.html", "problem_id": "p02790", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02790/input.txt", "sample_output_relpath": "derived/input_output/data/p02790/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02790/Go/s647300698.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s647300698", "user_id": "u499497733"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tsetSpace()\n\ta, b := readN(), readN()\n\ts, l := 0, 0\n\tif a < b {\n\t\ts, l = a, b\n\t} else {\n\t\ts, l = b, a\n\t}\n\tfor i := 0; i < l; i++ {\n\t\tfmt.Printf(strconv.Itoa(s))\n\t}\n\tfmt.Println(\"\")\n}\n\n// ------以下、ユーティリティ------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc setSpace() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readN() int {\n\tn, err := strconv.Atoi(read())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "sample_input": "4 3\n"}, "reference_outputs": ["3333\n"], "source_document_id": "p02790", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\nConstraints\n\n1 \\leq a \\leq 9\n\n1 \\leq b \\leq 9\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)\n\nSample Input 1\n\n4 3\n\nSample Output 1\n\n3333\n\nWe have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.\n\nSample Input 2\n\n7 7\n\nSample Output 2\n\n7777777", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 561, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s308115466", "group_id": "codeNet:p02791", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 1000000\n)\n\nvar sc *bufio.Scanner\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\treturn sc\n}\n\nfunc main() {\n\tsc = initScanner(os.Stdin)\n\tfmt.Println(resolve(parseProblem()))\n}\n\nfunc parseProblem() int {\n\tn := scanInt(sc)\n\tcount, min := 0, math.MaxInt32\n\tfor i := 0; i < n; i++ {\n\t\tv := scanInt(sc)\n\t\tif v < min {\n\t\t\tcount++\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn count\n}\n\nfunc resolve(n int) int {\n\treturn n\n}\n\n// snip-scan-funcs\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}", "language": "Go", "metadata": {"date": 1592907232, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/Go/s308115466.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s308115466", "user_id": "u623007471"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 1000000\n)\n\nvar sc *bufio.Scanner\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\treturn sc\n}\n\nfunc main() {\n\tsc = initScanner(os.Stdin)\n\tfmt.Println(resolve(parseProblem()))\n}\n\nfunc parseProblem() int {\n\tn := scanInt(sc)\n\tcount, min := 0, math.MaxInt32\n\tfor i := 0; i < n; i++ {\n\t\tv := scanInt(sc)\n\t\tif v < min {\n\t\t\tcount++\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn count\n}\n\nfunc resolve(n int) int {\n\treturn n\n}\n\n// snip-scan-funcs\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 779, "cpu_time_ms": 38, "memory_kb": 3264}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s952618913", "group_id": "codeNet:p02791", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar s1,s2 string\n\tif sc.Scan() {\n s1 = sc.Text()\n }\n if sc.Scan() {\n s2 = sc.Text()\n\t}\n\tnums, _ := strconv.Atoi(s1)\n\tslice := strings.Split(s2, \" \")\n\tinputNum := stringToint(slice)\n\n\ttruenums := 0\n\tmin := inputNum[0]\n\tfor i := 0; i < nums; i++ {\n\t\tif min >= inputNum[i] {\n\t\t\tmin = inputNum[i]\n\t\t\ttruenums++\n\t\t}\n\t}\n\tfmt.Println(truenums)\n}\n\nfunc stringToint(s []string) []int {\n\tf := make([]int, len(s))\n\tfor n := range s {\n\t\tf[n], _ = strconv.Atoi(s[n])\n\t}\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1579471207, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/Go/s952618913.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s952618913", "user_id": "u605443479"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar s1,s2 string\n\tif sc.Scan() {\n s1 = sc.Text()\n }\n if sc.Scan() {\n s2 = sc.Text()\n\t}\n\tnums, _ := strconv.Atoi(s1)\n\tslice := strings.Split(s2, \" \")\n\tinputNum := stringToint(slice)\n\n\ttruenums := 0\n\tmin := inputNum[0]\n\tfor i := 0; i < nums; i++ {\n\t\tif min >= inputNum[i] {\n\t\t\tmin = inputNum[i]\n\t\t\ttruenums++\n\t\t}\n\t}\n\tfmt.Println(truenums)\n}\n\nfunc stringToint(s []string) []int {\n\tf := make([]int, len(s))\n\tfor n := range s {\n\t\tf[n], _ = strconv.Atoi(s[n])\n\t}\n\treturn f\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 610, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s998292784", "group_id": "codeNet:p02792", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readInt()\n\ta := make([][]int, 10)\n\tfor i := range a {\n\t\ta[i] = make([]int, 10)\n\t}\n\n\tfor i := 1; i < n+1; i++ {\n\t\tnb := []byte(strconv.Itoa(i))\n\t\ts, _ := strconv.Atoi(string(nb[0]))\n\t\te, _ := strconv.Atoi(string(nb[len(nb)-1]))\n\t\ta[s][e]++\n\t}\n\n\tans := 0\n\tfor i := range a {\n\t\tfor j := range a {\n\t\t\tans += a[i][j] * a[j][i]\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc main1() {\n\tn := readInt()\n\tnstr := strconv.Itoa(n)\n\tnlen := len(nstr)\n\tnstart, nmid, nend := n, 1, n\n\tif nlen > 1 {\n\t\tnstart, _ = strconv.Atoi(nstr[0:1])\n\t\tnend, _ = strconv.Atoi(nstr[nlen-1:])\n\t}\n\tif nlen > 2 {\n\t\tnmid, _ = strconv.Atoi(nstr[1 : nlen-1])\n\t}\n\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tif i%10 == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\ta := strconv.Itoa(i)\n\t\ts, _ := strconv.Atoi(a[len(a)-1:])\n\t\te, _ := strconv.Atoi(a[0:1])\n\n\t\tif s == e {\n\t\t\tans++\n\t\t}\n\n\t\tfor j := 0; j <= nlen-2; j++ {\n\t\t\tif j < nlen-2 {\n\t\t\t\tans += int(math.Pow(10, float64(j)))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s > nstart {\n\t\t\t\tbreak\n\t\t\t} else if s < nstart {\n\t\t\t\tans += int(math.Pow(10, float64(j)))\n\t\t\t} else {\n\t\t\t\tif e <= nend {\n\t\t\t\t\tans += nmid\n\t\t\t\t} else {\n\t\t\t\t\tans += max(0, nmid-1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// sort ------------------------------------------------------------\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "language": "Go", "metadata": {"date": 1580914097, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02792.html", "problem_id": "p02792", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02792/input.txt", "sample_output_relpath": "derived/input_output/data/p02792/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02792/Go/s998292784.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s998292784", "user_id": "u295946532"}, "prompt_components": {"gold_output": "17\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readInt()\n\ta := make([][]int, 10)\n\tfor i := range a {\n\t\ta[i] = make([]int, 10)\n\t}\n\n\tfor i := 1; i < n+1; i++ {\n\t\tnb := []byte(strconv.Itoa(i))\n\t\ts, _ := strconv.Atoi(string(nb[0]))\n\t\te, _ := strconv.Atoi(string(nb[len(nb)-1]))\n\t\ta[s][e]++\n\t}\n\n\tans := 0\n\tfor i := range a {\n\t\tfor j := range a {\n\t\t\tans += a[i][j] * a[j][i]\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc main1() {\n\tn := readInt()\n\tnstr := strconv.Itoa(n)\n\tnlen := len(nstr)\n\tnstart, nmid, nend := n, 1, n\n\tif nlen > 1 {\n\t\tnstart, _ = strconv.Atoi(nstr[0:1])\n\t\tnend, _ = strconv.Atoi(nstr[nlen-1:])\n\t}\n\tif nlen > 2 {\n\t\tnmid, _ = strconv.Atoi(nstr[1 : nlen-1])\n\t}\n\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tif i%10 == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\ta := strconv.Itoa(i)\n\t\ts, _ := strconv.Atoi(a[len(a)-1:])\n\t\te, _ := strconv.Atoi(a[0:1])\n\n\t\tif s == e {\n\t\t\tans++\n\t\t}\n\n\t\tfor j := 0; j <= nlen-2; j++ {\n\t\t\tif j < nlen-2 {\n\t\t\t\tans += int(math.Pow(10, float64(j)))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s > nstart {\n\t\t\t\tbreak\n\t\t\t} else if s < nstart {\n\t\t\t\tans += int(math.Pow(10, float64(j)))\n\t\t\t} else {\n\t\t\t\tif e <= nend {\n\t\t\t\t\tans += nmid\n\t\t\t\t} else {\n\t\t\t\t\tans += max(0, nmid-1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// sort ------------------------------------------------------------\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "sample_input": "25\n"}, "reference_outputs": ["17\n"], "source_document_id": "p02792", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2961, "cpu_time_ms": 41, "memory_kb": 3840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s182689162", "group_id": "codeNet:p02793", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextInt64s(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt64()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nvar mod = 1000000007\n\nfunc mul(a int, b int) int {\n\treturn ((a % mod) * (b % mod)) % mod\n}\n\nfunc power(x int, y int) int {\n\tif y == 0 {\n\t\treturn 1\n\t} else if y%2 == 0 {\n\t\tans := power(x, y/2) % mod\n\t\tans = mul(ans, ans)\n\t\treturn ans\n\t} else {\n\t\tans := power(x, y/2) % mod\n\t\tans = mul(mul(ans, ans), x)\n\t\treturn ans\n\t}\n}\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := nextInts(n)\n\tvar ans int\n\tm := map[int]int{}\n\tmiList := make([]map[int]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tmi := map[int]int{}\n\t\tres := a[i]\n\t\tfor j := 2; j <= int(math.Sqrt(float64(a[i]))); j++ {\n\t\t\tif res%j == 0 {\n\t\t\t\tc := 0\n\t\t\t\tfor res%j == 0 {\n\t\t\t\t\tc++\n\t\t\t\t\tmi[j]++\n\t\t\t\t\tres = res / j\n\t\t\t\t}\n\t\t\t\tif c > m[j] {\n\t\t\t\t\tm[j] = c\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif res == a[i] {\n\t\t\tmi[res] = 1\n\t\t\t_, exist := m[res]\n\t\t\tif !exist {\n\t\t\t\tm[res] = 1\n\t\t\t}\n\t\t}\n\t\tmiList[i] = mi\n\t}\n\tfmt.Println(\"m\", m)\n\tfor i := 0; i < n; i++ {\n\t\tb := 1\n\t\tmi := miList[i]\n\t\tfmt.Println(\"mi\", mi)\n\t\tfor x, c := range m {\n\t\t\tb = mul(b, power(x, (c-mi[x])))\n\t\t}\n\t\tans = (ans + b) % mod\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1585474028, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02793.html", "problem_id": "p02793", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02793/input.txt", "sample_output_relpath": "derived/input_output/data/p02793/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02793/Go/s182689162.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s182689162", "user_id": "u452900140"}, "prompt_components": {"gold_output": "13\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextInt64s(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt64()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nvar mod = 1000000007\n\nfunc mul(a int, b int) int {\n\treturn ((a % mod) * (b % mod)) % mod\n}\n\nfunc power(x int, y int) int {\n\tif y == 0 {\n\t\treturn 1\n\t} else if y%2 == 0 {\n\t\tans := power(x, y/2) % mod\n\t\tans = mul(ans, ans)\n\t\treturn ans\n\t} else {\n\t\tans := power(x, y/2) % mod\n\t\tans = mul(mul(ans, ans), x)\n\t\treturn ans\n\t}\n}\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := nextInts(n)\n\tvar ans int\n\tm := map[int]int{}\n\tmiList := make([]map[int]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tmi := map[int]int{}\n\t\tres := a[i]\n\t\tfor j := 2; j <= int(math.Sqrt(float64(a[i]))); j++ {\n\t\t\tif res%j == 0 {\n\t\t\t\tc := 0\n\t\t\t\tfor res%j == 0 {\n\t\t\t\t\tc++\n\t\t\t\t\tmi[j]++\n\t\t\t\t\tres = res / j\n\t\t\t\t}\n\t\t\t\tif c > m[j] {\n\t\t\t\t\tm[j] = c\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif res == a[i] {\n\t\t\tmi[res] = 1\n\t\t\t_, exist := m[res]\n\t\t\tif !exist {\n\t\t\t\tm[res] = 1\n\t\t\t}\n\t\t}\n\t\tmiList[i] = mi\n\t}\n\tfmt.Println(\"m\", m)\n\tfor i := 0; i < n; i++ {\n\t\tb := 1\n\t\tmi := miList[i]\n\t\tfmt.Println(\"mi\", mi)\n\t\tfor x, c := range m {\n\t\t\tb = mul(b, power(x, (c-mi[x])))\n\t\t}\n\t\tans = (ans + b) % mod\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n2 3 4\n"}, "reference_outputs": ["13\n"], "source_document_id": "p02793", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2367, "cpu_time_ms": 2104, "memory_kb": 5248}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s691609053", "group_id": "codeNet:p02793", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\t// 100MB\n\tbufsize := 100 * 1024 * 1024\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, bufio.MaxScanTokenSize), bufsize)\n\tsc.Split(bufio.ScanWords)\n}\nfunc readInt() int { return readIntArray(1)[0] }\nfunc readInt2() (int, int) { a := readIntArray(2); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(3); return a[0], a[1], a[2] }\nfunc readIntArray(n int) []int {\n\ts := readStringArray(n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\nfunc readString() string { return readStringArray(1)[0] }\nfunc readString2() (string, string) { a := readStringArray(2); return a[0], a[1] }\nfunc readStringArray(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i] = sc.Text()\n\t}\n\treturn a\n}\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor _, n := range ns {\n\t\tif n > max {\n\t\t\tmax = n\n\t\t}\n\t}\n\treturn max\n}\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor _, n := range ns {\n\t\tif n < min {\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn min\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tN := readInt()\n\tA := readIntArray(N)\n\n\tl := lcm(A...)\n\tB := make([]int, N)\n\tfor i := range A {\n\t\tB[i] = l / A[i]\n\t}\n\tvar result int\n\td := 1000000007\n\tfor i := range B {\n\t\tresult += B[i] % d\n\t\tresult %= d\n\t}\n\tfmt.Println(result)\n}\n\nfunc lcm(ns ...int) int {\n\tl := ns[0]\n\tfor i := range ns {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif l == ns[i] {\n\t\t\tcontinue\n\t\t}\n\n\t\tg := gcd(l, ns[i])\n\t\tl = l * ns[i] / g\n\t}\n\n\treturn l\n}\n\nfunc gcd(m, n int) int {\n\tif m < n {\n\t\tm, n = n, m\n\t}\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\n//func lcm(ns ...int) int {\n//\tlcm := ns[0]\n//\tfor i := range ns {\n//\t\tif i == 0 {\n//\t\t\tcontinue\n//\t\t}\n//\n//\t\ttarget := ns[i]\n//\t\ttargetBase := target\n//\t\tlcmBase := lcm\n//\t\tfor {\n//\t\t\tif lcm == target {\n//\t\t\t\tbreak\n//\t\t\t}\n//\t\t\tif target < lcm {\n//\t\t\t\ttarget += targetBase\n//\t\t\t} else {\n//\t\t\t\tlcm += lcmBase\n//\t\t\t}\n//\t\t}\n//\t}\n//\n//\treturn lcm\n//}\n", "language": "Go", "metadata": {"date": 1579468134, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02793.html", "problem_id": "p02793", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02793/input.txt", "sample_output_relpath": "derived/input_output/data/p02793/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02793/Go/s691609053.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s691609053", "user_id": "u502098699"}, "prompt_components": {"gold_output": "13\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\t// 100MB\n\tbufsize := 100 * 1024 * 1024\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, bufio.MaxScanTokenSize), bufsize)\n\tsc.Split(bufio.ScanWords)\n}\nfunc readInt() int { return readIntArray(1)[0] }\nfunc readInt2() (int, int) { a := readIntArray(2); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(3); return a[0], a[1], a[2] }\nfunc readIntArray(n int) []int {\n\ts := readStringArray(n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\nfunc readString() string { return readStringArray(1)[0] }\nfunc readString2() (string, string) { a := readStringArray(2); return a[0], a[1] }\nfunc readStringArray(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i] = sc.Text()\n\t}\n\treturn a\n}\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor _, n := range ns {\n\t\tif n > max {\n\t\t\tmax = n\n\t\t}\n\t}\n\treturn max\n}\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor _, n := range ns {\n\t\tif n < min {\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn min\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tN := readInt()\n\tA := readIntArray(N)\n\n\tl := lcm(A...)\n\tB := make([]int, N)\n\tfor i := range A {\n\t\tB[i] = l / A[i]\n\t}\n\tvar result int\n\td := 1000000007\n\tfor i := range B {\n\t\tresult += B[i] % d\n\t\tresult %= d\n\t}\n\tfmt.Println(result)\n}\n\nfunc lcm(ns ...int) int {\n\tl := ns[0]\n\tfor i := range ns {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif l == ns[i] {\n\t\t\tcontinue\n\t\t}\n\n\t\tg := gcd(l, ns[i])\n\t\tl = l * ns[i] / g\n\t}\n\n\treturn l\n}\n\nfunc gcd(m, n int) int {\n\tif m < n {\n\t\tm, n = n, m\n\t}\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\n//func lcm(ns ...int) int {\n//\tlcm := ns[0]\n//\tfor i := range ns {\n//\t\tif i == 0 {\n//\t\t\tcontinue\n//\t\t}\n//\n//\t\ttarget := ns[i]\n//\t\ttargetBase := target\n//\t\tlcmBase := lcm\n//\t\tfor {\n//\t\t\tif lcm == target {\n//\t\t\t\tbreak\n//\t\t\t}\n//\t\t\tif target < lcm {\n//\t\t\t\ttarget += targetBase\n//\t\t\t} else {\n//\t\t\t\tlcm += lcmBase\n//\t\t\t}\n//\t\t}\n//\t}\n//\n//\treturn lcm\n//}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n2 3 4\n"}, "reference_outputs": ["13\n"], "source_document_id": "p02793", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2070, "cpu_time_ms": 7, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s051640482", "group_id": "codeNet:p02794", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 3\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\n\tg := make([][]Edge, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta := getNextInt(scanner) - 1\n\t\tb := getNextInt(scanner) - 1\n\t\tg[a] = append(g[a], Edge{\n\t\t\tid: i,\n\t\t\tto: b,\n\t\t})\n\t\tg[b] = append(g[b], Edge{\n\t\t\tid: i,\n\t\t\tto: a,\n\t\t})\n\t}\n\n\tm := getNextInt(scanner)\n\tvisited := make([][]int, m)\n\tee := make([]int64, m)\n\tvar ans, horobiyo int64\n\tfor i := 0; i < m; i++ {\n\t\tu := getNextInt(scanner) - 1\n\t\tv := getNextInt(scanner) - 1\n\n\t\tvisited[i] = make([]int, n-1)\n\t\tdfs(u, -1, v, visited[i], g)\n\t\tfor j := 0; j < n-1; j++ {\n\t\t\tif visited[i][j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tee[i] |= 1 << uint(j)\n\t\t}\n\t}\n\tfor i := 0; i < 1<>uint(j)&1 == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thorobiyo |= ee[j]\n\t\t\tc++\n\t\t}\n\t\td := n - 1\n\t\tfor j := 0; j < n-1; j++ {\n\t\t\td -= int(horobiyo >> uint(j) & 1)\n\t\t}\n\t\tif c%2 == 0 {\n\t\t\tans += 1 << uint(d)\n\t\t\tcontinue\n\t\t}\n\t\tans -= 1 << uint(d)\n\t}\n\tfmt.Fprintln(writer, ans)\n}\n\nfunc dfs(i, p, v int, visited []int, g [][]Edge) int {\n\tif i == v {\n\t\treturn 1\n\t}\n\tr := 0\n\n\tfor _, e := range g[i] {\n\t\tif e.to == p {\n\t\t\tcontinue\n\t\t}\n\t\tx := dfs(e.to, i, v, visited, g)\n\t\tif x == 1 {\n\t\t\tvisited[e.id] = 1\n\t\t\tr = x\n\t\t}\n\t}\n\n\treturn r\n}\n\n// Edge ...\ntype Edge struct {\n\tto, id int\n}\n", "language": "Go", "metadata": {"date": 1580051874, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02794.html", "problem_id": "p02794", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02794/input.txt", "sample_output_relpath": "derived/input_output/data/p02794/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02794/Go/s051640482.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s051640482", "user_id": "u150542210"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 3\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\n\tg := make([][]Edge, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta := getNextInt(scanner) - 1\n\t\tb := getNextInt(scanner) - 1\n\t\tg[a] = append(g[a], Edge{\n\t\t\tid: i,\n\t\t\tto: b,\n\t\t})\n\t\tg[b] = append(g[b], Edge{\n\t\t\tid: i,\n\t\t\tto: a,\n\t\t})\n\t}\n\n\tm := getNextInt(scanner)\n\tvisited := make([][]int, m)\n\tee := make([]int64, m)\n\tvar ans, horobiyo int64\n\tfor i := 0; i < m; i++ {\n\t\tu := getNextInt(scanner) - 1\n\t\tv := getNextInt(scanner) - 1\n\n\t\tvisited[i] = make([]int, n-1)\n\t\tdfs(u, -1, v, visited[i], g)\n\t\tfor j := 0; j < n-1; j++ {\n\t\t\tif visited[i][j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tee[i] |= 1 << uint(j)\n\t\t}\n\t}\n\tfor i := 0; i < 1<>uint(j)&1 == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thorobiyo |= ee[j]\n\t\t\tc++\n\t\t}\n\t\td := n - 1\n\t\tfor j := 0; j < n-1; j++ {\n\t\t\td -= int(horobiyo >> uint(j) & 1)\n\t\t}\n\t\tif c%2 == 0 {\n\t\t\tans += 1 << uint(d)\n\t\t\tcontinue\n\t\t}\n\t\tans -= 1 << uint(d)\n\t}\n\tfmt.Fprintln(writer, ans)\n}\n\nfunc dfs(i, p, v int, visited []int, g [][]Edge) int {\n\tif i == v {\n\t\treturn 1\n\t}\n\tr := 0\n\n\tfor _, e := range g[i] {\n\t\tif e.to == p {\n\t\t\tcontinue\n\t\t}\n\t\tx := dfs(e.to, i, v, visited, g)\n\t\tif x == 1 {\n\t\t\tvisited[e.id] = 1\n\t\t\tr = x\n\t\t}\n\t}\n\n\treturn r\n}\n\n// Edge ...\ntype Edge struct {\n\tto, id int\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in this tree connects Vertex a_i and Vertex b_i.\n\nConsider painting each of these edges white or black. There are 2^{N-1} such ways to paint the edges. Among them, how many satisfy all of the following M restrictions?\n\nThe i-th (1 \\leq i \\leq M) restriction is represented by two integers u_i and v_i, which mean that the path connecting Vertex u_i and Vertex v_i must contain at least one edge painted black.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq a_i,b_i \\leq N\n\nThe graph given in input is a tree.\n\n1 \\leq M \\leq \\min(20,\\frac{N(N-1)}{2})\n\n1 \\leq u_i < v_i \\leq N\n\nIf i \\not= j, either u_i \\not=u_j or v_i\\not=v_j\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nM\nu_1 v_1\n:\nu_M v_M\n\nOutput\n\nPrint the number of ways to paint the edges that satisfy all of the M conditions.\n\nSample Input 1\n\n3\n1 2\n2 3\n1\n1 3\n\nSample Output 1\n\n3\n\nThe tree in this input is shown below:\n\nAll of the M restrictions will be satisfied if Edge 1 and 2 are respectively painted (white, black), (black, white), or (black, black), so the answer is 3.\n\nSample Input 2\n\n2\n1 2\n1\n1 2\n\nSample Output 2\n\n1\n\nThe tree in this input is shown below:\n\nAll of the M restrictions will be satisfied only if Edge 1 is painted black, so the answer is 1.\n\nSample Input 3\n\n5\n1 2\n3 2\n3 4\n5 3\n3\n1 3\n2 4\n2 5\n\nSample Output 3\n\n9\n\nThe tree in this input is shown below:\n\nSample Input 4\n\n8\n1 2\n2 3\n4 3\n2 5\n6 3\n6 7\n8 6\n5\n2 7\n3 5\n1 6\n2 8\n7 8\n\nSample Output 4\n\n62\n\nThe tree in this input is shown below:", "sample_input": "3\n1 2\n2 3\n1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02794", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in this tree connects Vertex a_i and Vertex b_i.\n\nConsider painting each of these edges white or black. There are 2^{N-1} such ways to paint the edges. Among them, how many satisfy all of the following M restrictions?\n\nThe i-th (1 \\leq i \\leq M) restriction is represented by two integers u_i and v_i, which mean that the path connecting Vertex u_i and Vertex v_i must contain at least one edge painted black.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq a_i,b_i \\leq N\n\nThe graph given in input is a tree.\n\n1 \\leq M \\leq \\min(20,\\frac{N(N-1)}{2})\n\n1 \\leq u_i < v_i \\leq N\n\nIf i \\not= j, either u_i \\not=u_j or v_i\\not=v_j\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nM\nu_1 v_1\n:\nu_M v_M\n\nOutput\n\nPrint the number of ways to paint the edges that satisfy all of the M conditions.\n\nSample Input 1\n\n3\n1 2\n2 3\n1\n1 3\n\nSample Output 1\n\n3\n\nThe tree in this input is shown below:\n\nAll of the M restrictions will be satisfied if Edge 1 and 2 are respectively painted (white, black), (black, white), or (black, black), so the answer is 3.\n\nSample Input 2\n\n2\n1 2\n1\n1 2\n\nSample Output 2\n\n1\n\nThe tree in this input is shown below:\n\nAll of the M restrictions will be satisfied only if Edge 1 is painted black, so the answer is 1.\n\nSample Input 3\n\n5\n1 2\n3 2\n3 4\n5 3\n3\n1 3\n2 4\n2 5\n\nSample Output 3\n\n9\n\nThe tree in this input is shown below:\n\nSample Input 4\n\n8\n1 2\n2 3\n4 3\n2 5\n6 3\n6 7\n8 6\n5\n2 7\n3 5\n1 6\n2 8\n7 8\n\nSample Output 4\n\n62\n\nThe tree in this input is shown below:", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2624, "cpu_time_ms": 162, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s106800263", "group_id": "codeNet:p02795", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tx := larger(iScan(), iScan())\n\tn := iScan()\n\tfmt.Println((n + x - 1) / x)\n}\n", "language": "Go", "metadata": {"date": 1597214919, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02795.html", "problem_id": "p02795", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02795/input.txt", "sample_output_relpath": "derived/input_output/data/p02795/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02795/Go/s106800263.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s106800263", "user_id": "u843722521"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tx := larger(iScan(), iScan())\n\tn := iScan()\n\tfmt.Println((n + x - 1) / x)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "sample_input": "3\n7\n10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02795", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1278, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s421034732", "group_id": "codeNet:p02796", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype eadge struct {\n\tstart int\n\tend int\n}\n\ntype eadgeArray []eadge\n\nfunc (a eadgeArray) Len() int {\n\treturn len(a)\n}\n\nfunc (a eadgeArray) Less(i, j int) bool {\n\treturn a[i].start < a[j].start\n}\n\nfunc (a eadgeArray) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\teadges := []eadge{}\n\tfor scanner.Scan() {\n\t\tarray := strings.Split(scanner.Text(), \" \")\n\t\trobot, _ := strconv.Atoi(array[0])\n\t\tarm, _ := strconv.Atoi(array[1])\n\t\tvar s int\n\t\tif robot < arm {\n\t\t\ts = 0\n\t\t} else {\n\t\t\ts = robot - arm\n\t\t}\n\t\te := eadge{\n\t\t\ts,\n\t\t\trobot + arm - 1,\n\t\t}\n\t\teadges = append(eadges, e)\n\t}\n\t//sort\n\tsort.Sort(eadgeArray(eadges))\n\n\tcnt := 0\n\tprev := eadges[0]\n\teadges = eadges[1:]\n\tfor _, e := range eadges {\n\t\tif prev.end < e.start {\n\t\t\t//no overlap\n\t\t\tprev = e\n\t\t\tcnt++\n\t\t\tcontinue\n\t\t}\n\t\t//overlap\n\t\tif prev.end < e.end {\n\t\t\t//keep pre\n\t\t\tcontinue\n\t\t}\n\t\t//change\n\t\tprev = e\n\t}\n\tcnt++\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1580078089, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02796.html", "problem_id": "p02796", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02796/input.txt", "sample_output_relpath": "derived/input_output/data/p02796/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02796/Go/s421034732.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s421034732", "user_id": "u261090677"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype eadge struct {\n\tstart int\n\tend int\n}\n\ntype eadgeArray []eadge\n\nfunc (a eadgeArray) Len() int {\n\treturn len(a)\n}\n\nfunc (a eadgeArray) Less(i, j int) bool {\n\treturn a[i].start < a[j].start\n}\n\nfunc (a eadgeArray) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\teadges := []eadge{}\n\tfor scanner.Scan() {\n\t\tarray := strings.Split(scanner.Text(), \" \")\n\t\trobot, _ := strconv.Atoi(array[0])\n\t\tarm, _ := strconv.Atoi(array[1])\n\t\tvar s int\n\t\tif robot < arm {\n\t\t\ts = 0\n\t\t} else {\n\t\t\ts = robot - arm\n\t\t}\n\t\te := eadge{\n\t\t\ts,\n\t\t\trobot + arm - 1,\n\t\t}\n\t\teadges = append(eadges, e)\n\t}\n\t//sort\n\tsort.Sort(eadgeArray(eadges))\n\n\tcnt := 0\n\tprev := eadges[0]\n\teadges = eadges[1:]\n\tfor _, e := range eadges {\n\t\tif prev.end < e.start {\n\t\t\t//no overlap\n\t\t\tprev = e\n\t\t\tcnt++\n\t\t\tcontinue\n\t\t}\n\t\t//overlap\n\t\tif prev.end < e.end {\n\t\t\t//keep pre\n\t\t\tcontinue\n\t\t}\n\t\t//change\n\t\tprev = e\n\t}\n\tcnt++\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "sample_input": "4\n2 4\n4 3\n9 3\n100 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02796", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1035, "cpu_time_ms": 79, "memory_kb": 8064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s252511058", "group_id": "codeNet:p02796", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\ntype point struct {\n\tx, l, r int\n}\n\ntype ps []point\n\nfunc (p ps) Len() int {\n\treturn len(p)\n}\nfunc (p ps) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\nfunc (p ps) Less(i, j int) bool {\n\treturn p[i].r < p[j].r\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt(sc)\n\tpoints := make([]point, N)\n\tfor i := 0; i < N; i++ {\n\t\tpoints[i].x = nextInt(sc)\n\t\tL := nextInt(sc)\n\t\tpoints[i].l = points[i].x - L\n\t\tpoints[i].r = points[i].x + L\n\t}\n\tsort.Sort(ps(points))\n\t// 区間スケジューリング問題に帰着する\n\tstart := points[0].r\n\tans := 1\n\tfor i := 0; i < len(points); i++ {\n\t\tif points[i].l < start {\n\t\t\tcontinue\n\t\t}\n\t\tstart = points[i].r\n\t\tans++\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1579386201, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02796.html", "problem_id": "p02796", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02796/input.txt", "sample_output_relpath": "derived/input_output/data/p02796/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02796/Go/s252511058.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s252511058", "user_id": "u196030116"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\ntype point struct {\n\tx, l, r int\n}\n\ntype ps []point\n\nfunc (p ps) Len() int {\n\treturn len(p)\n}\nfunc (p ps) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\nfunc (p ps) Less(i, j int) bool {\n\treturn p[i].r < p[j].r\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt(sc)\n\tpoints := make([]point, N)\n\tfor i := 0; i < N; i++ {\n\t\tpoints[i].x = nextInt(sc)\n\t\tL := nextInt(sc)\n\t\tpoints[i].l = points[i].x - L\n\t\tpoints[i].r = points[i].x + L\n\t}\n\tsort.Sort(ps(points))\n\t// 区間スケジューリング問題に帰着する\n\tstart := points[0].r\n\tans := 1\n\tfor i := 0; i < len(points); i++ {\n\t\tif points[i].l < start {\n\t\t\tcontinue\n\t\t}\n\t\tstart = points[i].r\n\t\tans++\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "sample_input": "4\n2 4\n4 3\n9 3\n100 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02796", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn a factory, there are N robots placed on a number line.\nRobot i is placed at coordinate X_i and can extend its arms of length L_i in both directions, positive and negative.\n\nWe want to remove zero or more robots so that the movable ranges of arms of no two remaining robots intersect.\nHere, for each i (1 \\leq i \\leq N), the movable range of arms of Robot i is the part of the number line between the coordinates X_i - L_i and X_i + L_i, excluding the endpoints.\n\nFind the maximum number of robots that we can keep.\n\nConstraints\n\n1 \\leq N \\leq 100,000\n\n0 \\leq X_i \\leq 10^9 (1 \\leq i \\leq N)\n\n1 \\leq L_i \\leq 10^9 (1 \\leq i \\leq N)\n\nIf i \\neq j, X_i \\neq X_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 L_1\nX_2 L_2\n\\vdots\nX_N L_N\n\nOutput\n\nPrint the maximum number of robots that we can keep.\n\nSample Input 1\n\n4\n2 4\n4 3\n9 3\n100 5\n\nSample Output 1\n\n3\n\nBy removing Robot 2, we can keep the other three robots.\n\nSample Input 2\n\n2\n8 20\n1 10\n\nSample Output 2\n\n1\n\nSample Input 3\n\n5\n10 1\n2 1\n4 1\n6 1\n8 1\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 877, "cpu_time_ms": 76, "memory_kb": 4736}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276597329", "group_id": "codeNet:p02801", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar c string\n\tfmt.Scanf(\"%s\", &c)\n\tfmt.Printf(\"%s\", string(c[0] + 1))\n}\n", "language": "Go", "metadata": {"date": 1578859344, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02801.html", "problem_id": "p02801", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02801/input.txt", "sample_output_relpath": "derived/input_output/data/p02801/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02801/Go/s276597329.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s276597329", "user_id": "u638629468"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar c string\n\tfmt.Scanf(\"%s\", &c)\n\tfmt.Printf(\"%s\", string(c[0] + 1))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order.\n\nConstraints\n\nC is a lowercase English letter that is not z.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nC\n\nOutput\n\nPrint the letter that follows C in alphabetical order.\n\nSample Input 1\n\na\n\nSample Output 1\n\nb\n\na is followed by b.\n\nSample Input 2\n\ny\n\nSample Output 2\n\nz\n\ny is followed by z.", "sample_input": "a\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02801", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order.\n\nConstraints\n\nC is a lowercase English letter that is not z.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nC\n\nOutput\n\nPrint the letter that follows C in alphabetical order.\n\nSample Input 1\n\na\n\nSample Output 1\n\nb\n\na is followed by b.\n\nSample Input 2\n\ny\n\nSample Output 2\n\nz\n\ny is followed by z.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 334, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s078918127", "group_id": "codeNet:p02802", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tlistp := make([]int, m)\n\tlistS := make([]string, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&listp[i], &listS[i])\n\t}\n\n\tac := 0\n\twa := 0\n\tflagAC := make([]bool, n+1)\n\n\tfor i := 0; i < m; i++ {\n\t\tif flagAC[listp[i]] == false {\n\t\t\tif listS[i] == \"WA\" {\n\t\t\t\twa++\n\t\t\t} else if listS[i] == \"AC\" {\n\t\t\t\tac++\n\t\t\t\tflagAC[listp[i]] = true\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Println(ac, wa)\n\n}\n", "language": "Go", "metadata": {"date": 1579019038, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02802.html", "problem_id": "p02802", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02802/input.txt", "sample_output_relpath": "derived/input_output/data/p02802/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02802/Go/s078918127.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s078918127", "user_id": "u346986631"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tlistp := make([]int, m)\n\tlistS := make([]string, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&listp[i], &listS[i])\n\t}\n\n\tac := 0\n\twa := 0\n\tflagAC := make([]bool, n+1)\n\n\tfor i := 0; i < m; i++ {\n\t\tif flagAC[listp[i]] == false {\n\t\t\tif listS[i] == \"WA\" {\n\t\t\t\twa++\n\t\t\t} else if listS[i] == \"AC\" {\n\t\t\t\tac++\n\t\t\t\tflagAC[listp[i]] = true\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Println(ac, wa)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 444, "cpu_time_ms": 640, "memory_kb": 5760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s413643163", "group_id": "codeNet:p02802", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\t// 読み込み数取得\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tl := make([][]string, m)\n\tfor i := 0; i < m; i++ {\n\t\tl[i] = make([]string, 2)\n\t\tfmt.Scan(&l[i][0], &l[i][1])\n\t}\n\n\tanswer := 0\n\tanswer_flag := false\n\tpenalty := 0\n\tquestion_count := 0\n\tlast_question := 0\n\tlast_answer := \"\"\n\tfor i := 0; i < m; i++ {\n\t\tq, _ := strconv.Atoi(l[i][0])\n\n\t\t// 回答番号が違っていたらanswer_flagを初期化\n\t\tif q != last_question {\n\t\t\tanswer_flag = false\n\t\t\tlast_question = q\n\t\t\tquestion_count++\n\t\t}\n\n\t\t// 正解が出たらカウントアップ\n\t\tif l[i][1] == \"AC\" && answer_flag == false {\n\t\t\tanswer++\n\t\t\tanswer_flag = true\n\t\t}\n\n\t\t// まだ正解が出ておらず不正解ならペナルティを増やす\n\t\tif l[i][1] == \"WA\" && answer_flag == false {\n\t\t\tpenalty++\n\t\t}\n\n\t\tlast_answer = l[i][1]\n\n\t\t// ACで問題が最終番号だったらループ抜ける\n\t\tif question_count == n && last_answer == \"AC\" {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\", answer, penalty)\n\n}\n", "language": "Go", "metadata": {"date": 1578885763, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02802.html", "problem_id": "p02802", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02802/input.txt", "sample_output_relpath": "derived/input_output/data/p02802/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02802/Go/s413643163.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s413643163", "user_id": "u850393463"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\t// 読み込み数取得\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tl := make([][]string, m)\n\tfor i := 0; i < m; i++ {\n\t\tl[i] = make([]string, 2)\n\t\tfmt.Scan(&l[i][0], &l[i][1])\n\t}\n\n\tanswer := 0\n\tanswer_flag := false\n\tpenalty := 0\n\tquestion_count := 0\n\tlast_question := 0\n\tlast_answer := \"\"\n\tfor i := 0; i < m; i++ {\n\t\tq, _ := strconv.Atoi(l[i][0])\n\n\t\t// 回答番号が違っていたらanswer_flagを初期化\n\t\tif q != last_question {\n\t\t\tanswer_flag = false\n\t\t\tlast_question = q\n\t\t\tquestion_count++\n\t\t}\n\n\t\t// 正解が出たらカウントアップ\n\t\tif l[i][1] == \"AC\" && answer_flag == false {\n\t\t\tanswer++\n\t\t\tanswer_flag = true\n\t\t}\n\n\t\t// まだ正解が出ておらず不正解ならペナルティを増やす\n\t\tif l[i][1] == \"WA\" && answer_flag == false {\n\t\t\tpenalty++\n\t\t}\n\n\t\tlast_answer = l[i][1]\n\n\t\t// ACで問題が最終番号だったらループ抜ける\n\t\tif question_count == n && last_answer == \"AC\" {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\", answer, penalty)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1026, "cpu_time_ms": 619, "memory_kb": 9472}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s425930449", "group_id": "codeNet:p02803", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc StrStdin() string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\treturn strings.TrimSpace(scanner.Text())\n}\n\nfunc Int64Stdin() int64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseInt(strings.TrimSpace(stringInput), 10, 64)\n\treturn num\n}\n\nfunc SplitWithoutEmpty(stringTargeted string, delim string) []string {\n\tstringSplited := strings.Split(stringTargeted, delim)\n\tstrs := []string{}\n\n\tfor _, str := range stringSplited {\n\t\tif str != \"\" {\n\t\t\tstrs = append(strs, str)\n\t\t}\n\t}\n\treturn strs\n}\n\nfunc SliceStrStdin(delim string) []string {\n\tstringInput := StrStdin()\n\treturn SplitWithoutEmpty(stringInput, delim)\n}\n\nfunc SliceInt64Stdin() []int64 {\n\tstringSplited := SliceStrStdin(\" \")\n\n\tuint64Slice := []int64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseInt(stringSplited[ni], 10, 64)\n\t\tuint64Slice = append(uint64Slice, num)\n\t}\n\n\treturn uint64Slice\n}\n\ntype Maze struct {\n\tmaze []string\n}\n\nvar (\n\tH, W int64\n\tm Maze\n\tdist [30][30]int64\n\tdy = [4]int64{0, 1, 0, -1}\n\tdx = [4]int64{1, 0, -1, 0}\n)\n\ntype Point struct {\n\ty int64\n\tx int64\n}\n\nfunc BFS(y, x int64) int64 {\n\n\tque := []Point{}\n\tque = append(que, Point{y: y, x: x})\n\tvar ans int64\n\tans = 0\n\n\tfor hy := 0; int64(hy) < H; hy++ {\n\t\tfor wx := 0; int64(wx) < W; wx++ {\n\t\t\tdist[hy][wx] = 0\n\t\t}\n\t}\n\n\tfor len(que) > 0 {\n\n\t\tq := que[0]\n\t\tque = que[1:]\n\t\tfor dir := 0; dir < len(dy); dir++ {\n\t\t\tny := q.y + dy[dir]\n\t\t\tnx := q.x + dx[dir]\n\n\t\t\tif (0 <= ny && int64(ny) < H) && (0 <= nx && int64(nx) < W) {\n\t\t\t\tif m.maze[ny][nx] != '.' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif dist[ny][nx] > 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tque = append(que, Point{y: ny, x: nx})\n\t\t\t\tdist[ny][nx] = dist[q.y][q.x] + 1\n\t\t\t\tans = int64(math.Max(float64(ans), float64(dist[ny][nx])))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ans\n}\n\nfunc Solve() {\n\tHW := SliceInt64Stdin()\n\tH, W = HW[0], HW[1]\n\n\tfor hy := 0; int64(hy) < H; hy++ {\n\t\tm.maze = append(m.maze, StrStdin())\n\t}\n\n\tvar res int64\n\tres = 0\n\tfor hy := 0; int64(hy) < H; hy++ {\n\t\tfor wx := 0; int64(wx) < W; wx++ {\n\t\t\tif m.maze[hy][wx] == '.' {\n\t\t\t\tres = int64(math.Max(float64(res), float64(BFS(int64(hy), int64(wx)))))\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\", res)\n}\n\nfunc main() {\n\tSolve()\n\treturn\n}", "language": "Go", "metadata": {"date": 1585196197, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02803.html", "problem_id": "p02803", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02803/input.txt", "sample_output_relpath": "derived/input_output/data/p02803/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02803/Go/s425930449.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s425930449", "user_id": "u108377418"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc StrStdin() string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\treturn strings.TrimSpace(scanner.Text())\n}\n\nfunc Int64Stdin() int64 {\n\tstringInput := StrStdin()\n\tnum, _ := strconv.ParseInt(strings.TrimSpace(stringInput), 10, 64)\n\treturn num\n}\n\nfunc SplitWithoutEmpty(stringTargeted string, delim string) []string {\n\tstringSplited := strings.Split(stringTargeted, delim)\n\tstrs := []string{}\n\n\tfor _, str := range stringSplited {\n\t\tif str != \"\" {\n\t\t\tstrs = append(strs, str)\n\t\t}\n\t}\n\treturn strs\n}\n\nfunc SliceStrStdin(delim string) []string {\n\tstringInput := StrStdin()\n\treturn SplitWithoutEmpty(stringInput, delim)\n}\n\nfunc SliceInt64Stdin() []int64 {\n\tstringSplited := SliceStrStdin(\" \")\n\n\tuint64Slice := []int64{}\n\n\tfor ni := range stringSplited {\n\t\tnum, _ := strconv.ParseInt(stringSplited[ni], 10, 64)\n\t\tuint64Slice = append(uint64Slice, num)\n\t}\n\n\treturn uint64Slice\n}\n\ntype Maze struct {\n\tmaze []string\n}\n\nvar (\n\tH, W int64\n\tm Maze\n\tdist [30][30]int64\n\tdy = [4]int64{0, 1, 0, -1}\n\tdx = [4]int64{1, 0, -1, 0}\n)\n\ntype Point struct {\n\ty int64\n\tx int64\n}\n\nfunc BFS(y, x int64) int64 {\n\n\tque := []Point{}\n\tque = append(que, Point{y: y, x: x})\n\tvar ans int64\n\tans = 0\n\n\tfor hy := 0; int64(hy) < H; hy++ {\n\t\tfor wx := 0; int64(wx) < W; wx++ {\n\t\t\tdist[hy][wx] = 0\n\t\t}\n\t}\n\n\tfor len(que) > 0 {\n\n\t\tq := que[0]\n\t\tque = que[1:]\n\t\tfor dir := 0; dir < len(dy); dir++ {\n\t\t\tny := q.y + dy[dir]\n\t\t\tnx := q.x + dx[dir]\n\n\t\t\tif (0 <= ny && int64(ny) < H) && (0 <= nx && int64(nx) < W) {\n\t\t\t\tif m.maze[ny][nx] != '.' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif dist[ny][nx] > 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tque = append(que, Point{y: ny, x: nx})\n\t\t\t\tdist[ny][nx] = dist[q.y][q.x] + 1\n\t\t\t\tans = int64(math.Max(float64(ans), float64(dist[ny][nx])))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ans\n}\n\nfunc Solve() {\n\tHW := SliceInt64Stdin()\n\tH, W = HW[0], HW[1]\n\n\tfor hy := 0; int64(hy) < H; hy++ {\n\t\tm.maze = append(m.maze, StrStdin())\n\t}\n\n\tvar res int64\n\tres = 0\n\tfor hy := 0; int64(hy) < H; hy++ {\n\t\tfor wx := 0; int64(wx) < W; wx++ {\n\t\t\tif m.maze[hy][wx] == '.' {\n\t\t\t\tres = int64(math.Max(float64(res), float64(BFS(int64(hy), int64(wx)))))\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\", res)\n}\n\nfunc main() {\n\tSolve()\n\treturn\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a maze, which is a grid of H \\times W squares with H horizontal rows and W vertical columns.\n\nThe square at the i-th row from the top and the j-th column is a \"wall\" square if S_{ij} is #, and a \"road\" square if S_{ij} is ..\n\nFrom a road square, you can move to a horizontally or vertically adjacent road square.\n\nYou cannot move out of the maze, move to a wall square, or move diagonally.\n\nTakahashi will choose a starting square and a goal square, which can be any road squares, and give the maze to Aoki.\n\nAoki will then travel from the starting square to the goal square, in the minimum number of moves required.\n\nIn this situation, find the maximum possible number of moves Aoki has to make.\n\nConstraints\n\n1 \\leq H,W \\leq 20\n\nS_{ij} is . or #.\n\nS contains at least two occurrences of ..\n\nAny road square can be reached from any road square in zero or more moves.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_{11}...S_{1W}\n:\nS_{H1}...S_{HW}\n\nOutput\n\nPrint the maximum possible number of moves Aoki has to make.\n\nSample Input 1\n\n3 3\n...\n...\n...\n\nSample Output 1\n\n4\n\nIf Takahashi chooses the top-left square as the starting square and the bottom-right square as the goal square, Aoki has to make four moves.\n\nSample Input 2\n\n3 5\n...#.\n.#.#.\n.#...\n\nSample Output 2\n\n10\n\nIf Takahashi chooses the bottom-left square as the starting square and the top-right square as the goal square, Aoki has to make ten moves.", "sample_input": "3 3\n...\n...\n...\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02803", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a maze, which is a grid of H \\times W squares with H horizontal rows and W vertical columns.\n\nThe square at the i-th row from the top and the j-th column is a \"wall\" square if S_{ij} is #, and a \"road\" square if S_{ij} is ..\n\nFrom a road square, you can move to a horizontally or vertically adjacent road square.\n\nYou cannot move out of the maze, move to a wall square, or move diagonally.\n\nTakahashi will choose a starting square and a goal square, which can be any road squares, and give the maze to Aoki.\n\nAoki will then travel from the starting square to the goal square, in the minimum number of moves required.\n\nIn this situation, find the maximum possible number of moves Aoki has to make.\n\nConstraints\n\n1 \\leq H,W \\leq 20\n\nS_{ij} is . or #.\n\nS contains at least two occurrences of ..\n\nAny road square can be reached from any road square in zero or more moves.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_{11}...S_{1W}\n:\nS_{H1}...S_{HW}\n\nOutput\n\nPrint the maximum possible number of moves Aoki has to make.\n\nSample Input 1\n\n3 3\n...\n...\n...\n\nSample Output 1\n\n4\n\nIf Takahashi chooses the top-left square as the starting square and the bottom-right square as the goal square, Aoki has to make four moves.\n\nSample Input 2\n\n3 5\n...#.\n.#.#.\n.#...\n\nSample Output 2\n\n10\n\nIf Takahashi chooses the bottom-left square as the starting square and the top-right square as the goal square, Aoki has to make ten moves.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2253, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s986614115", "group_id": "codeNet:p02803", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tmod int = 1e9 + 7\n)\n\nfunc getMaxIndex(S [][]string, startX, startY int) (int, int, int) {\n\tH := len(S)\n\tW := len(S[0])\n\n\t// costMapの初期化\n\tcostMap := make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tcostMap[i] = make([]int, W)\n\n\t\tfor j := 0; j < W; j++ {\n\t\t\tcostMap[i][j] = -1\n\t\t}\n\t}\n\n\tcostMap[startY][startX] = 0\n\n\t// costMapの更新\n\tmax := 0\n\tmaxX := 0\n\tmaxY := 0\n\n\tfor ; ; {\n\t\tchangeCnt := 0\n\n\t\tfor i := 0; i < H; i++ {\n\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\tif S[i][j] == \"#\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif costMap[i][j] >= 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tvar pool []int\n\t\t\t\tif i > 0 {\n\t\t\t\t\ttop := costMap[i-1][j]\n\t\t\t\t\tif top >= 0 {\n\t\t\t\t\t\tpool = append(pool, top)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif i < H-1 {\n\t\t\t\t\tbottom := costMap[i+1][j]\n\t\t\t\t\tif bottom >= 0 {\n\t\t\t\t\t\tpool = append(pool, bottom)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif j > 0 {\n\t\t\t\t\tleft := costMap[i][j-1]\n\t\t\t\t\tif left >= 0 {\n\t\t\t\t\t\tpool = append(pool, left)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif j < W-1 {\n\t\t\t\t\tright := costMap[i][j+1]\n\t\t\t\t\tif right >= 0 {\n\t\t\t\t\t\tpool = append(pool, right)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif len(pool) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tcost := min(pool...) + 1\n\t\t\t\tcostMap[i][j] = cost\n\t\t\t\tchangeCnt++\n\n\t\t\t\tif cost > max {\n\t\t\t\t\tmax = cost\n\t\t\t\t\tmaxX = j\n\t\t\t\t\tmaxY = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif changeCnt == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t//for i := 0; i < H; i++ {\n\t//\tfmt.Println(costMap[i])\n\t//}\n\n\treturn maxX, maxY, max\n}\n\nfunc main() {\n\tH := getInt()\n\tW := getInt()\n\n\tS := make([][]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = make([]string, W)\n\n\t\tinput := getString()\n\n\t\tfor j, c := range input {\n\t\t\tif c == '.' {\n\t\t\t\tS[i][j] = string(c)\n\t\t\t} else {\n\t\t\t\tS[i][j] = string(c)\n\t\t\t}\n\t\t}\n\t}\n\n\t// costMapの初期位置設定\n\tstartX := 0\n\tstartY := 0\n\tfor i := 0; i < H; i++ {\n\t\tbreakFlag := false\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif S[i][j] == \".\" {\n\t\t\t\tstartX = j\n\t\t\t\tstartY = i\n\t\t\t\tbreakFlag = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif breakFlag {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tbeforeX := startX\n\tbeforeY := startY\n\tcost := 0\n\tsameCnt := 0\n\tfor ; ; {\n\t\tmaxX, maxY, max := getMaxIndex(S, beforeX, beforeY)\n\t\t//fmt.Println(maxX, maxY, max)\n\n\t\tif cost == max {\n\t\t\tsameCnt++\n\t\t}\n\n\t\tbeforeX = maxX\n\t\tbeforeY = maxY\n\t\tcost = max\n\n\t\tif sameCnt == 10 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(cost)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "language": "Go", "metadata": {"date": 1578886534, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02803.html", "problem_id": "p02803", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02803/input.txt", "sample_output_relpath": "derived/input_output/data/p02803/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02803/Go/s986614115.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s986614115", "user_id": "u964273035"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tmod int = 1e9 + 7\n)\n\nfunc getMaxIndex(S [][]string, startX, startY int) (int, int, int) {\n\tH := len(S)\n\tW := len(S[0])\n\n\t// costMapの初期化\n\tcostMap := make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tcostMap[i] = make([]int, W)\n\n\t\tfor j := 0; j < W; j++ {\n\t\t\tcostMap[i][j] = -1\n\t\t}\n\t}\n\n\tcostMap[startY][startX] = 0\n\n\t// costMapの更新\n\tmax := 0\n\tmaxX := 0\n\tmaxY := 0\n\n\tfor ; ; {\n\t\tchangeCnt := 0\n\n\t\tfor i := 0; i < H; i++ {\n\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\tif S[i][j] == \"#\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif costMap[i][j] >= 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tvar pool []int\n\t\t\t\tif i > 0 {\n\t\t\t\t\ttop := costMap[i-1][j]\n\t\t\t\t\tif top >= 0 {\n\t\t\t\t\t\tpool = append(pool, top)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif i < H-1 {\n\t\t\t\t\tbottom := costMap[i+1][j]\n\t\t\t\t\tif bottom >= 0 {\n\t\t\t\t\t\tpool = append(pool, bottom)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif j > 0 {\n\t\t\t\t\tleft := costMap[i][j-1]\n\t\t\t\t\tif left >= 0 {\n\t\t\t\t\t\tpool = append(pool, left)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif j < W-1 {\n\t\t\t\t\tright := costMap[i][j+1]\n\t\t\t\t\tif right >= 0 {\n\t\t\t\t\t\tpool = append(pool, right)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif len(pool) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tcost := min(pool...) + 1\n\t\t\t\tcostMap[i][j] = cost\n\t\t\t\tchangeCnt++\n\n\t\t\t\tif cost > max {\n\t\t\t\t\tmax = cost\n\t\t\t\t\tmaxX = j\n\t\t\t\t\tmaxY = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif changeCnt == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t//for i := 0; i < H; i++ {\n\t//\tfmt.Println(costMap[i])\n\t//}\n\n\treturn maxX, maxY, max\n}\n\nfunc main() {\n\tH := getInt()\n\tW := getInt()\n\n\tS := make([][]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = make([]string, W)\n\n\t\tinput := getString()\n\n\t\tfor j, c := range input {\n\t\t\tif c == '.' {\n\t\t\t\tS[i][j] = string(c)\n\t\t\t} else {\n\t\t\t\tS[i][j] = string(c)\n\t\t\t}\n\t\t}\n\t}\n\n\t// costMapの初期位置設定\n\tstartX := 0\n\tstartY := 0\n\tfor i := 0; i < H; i++ {\n\t\tbreakFlag := false\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif S[i][j] == \".\" {\n\t\t\t\tstartX = j\n\t\t\t\tstartY = i\n\t\t\t\tbreakFlag = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif breakFlag {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tbeforeX := startX\n\tbeforeY := startY\n\tcost := 0\n\tsameCnt := 0\n\tfor ; ; {\n\t\tmaxX, maxY, max := getMaxIndex(S, beforeX, beforeY)\n\t\t//fmt.Println(maxX, maxY, max)\n\n\t\tif cost == max {\n\t\t\tsameCnt++\n\t\t}\n\n\t\tbeforeX = maxX\n\t\tbeforeY = maxY\n\t\tcost = max\n\n\t\tif sameCnt == 10 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(cost)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a maze, which is a grid of H \\times W squares with H horizontal rows and W vertical columns.\n\nThe square at the i-th row from the top and the j-th column is a \"wall\" square if S_{ij} is #, and a \"road\" square if S_{ij} is ..\n\nFrom a road square, you can move to a horizontally or vertically adjacent road square.\n\nYou cannot move out of the maze, move to a wall square, or move diagonally.\n\nTakahashi will choose a starting square and a goal square, which can be any road squares, and give the maze to Aoki.\n\nAoki will then travel from the starting square to the goal square, in the minimum number of moves required.\n\nIn this situation, find the maximum possible number of moves Aoki has to make.\n\nConstraints\n\n1 \\leq H,W \\leq 20\n\nS_{ij} is . or #.\n\nS contains at least two occurrences of ..\n\nAny road square can be reached from any road square in zero or more moves.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_{11}...S_{1W}\n:\nS_{H1}...S_{HW}\n\nOutput\n\nPrint the maximum possible number of moves Aoki has to make.\n\nSample Input 1\n\n3 3\n...\n...\n...\n\nSample Output 1\n\n4\n\nIf Takahashi chooses the top-left square as the starting square and the bottom-right square as the goal square, Aoki has to make four moves.\n\nSample Input 2\n\n3 5\n...#.\n.#.#.\n.#...\n\nSample Output 2\n\n10\n\nIf Takahashi chooses the bottom-left square as the starting square and the top-right square as the goal square, Aoki has to make ten moves.", "sample_input": "3 3\n...\n...\n...\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02803", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a maze, which is a grid of H \\times W squares with H horizontal rows and W vertical columns.\n\nThe square at the i-th row from the top and the j-th column is a \"wall\" square if S_{ij} is #, and a \"road\" square if S_{ij} is ..\n\nFrom a road square, you can move to a horizontally or vertically adjacent road square.\n\nYou cannot move out of the maze, move to a wall square, or move diagonally.\n\nTakahashi will choose a starting square and a goal square, which can be any road squares, and give the maze to Aoki.\n\nAoki will then travel from the starting square to the goal square, in the minimum number of moves required.\n\nIn this situation, find the maximum possible number of moves Aoki has to make.\n\nConstraints\n\n1 \\leq H,W \\leq 20\n\nS_{ij} is . or #.\n\nS contains at least two occurrences of ..\n\nAny road square can be reached from any road square in zero or more moves.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_{11}...S_{1W}\n:\nS_{H1}...S_{HW}\n\nOutput\n\nPrint the maximum possible number of moves Aoki has to make.\n\nSample Input 1\n\n3 3\n...\n...\n...\n\nSample Output 1\n\n4\n\nIf Takahashi chooses the top-left square as the starting square and the bottom-right square as the goal square, Aoki has to make four moves.\n\nSample Input 2\n\n3 5\n...#.\n.#.#.\n.#...\n\nSample Output 2\n\n10\n\nIf Takahashi chooses the bottom-left square as the starting square and the top-right square as the goal square, Aoki has to make ten moves.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3551, "cpu_time_ms": 8, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s671267164", "group_id": "codeNet:p02804", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar N, K int\n\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ts := strings.Fields(stdin.Text())\n\n\tA := func(s []string) []int {\n\t\tA := make([]int, len(s))\n\t\tfor i, a := range s {\n\t\t\tvar err error\n\t\t\tA[i], err = strconv.Atoi(a)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\treturn A\n\t}(s)\n\n\tsort.Ints(A)\n\n\tans := A[K-1] - A[N-K]\n\tmod := 1000000007\n\n\ta := 1\n\ttmp := 1\n\ttmp2 := K\n\tfor i := K; i < N; i++ {\n\t\ta = a * tmp2 / tmp\n\t\tans += a * (A[i] - A[N-i-1])\n\t\tif ans > mod {\n\t\t\tans %= mod\n\t\t}\n\t\ttmp++\n\t\ttmp2++\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "language": "Go", "metadata": {"date": 1578971460, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02804.html", "problem_id": "p02804", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02804/input.txt", "sample_output_relpath": "derived/input_output/data/p02804/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02804/Go/s671267164.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s671267164", "user_id": "u121192152"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar N, K int\n\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ts := strings.Fields(stdin.Text())\n\n\tA := func(s []string) []int {\n\t\tA := make([]int, len(s))\n\t\tfor i, a := range s {\n\t\t\tvar err error\n\t\t\tA[i], err = strconv.Atoi(a)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\treturn A\n\t}(s)\n\n\tsort.Ints(A)\n\n\tans := A[K-1] - A[N-K]\n\tmod := 1000000007\n\n\ta := 1\n\ttmp := 1\n\ttmp2 := K\n\tfor i := K; i < N; i++ {\n\t\ta = a * tmp2 / tmp\n\t\tans += a * (A[i] - A[N-i-1])\n\t\tif ans > mod {\n\t\t\tans %= mod\n\t\t}\n\t\ttmp++\n\t\ttmp2++\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor a finite set of integers X, let f(X)=\\max X - \\min X.\n\nGiven are N integers A_1,...,A_N.\n\nWe will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even when their values are the same, there are {}_N C_K ways to make this choice. Find the sum of f(S) over all those ways.\n\nSince the answer can be enormous, print it \\bmod (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 ... A_N\n\nOutput\n\nPrint the answer \\bmod (10^9+7).\n\nSample Input 1\n\n4 2\n1 1 3 4\n\nSample Output 1\n\n11\n\nThere are six ways to choose S: \\{1,1\\},\\{1,3\\},\\{1,4\\},\\{1,3\\},\\{1,4\\}, \\{3,4\\} (we distinguish the two 1s). The value of f(S) for these choices are 0,2,3,2,3,1, respectively, for the total of 11.\n\nSample Input 2\n\n6 3\n10 10 10 -10 -10 -10\n\nSample Output 2\n\n360\n\nThere are 20 ways to choose S. In 18 of them, f(S)=20, and in 2 of them, f(S)=0.\n\nSample Input 3\n\n3 1\n1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n10 6\n1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0\n\nSample Output 4\n\n999998537\n\nPrint the sum \\bmod (10^9+7).", "sample_input": "4 2\n1 1 3 4\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02804", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor a finite set of integers X, let f(X)=\\max X - \\min X.\n\nGiven are N integers A_1,...,A_N.\n\nWe will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even when their values are the same, there are {}_N C_K ways to make this choice. Find the sum of f(S) over all those ways.\n\nSince the answer can be enormous, print it \\bmod (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 ... A_N\n\nOutput\n\nPrint the answer \\bmod (10^9+7).\n\nSample Input 1\n\n4 2\n1 1 3 4\n\nSample Output 1\n\n11\n\nThere are six ways to choose S: \\{1,1\\},\\{1,3\\},\\{1,4\\},\\{1,3\\},\\{1,4\\}, \\{3,4\\} (we distinguish the two 1s). The value of f(S) for these choices are 0,2,3,2,3,1, respectively, for the total of 11.\n\nSample Input 2\n\n6 3\n10 10 10 -10 -10 -10\n\nSample Output 2\n\n360\n\nThere are 20 ways to choose S. In 18 of them, f(S)=20, and in 2 of them, f(S)=0.\n\nSample Input 3\n\n3 1\n1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n10 6\n1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0\n\nSample Output 4\n\n999998537\n\nPrint the sum \\bmod (10^9+7).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 663, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s825857380", "group_id": "codeNet:p02805", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 4\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\tpp := make([]Point, n)\n\tvar l, r float64\n\n\to := Point{\n\t\tx: 0,\n\t\ty: 0,\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tpp[i].x = getNextFloat64(scanner)\n\t\tpp[i].y = getNextFloat64(scanner)\n\t\td := dist(o, pp[i])\n\t\tif r < d*2 {\n\t\t\tr = d * 2\n\t\t}\n\t}\n\n\tfor c := 0; c < 100; c++ {\n\t\tvalid := false\n\t\tm := (l + r) / 2\n\t\tfor i := 0; i < n && valid == false; i++ {\n\t\t\tfor j := 0; j < i && valid == false; j++ {\n\t\t\t\td := dist(pp[i], pp[j])\n\t\t\t\tif d > m*2 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcp := Point{\n\t\t\t\t\tx: (pp[i].x + pp[j].x) / 2.0,\n\t\t\t\t\ty: (pp[i].y + pp[j].y) / 2.0,\n\t\t\t\t}\n\t\t\t\th := math.Sqrt(m*m - d*d/4)\n\t\t\t\tvalid = valid || ok(m, Point{\n\t\t\t\t\tx: cp.x - (pp[i].y-pp[j].y)/d*h,\n\t\t\t\t\ty: cp.y + (pp[i].x-pp[j].x)/d*h,\n\t\t\t\t}, pp)\n\t\t\t\tvalid = valid || ok(m, Point{\n\t\t\t\t\tx: cp.x + (pp[i].y-pp[j].y)/d*h,\n\t\t\t\t\ty: cp.y - (pp[i].x-pp[j].x)/d*h,\n\t\t\t\t}, pp)\n\t\t\t}\n\t\t}\n\t\tif valid {\n\t\t\tr = m\n\t\t\tcontinue\n\t\t}\n\t\tl = m\n\t}\n\n\tfmt.Fprintln(writer, fmt.Sprintf(\"%.8f\", r))\n}\n\nfunc dist(p1, p2 Point) float64 {\n\treturn math.Sqrt(math.Pow(p1.x-p2.x, 2) + math.Pow(p1.y-p2.y, 2))\n}\nfunc ok(r float64, p Point, pp []Point) bool {\n\tn := len(pp)\n\tfor i := 0; i < n; i++ {\n\t\td := dist(pp[i], p)\n\t\tif r < d {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Point ...\ntype Point struct {\n\tx, y float64\n}\n", "language": "Go", "metadata": {"date": 1578968756, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02805.html", "problem_id": "p02805", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02805/input.txt", "sample_output_relpath": "derived/input_output/data/p02805/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02805/Go/s825857380.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s825857380", "user_id": "u150542210"}, "prompt_components": {"gold_output": "0.500000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 4\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\tpp := make([]Point, n)\n\tvar l, r float64\n\n\to := Point{\n\t\tx: 0,\n\t\ty: 0,\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tpp[i].x = getNextFloat64(scanner)\n\t\tpp[i].y = getNextFloat64(scanner)\n\t\td := dist(o, pp[i])\n\t\tif r < d*2 {\n\t\t\tr = d * 2\n\t\t}\n\t}\n\n\tfor c := 0; c < 100; c++ {\n\t\tvalid := false\n\t\tm := (l + r) / 2\n\t\tfor i := 0; i < n && valid == false; i++ {\n\t\t\tfor j := 0; j < i && valid == false; j++ {\n\t\t\t\td := dist(pp[i], pp[j])\n\t\t\t\tif d > m*2 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcp := Point{\n\t\t\t\t\tx: (pp[i].x + pp[j].x) / 2.0,\n\t\t\t\t\ty: (pp[i].y + pp[j].y) / 2.0,\n\t\t\t\t}\n\t\t\t\th := math.Sqrt(m*m - d*d/4)\n\t\t\t\tvalid = valid || ok(m, Point{\n\t\t\t\t\tx: cp.x - (pp[i].y-pp[j].y)/d*h,\n\t\t\t\t\ty: cp.y + (pp[i].x-pp[j].x)/d*h,\n\t\t\t\t}, pp)\n\t\t\t\tvalid = valid || ok(m, Point{\n\t\t\t\t\tx: cp.x + (pp[i].y-pp[j].y)/d*h,\n\t\t\t\t\ty: cp.y - (pp[i].x-pp[j].x)/d*h,\n\t\t\t\t}, pp)\n\t\t\t}\n\t\t}\n\t\tif valid {\n\t\t\tr = m\n\t\t\tcontinue\n\t\t}\n\t\tl = m\n\t}\n\n\tfmt.Fprintln(writer, fmt.Sprintf(\"%.8f\", r))\n}\n\nfunc dist(p1, p2 Point) float64 {\n\treturn math.Sqrt(math.Pow(p1.x-p2.x, 2) + math.Pow(p1.y-p2.y, 2))\n}\nfunc ok(r float64, p Point, pp []Point) bool {\n\tn := len(pp)\n\tfor i := 0; i < n; i++ {\n\t\td := dist(pp[i], p)\n\t\tif r < d {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Point ...\ntype Point struct {\n\tx, y float64\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are N points (x_i, y_i) in a two-dimensional plane.\n\nFind the minimum radius of a circle such that all the points are inside or on it.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n0 \\leq x_i \\leq 1000\n\n0 \\leq y_i \\leq 1000\n\nThe given N points are all different.\n\nThe values in input are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum radius of a circle such that all the N points are inside or on it.\n\nYour output will be considered correct if the absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n2\n0 0\n1 0\n\nSample Output 1\n\n0.500000000000000000\n\nBoth points are contained in the circle centered at (0.5,0) with a radius of 0.5.\n\nSample Input 2\n\n3\n0 0\n0 1\n1 0\n\nSample Output 2\n\n0.707106781186497524\n\nSample Input 3\n\n10\n10 9\n5 9\n2 0\n0 0\n2 7\n3 3\n2 5\n10 0\n3 7\n1 9\n\nSample Output 3\n\n6.726812023536805158\n\nIf the absolute or relative error from our answer is at most 10^{-6}, the output will be considered correct.", "sample_input": "2\n0 0\n1 0\n"}, "reference_outputs": ["0.500000000000000000\n"], "source_document_id": "p02805", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are N points (x_i, y_i) in a two-dimensional plane.\n\nFind the minimum radius of a circle such that all the points are inside or on it.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n0 \\leq x_i \\leq 1000\n\n0 \\leq y_i \\leq 1000\n\nThe given N points are all different.\n\nThe values in input are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum radius of a circle such that all the N points are inside or on it.\n\nYour output will be considered correct if the absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n2\n0 0\n1 0\n\nSample Output 1\n\n0.500000000000000000\n\nBoth points are contained in the circle centered at (0.5,0) with a radius of 0.5.\n\nSample Input 2\n\n3\n0 0\n0 1\n1 0\n\nSample Output 2\n\n0.707106781186497524\n\nSample Input 3\n\n10\n10 9\n5 9\n2 0\n0 0\n2 7\n3 3\n2 5\n10 0\n3 7\n1 9\n\nSample Output 3\n\n6.726812023536805158\n\nIf the absolute or relative error from our answer is at most 10^{-6}, the output will be considered correct.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2634, "cpu_time_ms": 90, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s621617346", "group_id": "codeNet:p02812", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(strings.Count(s, \"ABC\"))\n}\n", "language": "Go", "metadata": {"date": 1583020139, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02812.html", "problem_id": "p02812", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02812/input.txt", "sample_output_relpath": "derived/input_output/data/p02812/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02812/Go/s621617346.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s621617346", "user_id": "u422903328"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(strings.Count(s, \"ABC\"))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "sample_input": "10\nZABCDBABCQ\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02812", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 151, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s009012428", "group_id": "codeNet:p02812", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tsc.nextInt()\n\tS := sc.next()\n\n\tvar cnt int\n\tarr := strings.Split(S, \"\")\n\tfor i, v := range arr {\n\t\tif v == \"A\" {\n\t\t\tif len(S) > i+1 && arr[i+1] == \"B\" {\n\t\t\t\tif len(S) > i+2 && arr[i+2] == \"C\" {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\tfmt.Println(cnt)\n}\n\n/* template functions */\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1582951755, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02812.html", "problem_id": "p02812", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02812/input.txt", "sample_output_relpath": "derived/input_output/data/p02812/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02812/Go/s009012428.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s009012428", "user_id": "u799236543"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tsc.nextInt()\n\tS := sc.next()\n\n\tvar cnt int\n\tarr := strings.Split(S, \"\")\n\tfor i, v := range arr {\n\t\tif v == \"A\" {\n\t\t\tif len(S) > i+1 && arr[i+1] == \"B\" {\n\t\t\t\tif len(S) > i+2 && arr[i+2] == \"C\" {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\tfmt.Println(cnt)\n}\n\n/* template functions */\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "sample_input": "10\nZABCDBABCQ\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02812", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S of length N consisting of uppercase English letters.\n\nHow many times does ABC occur in S as contiguous subsequences (see Sample Inputs and Outputs)?\n\nConstraints\n\n3 \\leq N \\leq 50\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint number of occurrences of ABC in S as contiguous subsequences.\n\nSample Input 1\n\n10\nZABCDBABCQ\n\nSample Output 1\n\n2\n\nTwo contiguous subsequences of S are equal to ABC: the 2-nd through 4-th characters, and the 7-th through 9-th characters.\n\nSample Input 2\n\n19\nTHREEONEFOURONEFIVE\n\nSample Output 2\n\n0\n\nNo contiguous subsequences of S are equal to ABC.\n\nSample Input 3\n\n33\nABCCABCBABCCABACBCBBABCBCBCBCABCB\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2464, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s056981921", "group_id": "codeNet:p02813", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tpl := make([]int, n)\n\tql := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tpl[i] = nextInt()\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tql[i] = nextInt()\n\t}\n\t// p,qの数値化\n\tp, q := 0, 0\n\tfor j := 0; j < n; j++ {\n\t\tp += pl[j] * pow(10, n-j-1)\n\t}\n\tfor j := 0; j < n; j++ {\n\t\tq += ql[j] * pow(10, n-j-1)\n\t}\n\n\t// 順列作成\n\tvar tl []int = []int{1, 2, 3, 4, 5, 6, 7, 8}\n\tpall := permutations(tl[:n])\n\n\t// 数値リスト化\n\tpallnum := make([]int, len(pall))\n\tfor i := 0; i < len(pall); i++ {\n\t\ttmp := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\ttmp += pall[i][j] * pow(10, n-j-1)\n\t\t}\n\t\tpallnum[i] = tmp\n\t}\n\n\t// 順列並びかえ\n\tsort.Ints(pallnum)\n\n\tpidx := -1\n\tqidx := -1\n\tfor i := 0; i < len(pall); i++ {\n\t\t// pidxとqidxが求まっているならば終わり\n\t\tif pidx != -1 && qidx != -1 {\n\t\t\tbreak\n\t\t}\n\n\t\t// p比較\n\t\tif p == pallnum[i] {\n\t\t\tpidx = i\n\t\t}\n\n\t\t// q比較\n\t\tif q == pallnum[i] {\n\t\t\tqidx = i\n\t\t}\n\t}\n\n\tfmt.Println(abs(pidx - qidx))\n\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc pow(a, b int) int {\n\tvar ret int = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret *= a\n\t\t}\n\t\ta *= a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 64 * 1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1594508451, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02813.html", "problem_id": "p02813", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02813/input.txt", "sample_output_relpath": "derived/input_output/data/p02813/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02813/Go/s056981921.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s056981921", "user_id": "u756000295"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tpl := make([]int, n)\n\tql := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tpl[i] = nextInt()\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tql[i] = nextInt()\n\t}\n\t// p,qの数値化\n\tp, q := 0, 0\n\tfor j := 0; j < n; j++ {\n\t\tp += pl[j] * pow(10, n-j-1)\n\t}\n\tfor j := 0; j < n; j++ {\n\t\tq += ql[j] * pow(10, n-j-1)\n\t}\n\n\t// 順列作成\n\tvar tl []int = []int{1, 2, 3, 4, 5, 6, 7, 8}\n\tpall := permutations(tl[:n])\n\n\t// 数値リスト化\n\tpallnum := make([]int, len(pall))\n\tfor i := 0; i < len(pall); i++ {\n\t\ttmp := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\ttmp += pall[i][j] * pow(10, n-j-1)\n\t\t}\n\t\tpallnum[i] = tmp\n\t}\n\n\t// 順列並びかえ\n\tsort.Ints(pallnum)\n\n\tpidx := -1\n\tqidx := -1\n\tfor i := 0; i < len(pall); i++ {\n\t\t// pidxとqidxが求まっているならば終わり\n\t\tif pidx != -1 && qidx != -1 {\n\t\t\tbreak\n\t\t}\n\n\t\t// p比較\n\t\tif p == pallnum[i] {\n\t\t\tpidx = i\n\t\t}\n\n\t\t// q比較\n\t\tif q == pallnum[i] {\n\t\t\tqidx = i\n\t\t}\n\t}\n\n\tfmt.Println(abs(pidx - qidx))\n\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc pow(a, b int) int {\n\tvar ret int = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret *= a\n\t\t}\n\t\ta *= a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 64 * 1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two permutations P and Q of size N (that is, P and Q are both rearrangements of (1,~2,~...,~N)).\n\nThere are N! possible permutations of size N. Among them, let P and Q be the a-th and b-th lexicographically smallest permutations, respectively. Find |a - b|.\n\nNotes\n\nFor two sequences X and Y, X is said to be lexicographically smaller than Y if and only if there exists an integer k such that X_i = Y_i~(1 \\leq i < k) and X_k < Y_k.\n\nConstraints\n\n2 \\leq N \\leq 8\n\nP and Q are permutations of size N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 ... P_N\nQ_1 Q_2 ... Q_N\n\nOutput\n\nPrint |a - b|.\n\nSample Input 1\n\n3\n1 3 2\n3 1 2\n\nSample Output 1\n\n3\n\nThere are 6 permutations of size 3: (1,~2,~3), (1,~3,~2), (2,~1,~3), (2,~3,~1), (3,~1,~2), and (3,~2,~1). Among them, (1,~3,~2) and (3,~1,~2) come 2-nd and 5-th in lexicographical order, so the answer is |2 - 5| = 3.\n\nSample Input 2\n\n8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n\nSample Output 2\n\n17517\n\nSample Input 3\n\n3\n1 2 3\n1 2 3\n\nSample Output 3\n\n0", "sample_input": "3\n1 3 2\n3 1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02813", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two permutations P and Q of size N (that is, P and Q are both rearrangements of (1,~2,~...,~N)).\n\nThere are N! possible permutations of size N. Among them, let P and Q be the a-th and b-th lexicographically smallest permutations, respectively. Find |a - b|.\n\nNotes\n\nFor two sequences X and Y, X is said to be lexicographically smaller than Y if and only if there exists an integer k such that X_i = Y_i~(1 \\leq i < k) and X_k < Y_k.\n\nConstraints\n\n2 \\leq N \\leq 8\n\nP and Q are permutations of size N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 ... P_N\nQ_1 Q_2 ... Q_N\n\nOutput\n\nPrint |a - b|.\n\nSample Input 1\n\n3\n1 3 2\n3 1 2\n\nSample Output 1\n\n3\n\nThere are 6 permutations of size 3: (1,~2,~3), (1,~3,~2), (2,~1,~3), (2,~3,~1), (3,~1,~2), and (3,~2,~1). Among them, (1,~3,~2) and (3,~1,~2) come 2-nd and 5-th in lexicographical order, so the answer is |2 - 5| = 3.\n\nSample Input 2\n\n8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n\nSample Output 2\n\n17517\n\nSample Input 3\n\n3\n1 2 3\n1 2 3\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2057, "cpu_time_ms": 35, "memory_kb": 9444}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s269832550", "group_id": "codeNet:p02813", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&b[i])\n\t}\n\tx := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tx[i] = i + 1\n\t}\n\tvar ac, bc int\n\tarr := NextPermutation(x)\n\tfor i := 0; i < len(arr); i++ {\n\t\taeq := true\n\t\tbeq := true\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif arr[i][j] != a[j] {\n\t\t\t\taeq = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif aeq {\n\t\t\tac = i + 1\n\t\t}\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif arr[i][j] != b[j] {\n\t\t\t\tbeq = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif beq {\n\t\t\tbc = i + 1\n\t\t}\n\t}\n\tfmt.Println(Abs(ac - bc))\n}\nfunc Abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc NextPermutation(x []int) [][]int {\n\tvar p [][]int\n\tz := make([]int, len(x))\n\tcopy(z, x)\n\tp = append(p, z)\n\tfor i := 1; NextPermutationSub(sort.IntSlice(x)); i++ {\n\t\ty := make([]int, len(x))\n\t\tcopy(y, x)\n\t\tp = append(p, y)\n\t}\n\treturn p\n}\n\nfunc NextPermutationSub(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1582951383, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02813.html", "problem_id": "p02813", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02813/input.txt", "sample_output_relpath": "derived/input_output/data/p02813/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02813/Go/s269832550.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s269832550", "user_id": "u298152049"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&b[i])\n\t}\n\tx := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tx[i] = i + 1\n\t}\n\tvar ac, bc int\n\tarr := NextPermutation(x)\n\tfor i := 0; i < len(arr); i++ {\n\t\taeq := true\n\t\tbeq := true\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif arr[i][j] != a[j] {\n\t\t\t\taeq = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif aeq {\n\t\t\tac = i + 1\n\t\t}\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif arr[i][j] != b[j] {\n\t\t\t\tbeq = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif beq {\n\t\t\tbc = i + 1\n\t\t}\n\t}\n\tfmt.Println(Abs(ac - bc))\n}\nfunc Abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc NextPermutation(x []int) [][]int {\n\tvar p [][]int\n\tz := make([]int, len(x))\n\tcopy(z, x)\n\tp = append(p, z)\n\tfor i := 1; NextPermutationSub(sort.IntSlice(x)); i++ {\n\t\ty := make([]int, len(x))\n\t\tcopy(y, x)\n\t\tp = append(p, y)\n\t}\n\treturn p\n}\n\nfunc NextPermutationSub(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two permutations P and Q of size N (that is, P and Q are both rearrangements of (1,~2,~...,~N)).\n\nThere are N! possible permutations of size N. Among them, let P and Q be the a-th and b-th lexicographically smallest permutations, respectively. Find |a - b|.\n\nNotes\n\nFor two sequences X and Y, X is said to be lexicographically smaller than Y if and only if there exists an integer k such that X_i = Y_i~(1 \\leq i < k) and X_k < Y_k.\n\nConstraints\n\n2 \\leq N \\leq 8\n\nP and Q are permutations of size N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 ... P_N\nQ_1 Q_2 ... Q_N\n\nOutput\n\nPrint |a - b|.\n\nSample Input 1\n\n3\n1 3 2\n3 1 2\n\nSample Output 1\n\n3\n\nThere are 6 permutations of size 3: (1,~2,~3), (1,~3,~2), (2,~1,~3), (2,~3,~1), (3,~1,~2), and (3,~2,~1). Among them, (1,~3,~2) and (3,~1,~2) come 2-nd and 5-th in lexicographical order, so the answer is |2 - 5| = 3.\n\nSample Input 2\n\n8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n\nSample Output 2\n\n17517\n\nSample Input 3\n\n3\n1 2 3\n1 2 3\n\nSample Output 3\n\n0", "sample_input": "3\n1 3 2\n3 1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02813", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two permutations P and Q of size N (that is, P and Q are both rearrangements of (1,~2,~...,~N)).\n\nThere are N! possible permutations of size N. Among them, let P and Q be the a-th and b-th lexicographically smallest permutations, respectively. Find |a - b|.\n\nNotes\n\nFor two sequences X and Y, X is said to be lexicographically smaller than Y if and only if there exists an integer k such that X_i = Y_i~(1 \\leq i < k) and X_k < Y_k.\n\nConstraints\n\n2 \\leq N \\leq 8\n\nP and Q are permutations of size N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 P_2 ... P_N\nQ_1 Q_2 ... Q_N\n\nOutput\n\nPrint |a - b|.\n\nSample Input 1\n\n3\n1 3 2\n3 1 2\n\nSample Output 1\n\n3\n\nThere are 6 permutations of size 3: (1,~2,~3), (1,~3,~2), (2,~1,~3), (2,~3,~1), (3,~1,~2), and (3,~2,~1). Among them, (1,~3,~2) and (3,~1,~2) come 2-nd and 5-th in lexicographical order, so the answer is |2 - 5| = 3.\n\nSample Input 2\n\n8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n\nSample Output 2\n\n17517\n\nSample Input 3\n\n3\n1 2 3\n1 2 3\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1264, "cpu_time_ms": 25, "memory_kb": 8064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s028270734", "group_id": "codeNet:p02814", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t\tA[i] /= 2\n\t}\n\n\tpow := -1\n\tfor _, a := range A {\n\t\tc := 0\n\t\tfor a > 0 && a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tc++\n\t\t}\n\t\tif pow < 0 {\n\t\t\tpow = c\n\t\t}\n\t\tif pow != c {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tg := A[0]\n\tt := A[0]\n\tfor i := 1; i < N; i++ {\n\t\ta := A[i]\n\t\tg = gcd(a, g)\n\t\tt = lcm(a, t)\n\t}\n\tcount := 0\n\tfor i := 1; t*i <= M; i += 2 {\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1592777814, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02814.html", "problem_id": "p02814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02814/input.txt", "sample_output_relpath": "derived/input_output/data/p02814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02814/Go/s028270734.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s028270734", "user_id": "u162326103"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t\tA[i] /= 2\n\t}\n\n\tpow := -1\n\tfor _, a := range A {\n\t\tc := 0\n\t\tfor a > 0 && a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tc++\n\t\t}\n\t\tif pow < 0 {\n\t\t\tpow = c\n\t\t}\n\t\tif pow != c {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tg := A[0]\n\tt := A[0]\n\tfor i := 1; i < N; i++ {\n\t\ta := A[i]\n\t\tg = gcd(a, g)\n\t\tt = lcm(a, t)\n\t}\n\tcount := 0\n\tfor i := 1; t*i <= M; i += 2 {\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "sample_input": "2 50\n6 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02814", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 793, "cpu_time_ms": 239, "memory_kb": 4304}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s443390344", "group_id": "codeNet:p02814", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tnums := make([]int, n)\n\tvar lcm int\n\tvar check int\n\tfmt.Scan(&nums[0])\n\tcheck = counter(nums[0])\n\tif n > 1 {\n\t\tfmt.Scan(&nums[1])\n\t\tlcm = nums[0] * nums[1] / GCD(nums[0], nums[1])\n\t\tif counter(nums[1]) != check {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t\tfor i := 2; i < n; i++ {\n\t\t\tfmt.Scan(&nums[i])\n\t\t\tlcm = LCM(lcm, nums[i])\n\t\t\tif counter(nums[i]) != check {\n\t\t\t\tfmt.Println(\"0\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlcm = nums[0]\n\t}\n\n\tmin := lcm / 2\n\tresult := (m-min)/min/2 + 1\n\tfmt.Println(result)\n}\n\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\nfunc LCM(a, b int) int {\n\tresult := a * b / GCD(a, b)\n\n\treturn result\n}\n\nfunc counter(a int) int {\n\tresult := 0\n\tfor a%2 == 0 {\n\t\tresult++\n\t\ta /= 2\n\t}\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1583031784, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02814.html", "problem_id": "p02814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02814/input.txt", "sample_output_relpath": "derived/input_output/data/p02814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02814/Go/s443390344.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s443390344", "user_id": "u422903328"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tnums := make([]int, n)\n\tvar lcm int\n\tvar check int\n\tfmt.Scan(&nums[0])\n\tcheck = counter(nums[0])\n\tif n > 1 {\n\t\tfmt.Scan(&nums[1])\n\t\tlcm = nums[0] * nums[1] / GCD(nums[0], nums[1])\n\t\tif counter(nums[1]) != check {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t\tfor i := 2; i < n; i++ {\n\t\t\tfmt.Scan(&nums[i])\n\t\t\tlcm = LCM(lcm, nums[i])\n\t\t\tif counter(nums[i]) != check {\n\t\t\t\tfmt.Println(\"0\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlcm = nums[0]\n\t}\n\n\tmin := lcm / 2\n\tresult := (m-min)/min/2 + 1\n\tfmt.Println(result)\n}\n\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\nfunc LCM(a, b int) int {\n\tresult := a * b / GCD(a, b)\n\n\treturn result\n}\n\nfunc counter(a int) int {\n\tresult := 0\n\tfor a%2 == 0 {\n\t\tresult++\n\t\ta /= 2\n\t}\n\treturn result\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "sample_input": "2 50\n6 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02814", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 839, "cpu_time_ms": 735, "memory_kb": 7424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s779377775", "group_id": "codeNet:p02814", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc exec(stdin *Stdin, stdout *Stdout) {\n\tn := stdin.ReadInt()\n\tm := stdin.ReadInt()\n\ta := []int{}\n\tfor i := 0; i < n; i++ {\n\t\ta = append(a, stdin.ReadInt())\n\t}\n\n\tc := 0\n\tfor a[0]%2 == 0 {\n\t\ta[0] /= 2\n\t\tc++\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\td := 0\n\t\tfor a[i]%2 == 0 {\n\t\t\ta[i] /= 2\n\t\t\td++\n\t\t}\n\n\t\tif c != d {\n\t\t\tstdout.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfor i := 0; i < c-1; i++ {\n\t\tm /= 2\n\t}\n\n\tlcm := 1\n\tfor i := 0; i < n; i++ {\n\t\tlcm = Lcm(lcm, a[i])\n\t}\n\n\tif lcm <= m {\n\t\tstdout.Println(((m / lcm) + 1) / 2)\n\t} else {\n\t\tstdout.Println(0)\n\t}\n}\n\nfunc main() {\n\tstdout := NewStdout()\n\tdefer stdout.Flush()\n\texec(NewStdin(bufio.ScanWords), stdout)\n}\n\ntype Stdin struct {\n\tstdin *bufio.Scanner\n}\n\nfunc NewStdin(split bufio.SplitFunc) *Stdin {\n\ts := Stdin{bufio.NewScanner(os.Stdin)}\n\ts.stdin.Split(split)\n\ts.stdin.Buffer(make([]byte, bufio.MaxScanTokenSize), int(math.MaxInt32))\n\treturn &s\n}\n\nfunc (s *Stdin) Read() string {\n\ts.stdin.Scan()\n\treturn s.stdin.Text()\n}\n\nfunc (s *Stdin) ReadInt() int {\n\tn, _ := strconv.Atoi(s.Read())\n\treturn n\n}\n\nfunc (s *Stdin) ReadFloat64() float64 {\n\tn, _ := strconv.ParseFloat(s.Read(), 64)\n\treturn n\n}\n\ntype Stdout struct {\n\tstdout *bufio.Writer\n}\n\nfunc NewStdout() *Stdout {\n\treturn &Stdout{bufio.NewWriter(os.Stdout)}\n}\n\nfunc (s *Stdout) Flush() {\n\ts.stdout.Flush()\n}\n\nfunc (s *Stdout) Println(a ...interface{}) {\n\tfmt.Fprintln(s.stdout, a...)\n}\n\nfunc Gcd(x, y int) int {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\n\treturn x\n}\n\nfunc Lcm(x, y int) int {\n\treturn x * y / Gcd(x, y)\n}\n", "language": "Go", "metadata": {"date": 1579663884, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02814.html", "problem_id": "p02814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02814/input.txt", "sample_output_relpath": "derived/input_output/data/p02814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02814/Go/s779377775.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s779377775", "user_id": "u794250528"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc exec(stdin *Stdin, stdout *Stdout) {\n\tn := stdin.ReadInt()\n\tm := stdin.ReadInt()\n\ta := []int{}\n\tfor i := 0; i < n; i++ {\n\t\ta = append(a, stdin.ReadInt())\n\t}\n\n\tc := 0\n\tfor a[0]%2 == 0 {\n\t\ta[0] /= 2\n\t\tc++\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\td := 0\n\t\tfor a[i]%2 == 0 {\n\t\t\ta[i] /= 2\n\t\t\td++\n\t\t}\n\n\t\tif c != d {\n\t\t\tstdout.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfor i := 0; i < c-1; i++ {\n\t\tm /= 2\n\t}\n\n\tlcm := 1\n\tfor i := 0; i < n; i++ {\n\t\tlcm = Lcm(lcm, a[i])\n\t}\n\n\tif lcm <= m {\n\t\tstdout.Println(((m / lcm) + 1) / 2)\n\t} else {\n\t\tstdout.Println(0)\n\t}\n}\n\nfunc main() {\n\tstdout := NewStdout()\n\tdefer stdout.Flush()\n\texec(NewStdin(bufio.ScanWords), stdout)\n}\n\ntype Stdin struct {\n\tstdin *bufio.Scanner\n}\n\nfunc NewStdin(split bufio.SplitFunc) *Stdin {\n\ts := Stdin{bufio.NewScanner(os.Stdin)}\n\ts.stdin.Split(split)\n\ts.stdin.Buffer(make([]byte, bufio.MaxScanTokenSize), int(math.MaxInt32))\n\treturn &s\n}\n\nfunc (s *Stdin) Read() string {\n\ts.stdin.Scan()\n\treturn s.stdin.Text()\n}\n\nfunc (s *Stdin) ReadInt() int {\n\tn, _ := strconv.Atoi(s.Read())\n\treturn n\n}\n\nfunc (s *Stdin) ReadFloat64() float64 {\n\tn, _ := strconv.ParseFloat(s.Read(), 64)\n\treturn n\n}\n\ntype Stdout struct {\n\tstdout *bufio.Writer\n}\n\nfunc NewStdout() *Stdout {\n\treturn &Stdout{bufio.NewWriter(os.Stdout)}\n}\n\nfunc (s *Stdout) Flush() {\n\ts.stdout.Flush()\n}\n\nfunc (s *Stdout) Println(a ...interface{}) {\n\tfmt.Fprintln(s.stdout, a...)\n}\n\nfunc Gcd(x, y int) int {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\n\treturn x\n}\n\nfunc Lcm(x, y int) int {\n\treturn x * y / Gcd(x, y)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "sample_input": "2 50\n6 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02814", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1595, "cpu_time_ms": 40, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s870461948", "group_id": "codeNet:p02816", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn, a, b := input()\n\tc := xorArr(a)\n\td := xorArr(b)\n\tfor i := 0; i < n; {\n\t\tf, s := equal(i, c, d)\n\t\tif f {\n\t\t\tfmt.Println(i, b[0]^a[i])\n\t\t}\n\t\ti += s\n\t}\n}\n\nfunc equal(k int, c, d []int) (bool, int) {\n\tn := len(c)\n\ts := 1\n\tfor i := range c {\n\t\tif d[i] != c[(i+k)%n] {\n\t\t\treturn false, s\n\t\t}\n\t}\n\treturn true, s\n}\n\nfunc xorArr(a []int) []int {\n\tn := len(a)\n\tc := make([]int, n, n)\n\tfor i := range a {\n\t\tc[i] = a[i] ^ a[(i+1)%n]\n\t}\n\treturn c\n}\n\nfunc input() (int, []int, []int) {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n, n)\n\tb := make([]int, n, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\treturn n, a, b\n}\n", "language": "Go", "metadata": {"date": 1590732411, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02816.html", "problem_id": "p02816", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02816/input.txt", "sample_output_relpath": "derived/input_output/data/p02816/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02816/Go/s870461948.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s870461948", "user_id": "u037710225"}, "prompt_components": {"gold_output": "1 3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn, a, b := input()\n\tc := xorArr(a)\n\td := xorArr(b)\n\tfor i := 0; i < n; {\n\t\tf, s := equal(i, c, d)\n\t\tif f {\n\t\t\tfmt.Println(i, b[0]^a[i])\n\t\t}\n\t\ti += s\n\t}\n}\n\nfunc equal(k int, c, d []int) (bool, int) {\n\tn := len(c)\n\ts := 1\n\tfor i := range c {\n\t\tif d[i] != c[(i+k)%n] {\n\t\t\treturn false, s\n\t\t}\n\t}\n\treturn true, s\n}\n\nfunc xorArr(a []int) []int {\n\tn := len(a)\n\tc := make([]int, n, n)\n\tfor i := range a {\n\t\tc[i] = a[i] ^ a[(i+1)%n]\n\t}\n\treturn c\n}\n\nfunc input() (int, []int, []int) {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n, n)\n\tb := make([]int, n, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\treturn n, a, b\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are two sequences a=\\{a_0,\\ldots,a_{N-1}\\} and b=\\{b_0,\\ldots,b_{N-1}\\} of N non-negative integers each.\n\nSnuke will choose an integer k such that 0 \\leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\\ldots,a_{N-1}'\\}, as follows:\n\na_i'= a_{i+k \\mod N}\\ XOR \\ x\n\nFind all pairs (k,x) such that a' will be equal to b.\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq a_i,b_i < 2^{30}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_0 a_1 ... a_{N-1}\nb_0 b_1 ... b_{N-1}\n\nOutput\n\nPrint all pairs (k, x) such that a' and b will be equal, using one line for each pair, in ascending order of k (ascending order of x for pairs with the same k).\n\nIf there are no such pairs, the output should be empty.\n\nSample Input 1\n\n3\n0 2 1\n1 2 3\n\nSample Output 1\n\n1 3\n\nIf (k,x)=(1,3),\n\na_0'=(a_1\\ XOR \\ 3)=1\n\na_1'=(a_2\\ XOR \\ 3)=2\n\na_2'=(a_0\\ XOR \\ 3)=3\n\nand we have a' = b.\n\nSample Input 2\n\n5\n0 0 0 0 0\n2 2 2 2 2\n\nSample Output 2\n\n0 2\n1 2\n2 2\n3 2\n4 2\n\nSample Input 3\n\n6\n0 1 3 7 6 4\n1 5 4 6 2 3\n\nSample Output 3\n\n2 2\n5 5\n\nSample Input 4\n\n2\n1 2\n0 0\n\nSample Output 4\n\nNo pairs may satisfy the condition.", "sample_input": "3\n0 2 1\n1 2 3\n"}, "reference_outputs": ["1 3\n"], "source_document_id": "p02816", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are two sequences a=\\{a_0,\\ldots,a_{N-1}\\} and b=\\{b_0,\\ldots,b_{N-1}\\} of N non-negative integers each.\n\nSnuke will choose an integer k such that 0 \\leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\\ldots,a_{N-1}'\\}, as follows:\n\na_i'= a_{i+k \\mod N}\\ XOR \\ x\n\nFind all pairs (k,x) such that a' will be equal to b.\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq a_i,b_i < 2^{30}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_0 a_1 ... a_{N-1}\nb_0 b_1 ... b_{N-1}\n\nOutput\n\nPrint all pairs (k, x) such that a' and b will be equal, using one line for each pair, in ascending order of k (ascending order of x for pairs with the same k).\n\nIf there are no such pairs, the output should be empty.\n\nSample Input 1\n\n3\n0 2 1\n1 2 3\n\nSample Output 1\n\n1 3\n\nIf (k,x)=(1,3),\n\na_0'=(a_1\\ XOR \\ 3)=1\n\na_1'=(a_2\\ XOR \\ 3)=2\n\na_2'=(a_0\\ XOR \\ 3)=3\n\nand we have a' = b.\n\nSample Input 2\n\n5\n0 0 0 0 0\n2 2 2 2 2\n\nSample Output 2\n\n0 2\n1 2\n2 2\n3 2\n4 2\n\nSample Input 3\n\n6\n0 1 3 7 6 4\n1 5 4 6 2 3\n\nSample Output 3\n\n2 2\n5 5\n\nSample Input 4\n\n2\n1 2\n0 0\n\nSample Output 4\n\nNo pairs may satisfy the condition.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 691, "cpu_time_ms": 2108, "memory_kb": 10752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497534762", "group_id": "codeNet:p02817", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\nfunc main() {\n\tsolve()\n}\n\nfunc solve() {\n\tvar S, T string\n\tfmt.Scanf(\"%s %s\", &S, &T)\n\tfmt.Println(T + S)\n}\n\nfunc ReadLineInt64() []int64 {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\n\t\tbuf = append(buf, l...)\n\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\tstr := strings.Split(string(buf), \" \")\n\tl := len(str)\n\n\tret := make([]int64, l)\n\n\tfor i, s := range str {\n\t\tret[i] = s2i64(s)\n\t}\n\treturn ret\n}\n\nfunc ReadLineInt() []int {\n\tvalues := ReadLineInt64()\n\tret := make([]int, len(values))\n\tfor i, v := range values {\n\t\tret[i] = int(v)\n\t}\n\treturn ret\n}\n\nfunc ReadInt() int {\n\tv := ReadLineInt()\n\treturn v[0]\n}\nfunc ReadInt2() (int, int) {\n\tv := ReadLineInt()\n\treturn v[0], v[1]\n}\nfunc ReadInt3() (int, int, int) {\n\tv := ReadLineInt()\n\treturn v[0], v[1], v[2]\n}\nfunc ReadInt4() (int, int, int, int) {\n\tv := ReadLineInt()\n\treturn v[0], v[1], v[2], v[3]\n}\n\nfunc ReadInt64() int64 {\n\tv := ReadLineInt64()\n\treturn v[0]\n}\nfunc ReadInt64_2() (int64, int64) {\n\tv := ReadLineInt64()\n\treturn v[0], v[1]\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\tv := ReadLineInt64()\n\treturn v[0], v[1], v[2]\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\tv := ReadLineInt64()\n\treturn v[0], v[1], v[2], v[3]\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int64\nfunc Bool2Int64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc Abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc Min64(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc Max64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Distance64(a, b int64) int64 {\n\treturn Abs64(a - b)\n}\n\n// For int\nfunc Bool2Int(b bool) int {\n\tif b {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc Abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc Min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Distance(a, b int) int {\n\treturn Abs(a - b)\n}\n", "language": "Go", "metadata": {"date": 1592153314, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02817.html", "problem_id": "p02817", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02817/input.txt", "sample_output_relpath": "derived/input_output/data/p02817/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02817/Go/s497534762.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s497534762", "user_id": "u811202694"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\nfunc main() {\n\tsolve()\n}\n\nfunc solve() {\n\tvar S, T string\n\tfmt.Scanf(\"%s %s\", &S, &T)\n\tfmt.Println(T + S)\n}\n\nfunc ReadLineInt64() []int64 {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\n\t\tbuf = append(buf, l...)\n\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\tstr := strings.Split(string(buf), \" \")\n\tl := len(str)\n\n\tret := make([]int64, l)\n\n\tfor i, s := range str {\n\t\tret[i] = s2i64(s)\n\t}\n\treturn ret\n}\n\nfunc ReadLineInt() []int {\n\tvalues := ReadLineInt64()\n\tret := make([]int, len(values))\n\tfor i, v := range values {\n\t\tret[i] = int(v)\n\t}\n\treturn ret\n}\n\nfunc ReadInt() int {\n\tv := ReadLineInt()\n\treturn v[0]\n}\nfunc ReadInt2() (int, int) {\n\tv := ReadLineInt()\n\treturn v[0], v[1]\n}\nfunc ReadInt3() (int, int, int) {\n\tv := ReadLineInt()\n\treturn v[0], v[1], v[2]\n}\nfunc ReadInt4() (int, int, int, int) {\n\tv := ReadLineInt()\n\treturn v[0], v[1], v[2], v[3]\n}\n\nfunc ReadInt64() int64 {\n\tv := ReadLineInt64()\n\treturn v[0]\n}\nfunc ReadInt64_2() (int64, int64) {\n\tv := ReadLineInt64()\n\treturn v[0], v[1]\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\tv := ReadLineInt64()\n\treturn v[0], v[1], v[2]\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\tv := ReadLineInt64()\n\treturn v[0], v[1], v[2], v[3]\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int64\nfunc Bool2Int64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc Abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc Min64(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc Max64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Distance64(a, b int64) int64 {\n\treturn Abs64(a - b)\n}\n\n// For int\nfunc Bool2Int(b bool) int {\n\tif b {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc Abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc Min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Distance(a, b int) int {\n\treturn Abs(a - b)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "sample_input": "oder atc\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p02817", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2374, "cpu_time_ms": 16, "memory_kb": 4992}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s159224403", "group_id": "codeNet:p02818", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b, &k)\n\tfor i:=0; i=1 {\n\t\t\ta--\n\t\t}else if b >=1{\n\t\t\tb--\n\t\t}\n\t}\n\tfmt.Println(a, b)\n}", "language": "Go", "metadata": {"date": 1596123835, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/Go/s159224403.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s159224403", "user_id": "u223172005"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b, &k)\n\tfor i:=0; i=1 {\n\t\t\ta--\n\t\t}else if b >=1{\n\t\t\tb--\n\t\t}\n\t}\n\tfmt.Println(a, b)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 173, "cpu_time_ms": 2205, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s356760214", "group_id": "codeNet:p02818", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &k)\n\tif a >= k {\n\t\tfmt.Printf(\"%d %d\", a-k, b)\n\t} else if a+b >= k {\n\t\tfmt.Printf(\"%d %d\", 0, a+b-k)\n\t} else {\n\t\tfmt.Println(\"0 0\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587980413, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/Go/s356760214.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s356760214", "user_id": "u131131890"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &k)\n\tif a >= k {\n\t\tfmt.Printf(\"%d %d\", a-k, b)\n\t} else if a+b >= k {\n\t\tfmt.Printf(\"%d %d\", 0, a+b-k)\n\t} else {\n\t\tfmt.Println(\"0 0\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 232, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448046999", "group_id": "codeNet:p02818", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\ta, b, k := scanInt(), scanInt(), scanInt()\n\taa, ab := a, b\n\tif (k - a) > 0 {\n\t\taa = 0\n\t\tk = k - a\n\t} else {\n\t\taa -= k\n\t\tfmt.Println(aa, ab)\n\t\treturn\n\t}\n\tif (k - b) > 0 {\n\t\tab = 0\n\t} else {\n\t\tab -= k\n\t}\n\n\tfmt.Println(aa, ab)\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanText())\n\treturn i\n}\n\nfunc scanInts(size int) []int {\n\tints := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tints[i] = scanInt()\n\t}\n\treturn ints\n}\n\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanText(), 64)\n\treturn f\n}\n\nfunc scanFloat64s(size int) []float64 {\n\tf := make([]float64, size)\n\tfor i := 0; i < size; i++ {\n\t\tf[i] = scanFloat64()\n\t}\n\treturn f\n}\n\nfunc scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanTexts(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanText()\n\t}\n\treturn s\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\n// greatest common divisor(最大公約数)\nfunc gcd(a, b int) int {\n\tfor {\n\t\tmod := a % b\n\t\tif mod == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta, b = b, mod\n\t}\n}\n\n// latest common multiple(最小公倍数)\nfunc lcm(a, b int) int {\n\treturn (a / gcd(a, b)) * b\n}\n\nfunc fact(n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\n\nfunc isPrimeNum(n int) bool {\n\n\tif n <= 1 {\n\t\treturn false\n\t}\n\n\tl := int(math.Sqrt(float64(n)) + 1.)\n\tfor i := 2; i < l; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1586732047, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/Go/s448046999.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448046999", "user_id": "u550884590"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\ta, b, k := scanInt(), scanInt(), scanInt()\n\taa, ab := a, b\n\tif (k - a) > 0 {\n\t\taa = 0\n\t\tk = k - a\n\t} else {\n\t\taa -= k\n\t\tfmt.Println(aa, ab)\n\t\treturn\n\t}\n\tif (k - b) > 0 {\n\t\tab = 0\n\t} else {\n\t\tab -= k\n\t}\n\n\tfmt.Println(aa, ab)\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanText())\n\treturn i\n}\n\nfunc scanInts(size int) []int {\n\tints := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tints[i] = scanInt()\n\t}\n\treturn ints\n}\n\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanText(), 64)\n\treturn f\n}\n\nfunc scanFloat64s(size int) []float64 {\n\tf := make([]float64, size)\n\tfor i := 0; i < size; i++ {\n\t\tf[i] = scanFloat64()\n\t}\n\treturn f\n}\n\nfunc scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanTexts(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanText()\n\t}\n\treturn s\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\n// greatest common divisor(最大公約数)\nfunc gcd(a, b int) int {\n\tfor {\n\t\tmod := a % b\n\t\tif mod == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta, b = b, mod\n\t}\n}\n\n// latest common multiple(最小公倍数)\nfunc lcm(a, b int) int {\n\treturn (a / gcd(a, b)) * b\n}\n\nfunc fact(n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\n\nfunc isPrimeNum(n int) bool {\n\n\tif n <= 1 {\n\t\treturn false\n\t}\n\n\tl := int(math.Sqrt(float64(n)) + 1.)\n\tfor i := 2; i < l; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1709, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s558666100", "group_id": "codeNet:p02819", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc isPrime(n int) bool {\n\tvar tmp float64 = float64(n)\n\trng := int(math.Ceil(math.Sqrt(tmp)))\n\t// fmt.Printf(\"rng = %d, n = %d, jajaja = %f\\n\", rng, n, math.Sqrt(float64(n)))\n\tfor i := 2; i < rng; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\tfor i := x; i < 100004; i++ {\n\t\tif isPrime(i) {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1578780337, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02819.html", "problem_id": "p02819", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02819/input.txt", "sample_output_relpath": "derived/input_output/data/p02819/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02819/Go/s558666100.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s558666100", "user_id": "u737877067"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc isPrime(n int) bool {\n\tvar tmp float64 = float64(n)\n\trng := int(math.Ceil(math.Sqrt(tmp)))\n\t// fmt.Printf(\"rng = %d, n = %d, jajaja = %f\\n\", rng, n, math.Sqrt(float64(n)))\n\tfor i := 2; i < rng; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\tfor i := x; i < 100004; i++ {\n\t\tif isPrime(i) {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 425, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s858440561", "group_id": "codeNet:p02819", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar X int\n\tfmt.Scan(&X)\n\tfor !isPrime(X) {\n\t\tX++\n\t}\n\tfmt.Println(X)\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1577669500, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02819.html", "problem_id": "p02819", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02819/input.txt", "sample_output_relpath": "derived/input_output/data/p02819/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02819/Go/s858440561.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s858440561", "user_id": "u008666209"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar X int\n\tfmt.Scan(&X)\n\tfor !isPrime(X) {\n\t\tX++\n\t}\n\tfmt.Println(X)\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 389, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s477665364", "group_id": "codeNet:p02820", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\nfunc ch(a byte, R, S, P int) (byte, int) {\n\tvar ret byte\n\tvar pt int\n\tswitch a {\n\tcase 'r':\n\t\tret = 'p'\n\t\tpt = P\n\tcase 's':\n\t\tret = 'r'\n\t\tpt = R\n\tcase 'p':\n\t\tret = 's'\n\t\tpt = S\n\t}\n\treturn ret, pt\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, K := getInt(), getInt()\n\tR, S, P := getInt(), getInt(), getInt()\n\tT := getString()\n\n\tans := 0\n\tm := make([]byte, N)\n\tfor i, v := range T {\n\t\tmy, pt := ch(byte(v), R, S, P)\n\t\tif i >= K && m[i-K] == my {\n\t\t\tmy = 'x'\n\t\t\tpt = 0\n\t\t}\n\t\tans += pt\n\t\tm[i] = my\n\t}\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1591148969, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02820.html", "problem_id": "p02820", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02820/input.txt", "sample_output_relpath": "derived/input_output/data/p02820/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02820/Go/s477665364.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s477665364", "user_id": "u814575783"}, "prompt_components": {"gold_output": "27\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\nfunc ch(a byte, R, S, P int) (byte, int) {\n\tvar ret byte\n\tvar pt int\n\tswitch a {\n\tcase 'r':\n\t\tret = 'p'\n\t\tpt = P\n\tcase 's':\n\t\tret = 'r'\n\t\tpt = R\n\tcase 'p':\n\t\tret = 's'\n\t\tpt = S\n\t}\n\treturn ret, pt\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, K := getInt(), getInt()\n\tR, S, P := getInt(), getInt(), getInt()\n\tT := getString()\n\n\tans := 0\n\tm := make([]byte, N)\n\tfor i, v := range T {\n\t\tmy, pt := ch(byte(v), R, S, P)\n\t\tif i >= K && m[i-K] == my {\n\t\t\tmy = 'x'\n\t\t\tpt = 0\n\t\t}\n\t\tans += pt\n\t\tm[i] = my\n\t}\n\tout(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAt an arcade, Takahashi is playing a game called RPS Battle, which is played as follows:\n\nThe player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a round.)\n\nEach time the player wins a round, depending on which hand he/she uses, he/she earns the following score (no points for a draw or a loss):\n\nR points for winning with Rock;\n\nS points for winning with Scissors;\n\nP points for winning with Paper.\n\nHowever, in the i-th round, the player cannot use the hand he/she used in the (i-K)-th round. (In the first K rounds, the player can use any hand.)\n\nBefore the start of the game, the machine decides the hand it will play in each round. With supernatural power, Takahashi managed to read all of those hands.\n\nThe information Takahashi obtained is given as a string T. If the i-th character of T (1 \\leq i \\leq N) is r, the machine will play Rock in the i-th round. Similarly, p and s stand for Paper and Scissors, respectively.\n\nWhat is the maximum total score earned in the game by adequately choosing the hand to play in each round?\n\nNotes\n\nIn this problem, Rock Paper Scissors can be thought of as a two-player game, in which each player simultaneously forms Rock, Paper, or Scissors with a hand.\n\nIf a player chooses Rock and the other chooses Scissors, the player choosing Rock wins;\n\nif a player chooses Scissors and the other chooses Paper, the player choosing Scissors wins;\n\nif a player chooses Paper and the other chooses Rock, the player choosing Paper wins;\n\nif both players play the same hand, it is a draw.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N-1\n\n1 \\leq R,S,P \\leq 10^4\n\nN,K,R,S, and P are all integers.\n\n|T| = N\n\nT consists of r, p, and s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nR S P\nT\n\nOutput\n\nPrint the maximum total score earned in the game.\n\nSample Input 1\n\n5 2\n8 7 6\nrsrpr\n\nSample Output 1\n\n27\n\nThe machine will play {Rock, Scissors, Rock, Paper, Rock}.\n\nWe can, for example, play {Paper, Rock, Rock, Scissors, Paper} against it to earn 27 points.\nWe cannot earn more points, so the answer is 27.\n\nSample Input 2\n\n7 1\n100 10 1\nssssppr\n\nSample Output 2\n\n211\n\nSample Input 3\n\n30 5\n325 234 123\nrspsspspsrpspsppprpsprpssprpsr\n\nSample Output 3\n\n4996", "sample_input": "5 2\n8 7 6\nrsrpr\n"}, "reference_outputs": ["27\n"], "source_document_id": "p02820", "source_text": "Score : 400 points\n\nProblem Statement\n\nAt an arcade, Takahashi is playing a game called RPS Battle, which is played as follows:\n\nThe player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a round.)\n\nEach time the player wins a round, depending on which hand he/she uses, he/she earns the following score (no points for a draw or a loss):\n\nR points for winning with Rock;\n\nS points for winning with Scissors;\n\nP points for winning with Paper.\n\nHowever, in the i-th round, the player cannot use the hand he/she used in the (i-K)-th round. (In the first K rounds, the player can use any hand.)\n\nBefore the start of the game, the machine decides the hand it will play in each round. With supernatural power, Takahashi managed to read all of those hands.\n\nThe information Takahashi obtained is given as a string T. If the i-th character of T (1 \\leq i \\leq N) is r, the machine will play Rock in the i-th round. Similarly, p and s stand for Paper and Scissors, respectively.\n\nWhat is the maximum total score earned in the game by adequately choosing the hand to play in each round?\n\nNotes\n\nIn this problem, Rock Paper Scissors can be thought of as a two-player game, in which each player simultaneously forms Rock, Paper, or Scissors with a hand.\n\nIf a player chooses Rock and the other chooses Scissors, the player choosing Rock wins;\n\nif a player chooses Scissors and the other chooses Paper, the player choosing Scissors wins;\n\nif a player chooses Paper and the other chooses Rock, the player choosing Paper wins;\n\nif both players play the same hand, it is a draw.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N-1\n\n1 \\leq R,S,P \\leq 10^4\n\nN,K,R,S, and P are all integers.\n\n|T| = N\n\nT consists of r, p, and s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nR S P\nT\n\nOutput\n\nPrint the maximum total score earned in the game.\n\nSample Input 1\n\n5 2\n8 7 6\nrsrpr\n\nSample Output 1\n\n27\n\nThe machine will play {Rock, Scissors, Rock, Paper, Rock}.\n\nWe can, for example, play {Paper, Rock, Rock, Scissors, Paper} against it to earn 27 points.\nWe cannot earn more points, so the answer is 27.\n\nSample Input 2\n\n7 1\n100 10 1\nssssppr\n\nSample Output 2\n\n211\n\nSample Input 3\n\n30 5\n325 234 123\nrspsspspsrpspsppprpsprpssprpsr\n\nSample Output 3\n\n4996", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1379, "cpu_time_ms": 4, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s526623195", "group_id": "codeNet:p02823", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for A - Table Tennis Training\n\tvar N, A, B int\n\tfmt.Scanf(\"%d %d %d\", &N, &A, &B)\n\n\tif (B-A)%2 == 0 {\n\t\tfmt.Println((B - A) / 2)\n\t} else {\n\t\tfmt.Println(math.Ceil(float64(B-A)/2) + 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1599030737, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02823.html", "problem_id": "p02823", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02823/input.txt", "sample_output_relpath": "derived/input_output/data/p02823/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02823/Go/s526623195.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s526623195", "user_id": "u128015095"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for A - Table Tennis Training\n\tvar N, A, B int\n\tfmt.Scanf(\"%d %d %d\", &N, &A, &B)\n\n\tif (B-A)%2 == 0 {\n\t\tfmt.Println((B - A) / 2)\n\t} else {\n\t\tfmt.Println(math.Ceil(float64(B-A)/2) + 1)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "sample_input": "5 2 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02823", "source_text": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 253, "cpu_time_ms": 4, "memory_kb": 1928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s248274926", "group_id": "codeNet:p02823", "input_text": "package main\n \nimport (\n \"fmt\"\n \"math\"\n)\n \nfunc foo(n, a, b, i int) int {\n if a==b {\n return i\n } else if a b {\n if n-a <= b-1 {\n if a != n {\n a = (a+1)%n\n }\n b = (b+1)%n\n } else {\n a = (a-1)%n\n if b != 1 {\n b = (b-1)%n\n }\n }\n } else {\n if n-b <= a-1 {\n a = (a+1)%n\n if b != n {\n b = (b+1)%n\n }\n } else {\n if a != 1 {\n a = (a-1)%n\n }\n b = (b-1)%n\n } \n }\n i = i+1\n return foo(n, a, b, i)\n }\n}\n \nfunc abs(n, a, b int) int {\n return int(math.Abs(float64(a-b)))%n\n}\n \nfunc main() {\n var n, a, b int\n fmt.Scan(&n)\n fmt.Scan(&a)\n fmt.Scan(&b)\n foo(n, a, b, 0)\n}", "language": "Go", "metadata": {"date": 1577587694, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02823.html", "problem_id": "p02823", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02823/input.txt", "sample_output_relpath": "derived/input_output/data/p02823/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02823/Go/s248274926.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s248274926", "user_id": "u835488697"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n \"math\"\n)\n \nfunc foo(n, a, b, i int) int {\n if a==b {\n return i\n } else if a b {\n if n-a <= b-1 {\n if a != n {\n a = (a+1)%n\n }\n b = (b+1)%n\n } else {\n a = (a-1)%n\n if b != 1 {\n b = (b-1)%n\n }\n }\n } else {\n if n-b <= a-1 {\n a = (a+1)%n\n if b != n {\n b = (b+1)%n\n }\n } else {\n if a != 1 {\n a = (a-1)%n\n }\n b = (b-1)%n\n } \n }\n i = i+1\n return foo(n, a, b, i)\n }\n}\n \nfunc abs(n, a, b int) int {\n return int(math.Abs(float64(a-b)))%n\n}\n \nfunc main() {\n var n, a, b int\n fmt.Scan(&n)\n fmt.Scan(&a)\n fmt.Scan(&b)\n foo(n, a, b, 0)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "sample_input": "5 2 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02823", "source_text": "Score : 300 points\n\nProblem Statement\n\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training consists of rounds.\nIn each round, the players form N pairs, one pair per table.\nIn each pair, competitors play a match against each other.\nAs a result, one of them wins and the other one loses.\n\nThe winner of the match on table X plays on table X-1 in the next round,\nexcept for the winner of the match on table 1 who stays at table 1.\n\nSimilarly, the loser of the match on table X plays on table X+1 in the next round,\nexcept for the loser of the match on table N who stays at table N.\n\nTwo friends are playing their first round matches on distinct tables A and B.\nLet's assume that the friends are strong enough to win or lose any match at will.\nWhat is the smallest number of rounds after which the friends can get to play a match against each other?\n\nConstraints\n\n2 \\leq N \\leq 10^{18}\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the smallest number of rounds after which the friends can get to play a match against each other.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\n1\n\nIf the first friend loses their match and the second friend wins their match, they will both move to table 3 and play each other in the next round.\n\nSample Input 2\n\n5 2 3\n\nSample Output 2\n\n2\n\nIf both friends win two matches in a row, they will both move to table 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 955, "cpu_time_ms": 2111, "memory_kb": 855936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s315114912", "group_id": "codeNet:p02829", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var A int\n var B int\n fmt.Scan(&A) \n fmt.Scan(&B)\n var C = 6 - (A+B)\n fmt.Print(C);\n}", "language": "Go", "metadata": {"date": 1577146393, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02829.html", "problem_id": "p02829", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02829/input.txt", "sample_output_relpath": "derived/input_output/data/p02829/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02829/Go/s315114912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s315114912", "user_id": "u223095291"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var A int\n var B int\n fmt.Scan(&A) \n fmt.Scan(&B)\n var C = 6 - (A+B)\n fmt.Print(C);\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "sample_input": "3\n1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02829", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 147, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s840169820", "group_id": "codeNet:p02830", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar n int\n\tvar s, t string\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%s %s\", &s, &t)\n\n\tfor i := 0; i< n; i++ {\n\t\tfmt.Printf(\"%s%s\", string(s[i]), string(t[i]))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1577066710, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02830.html", "problem_id": "p02830", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02830/input.txt", "sample_output_relpath": "derived/input_output/data/p02830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02830/Go/s840169820.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s840169820", "user_id": "u638629468"}, "prompt_components": {"gold_output": "icpc\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar n int\n\tvar s, t string\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%s %s\", &s, &t)\n\n\tfor i := 0; i< n; i++ {\n\t\tfmt.Printf(\"%s%s\", string(s[i]), string(t[i]))\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "sample_input": "2\nip cc\n"}, "reference_outputs": ["icpc\n"], "source_document_id": "p02830", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 418, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s143255453", "group_id": "codeNet:p02830", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readString2() (string, string) { a := readStringArray(); return a[0], a[1] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc main() {\n n := readInt()\n s, t := readString2()\n\n for i := 0; i < n; i++ {\n fmt.Print(string(s[i]))\n fmt.Print(string(t[i]))\n }\n}", "language": "Go", "metadata": {"date": 1577066631, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02830.html", "problem_id": "p02830", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02830/input.txt", "sample_output_relpath": "derived/input_output/data/p02830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02830/Go/s143255453.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s143255453", "user_id": "u502098699"}, "prompt_components": {"gold_output": "icpc\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readString2() (string, string) { a := readStringArray(); return a[0], a[1] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc main() {\n n := readInt()\n s, t := readString2()\n\n for i := 0; i < n; i++ {\n fmt.Print(string(s[i]))\n fmt.Print(string(t[i]))\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "sample_input": "2\nip cc\n"}, "reference_outputs": ["icpc\n"], "source_document_id": "p02830", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1032, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s901204915", "group_id": "codeNet:p02831", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println(Lcm(a, b))\n}\n\nfunc Gcd(x, y int) int {\n\tmod := x % y\n\tif mod > 0 {\n\t\treturn Gcd(y, mod)\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc Lcm(x, y int) int {\n\treturn x * y / Gcd(x, y)\n}\n", "language": "Go", "metadata": {"date": 1585511959, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02831.html", "problem_id": "p02831", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02831/input.txt", "sample_output_relpath": "derived/input_output/data/p02831/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02831/Go/s901204915.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s901204915", "user_id": "u717943620"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println(Lcm(a, b))\n}\n\nfunc Gcd(x, y int) int {\n\tmod := x % y\n\tif mod > 0 {\n\t\treturn Gcd(y, mod)\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc Lcm(x, y int) int {\n\treturn x * y / Gcd(x, y)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 260, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s877323206", "group_id": "codeNet:p02831", "input_text": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\tfmt.Println(lcm(A, B))\n}\n", "language": "Go", "metadata": {"date": 1580051100, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02831.html", "problem_id": "p02831", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02831/input.txt", "sample_output_relpath": "derived/input_output/data/p02831/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02831/Go/s877323206.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s877323206", "user_id": "u529632089"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\tfmt.Println(lcm(A, B))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 229, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s825292359", "group_id": "codeNet:p02832", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc brickBreak(n int, a []int) int {\n\tc, j := 0, 1\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] != j {\n\t\t\tc++\n\t\t} else {\n\t\t\tj++\n\t\t}\n\t}\n\tif c == n {\n\t\treturn -1\n\t}\n\treturn c\n}\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 10240*10240)\n\n\tn, err := strconv.Atoi(readLine(reader))\n\tcheckError(err)\n\ta := make([]int, n)\n\tss := strings.Split(readLine(reader), \" \")\n\tfor i := range ss {\n\t\ta[i], err = strconv.Atoi(ss[i])\n\t\tcheckError(err)\n\t}\n\tfmt.Println(brickBreak(n, a))\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1577071304, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02832.html", "problem_id": "p02832", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02832/input.txt", "sample_output_relpath": "derived/input_output/data/p02832/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02832/Go/s825292359.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s825292359", "user_id": "u568763892"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc brickBreak(n int, a []int) int {\n\tc, j := 0, 1\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] != j {\n\t\t\tc++\n\t\t} else {\n\t\t\tj++\n\t\t}\n\t}\n\tif c == n {\n\t\treturn -1\n\t}\n\treturn c\n}\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 10240*10240)\n\n\tn, err := strconv.Atoi(readLine(reader))\n\tcheckError(err)\n\ta := make([]int, n)\n\tss := strings.Split(readLine(reader), \" \")\n\tfor i := range ss {\n\t\ta[i], err = strconv.Atoi(ss[i])\n\t\tcheckError(err)\n\t}\n\tfmt.Println(brickBreak(n, a))\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "sample_input": "3\n2 1 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02832", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 776, "cpu_time_ms": 35, "memory_kb": 11776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s799257407", "group_id": "codeNet:p02832", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\ta := make([]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n\tc := 1\n\tn := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] == c {\n\t\t\tc++\n\t\t} else {\n\t\t\tn++\n\t\t}\n\t}\n\n\tif c == 1 || n == N {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(n)\n\t}\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1577067230, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02832.html", "problem_id": "p02832", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02832/input.txt", "sample_output_relpath": "derived/input_output/data/p02832/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02832/Go/s799257407.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s799257407", "user_id": "u578274732"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\ta := make([]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n\tc := 1\n\tn := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] == c {\n\t\t\tc++\n\t\t} else {\n\t\t\tn++\n\t\t}\n\t}\n\n\tif c == 1 || n == N {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(n)\n\t}\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "sample_input": "3\n2 1 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02832", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 838, "cpu_time_ms": 46, "memory_kb": 4864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s060336760", "group_id": "codeNet:p02832", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcdll(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdll(b, a%b)\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\ts := 0\n\tfor i := range a {\n\t\tif a[i] == s+1 {\n\t\t\ts++\n\t\t}\n\t}\n\n\t//eprintln(N, s)\n\tif s == 0 {\n\t\tprintln(-1)\n\t} else {\n\t\tprintln(N - s)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1577067179, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02832.html", "problem_id": "p02832", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02832/input.txt", "sample_output_relpath": "derived/input_output/data/p02832/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02832/Go/s060336760.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s060336760", "user_id": "u705974985"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcdll(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdll(b, a%b)\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\ts := 0\n\tfor i := range a {\n\t\tif a[i] == s+1 {\n\t\t\ts++\n\t\t}\n\t}\n\n\t//eprintln(N, s)\n\tif s == 0 {\n\t\tprintln(-1)\n\t} else {\n\t\tprintln(N - s)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "sample_input": "3\n2 1 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02832", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N bricks arranged in a row from left to right.\n\nThe i-th brick from the left (1 \\leq i \\leq N) has an integer a_i written on it.\n\nAmong them, you can break at most N-1 bricks of your choice.\n\nLet us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \\leq i \\leq K), the i-th of those brick from the left has the integer i written on it.\n\nFind the minimum number of bricks you need to break to satisfy Snuke's desire. If his desire is unsatisfiable, print -1 instead.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200000\n\n1 \\leq a_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of bricks that need to be broken to satisfy Snuke's desire, or print -1 if his desire is unsatisfiable.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n1\n\nIf we break the leftmost brick, the remaining bricks have integers 1 and 2 written on them from left to right, in which case Snuke will be satisfied.\n\nSample Input 2\n\n3\n2 2 2\n\nSample Output 2\n\n-1\n\nIn this case, there is no way to break some of the bricks to satisfy Snuke's desire.\n\nSample Input 3\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 3\n\n7\n\nSample Input 4\n\n1\n1\n\nSample Output 4\n\n0\n\nThere may be no need to break the bricks at all.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5320, "cpu_time_ms": 47, "memory_kb": 6272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s982330303", "group_id": "codeNet:p02834", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tu := nextInt()\n\tv := nextInt()\n\n\tg := make([][]int, n+1)\n\tfor i := 0; i < n-1; i++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tvs := make([]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tvs[i] = -1\n\t}\n\n\tvs[v] = 0\n\tq := make([]int, 0)\n\tq = append(q, v)\n\tfor len(q) > 0 {\n\t\tcv := q[0]\n\t\tq = q[1:]\n\t\tfor _, nv := range g[cv] {\n\t\t\tif vs[nv] > -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tq = append(q, nv)\n\t\t\tvs[nv] = vs[cv] + 1\n\t\t}\n\t}\n\n\tus := make([]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tus[i] = -1\n\t}\n\tus[u] = 0\n\tq = make([]int, 0)\n\tq = append(q, u)\n\tfor len(q) > 0 {\n\t\tcu := q[0]\n\t\tq = q[1:]\n\t\tfor _, nu := range g[cu] {\n\t\t\tif us[nu] > -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tus[nu] = us[cu] + 1\n\t\t\tif vs[nu] <= us[nu] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tq = append(q, nu)\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < n+1; i++ {\n\t\tif us[i] == -1 || vs[i] <= us[i] {\n\t\t\tcontinue\n\t\t}\n\t\td := max(vs[i]-us[i]-1, us[i])\n\t\tans = max(ans, d)\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1594262865, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02834.html", "problem_id": "p02834", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02834/input.txt", "sample_output_relpath": "derived/input_output/data/p02834/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02834/Go/s982330303.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s982330303", "user_id": "u902409225"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tu := nextInt()\n\tv := nextInt()\n\n\tg := make([][]int, n+1)\n\tfor i := 0; i < n-1; i++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tvs := make([]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tvs[i] = -1\n\t}\n\n\tvs[v] = 0\n\tq := make([]int, 0)\n\tq = append(q, v)\n\tfor len(q) > 0 {\n\t\tcv := q[0]\n\t\tq = q[1:]\n\t\tfor _, nv := range g[cv] {\n\t\t\tif vs[nv] > -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tq = append(q, nv)\n\t\t\tvs[nv] = vs[cv] + 1\n\t\t}\n\t}\n\n\tus := make([]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tus[i] = -1\n\t}\n\tus[u] = 0\n\tq = make([]int, 0)\n\tq = append(q, u)\n\tfor len(q) > 0 {\n\t\tcu := q[0]\n\t\tq = q[1:]\n\t\tfor _, nu := range g[cu] {\n\t\t\tif us[nu] > -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tus[nu] = us[cu] + 1\n\t\t\tif vs[nu] <= us[nu] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tq = append(q, nu)\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < n+1; i++ {\n\t\tif us[i] == -1 || vs[i] <= us[i] {\n\t\t\tcontinue\n\t\t}\n\t\td := max(vs[i]-us[i]-1, us[i])\n\t\tans = max(ans, d)\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The i-th edge connects Vertex A_i and B_i bidirectionally.\n\nTakahashi is standing at Vertex u, and Aoki is standing at Vertex v.\n\nNow, they will play a game of tag as follows:\n\n1. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Takahashi moves to a vertex of his choice that is adjacent to his current vertex.\n\n2. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Aoki moves to a vertex of his choice that is adjacent to his current vertex.\n\n3. Go back to step 1.\n\nTakahashi performs his moves so that the game ends as late as possible, while Aoki performs his moves so that the game ends as early as possible.\n\nFind the number of moves Aoki will perform before the end of the game if both Takahashi and Aoki know each other's position and strategy.\n\nIt can be proved that the game is bound to end.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq u,v \\leq N\n\nu \\neq v\n\n1 \\leq A_i,B_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN u v\nA_1 B_1\n:\nA_{N-1} B_{N-1}\n\nOutput\n\nPrint the number of moves Aoki will perform before the end of the game.\n\nSample Input 1\n\n5 4 1\n1 2\n2 3\n3 4\n3 5\n\nSample Output 1\n\n2\n\nIf both players play optimally, the game will progress as follows:\n\nTakahashi moves to Vertex 3.\n\nAoki moves to Vertex 2.\n\nTakahashi moves to Vertex 5.\n\nAoki moves to Vertex 3.\n\nTakahashi moves to Vertex 3.\n\nHere, Aoki performs two moves.\n\nNote that, in each move, it is prohibited to stay at the current vertex.\n\nSample Input 2\n\n5 4 5\n1 2\n1 3\n1 4\n1 5\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2 1 2\n1 2\n\nSample Output 3\n\n0\n\nSample Input 4\n\n9 6 1\n1 2\n2 3\n3 4\n4 5\n5 6\n4 7\n7 8\n8 9\n\nSample Output 4\n\n5", "sample_input": "5 4 1\n1 2\n2 3\n3 4\n3 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02834", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices. The i-th edge connects Vertex A_i and B_i bidirectionally.\n\nTakahashi is standing at Vertex u, and Aoki is standing at Vertex v.\n\nNow, they will play a game of tag as follows:\n\n1. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Takahashi moves to a vertex of his choice that is adjacent to his current vertex.\n\n2. If Takahashi and Aoki are standing at the same vertex, the game ends. Otherwise, Aoki moves to a vertex of his choice that is adjacent to his current vertex.\n\n3. Go back to step 1.\n\nTakahashi performs his moves so that the game ends as late as possible, while Aoki performs his moves so that the game ends as early as possible.\n\nFind the number of moves Aoki will perform before the end of the game if both Takahashi and Aoki know each other's position and strategy.\n\nIt can be proved that the game is bound to end.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq u,v \\leq N\n\nu \\neq v\n\n1 \\leq A_i,B_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN u v\nA_1 B_1\n:\nA_{N-1} B_{N-1}\n\nOutput\n\nPrint the number of moves Aoki will perform before the end of the game.\n\nSample Input 1\n\n5 4 1\n1 2\n2 3\n3 4\n3 5\n\nSample Output 1\n\n2\n\nIf both players play optimally, the game will progress as follows:\n\nTakahashi moves to Vertex 3.\n\nAoki moves to Vertex 2.\n\nTakahashi moves to Vertex 5.\n\nAoki moves to Vertex 3.\n\nTakahashi moves to Vertex 3.\n\nHere, Aoki performs two moves.\n\nNote that, in each move, it is prohibited to stay at the current vertex.\n\nSample Input 2\n\n5 4 5\n1 2\n1 3\n1 4\n1 5\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2 1 2\n1 2\n\nSample Output 3\n\n0\n\nSample Input 4\n\n9 6 1\n1 2\n2 3\n3 4\n4 5\n5 6\n4 7\n7 8\n8 9\n\nSample Output 4\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1269, "cpu_time_ms": 75, "memory_kb": 16092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s473833048", "group_id": "codeNet:p02835", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var a,b,c int\n fmt.Scan(&a,&b,&c)\n if a+b+c >= 22{\n print(\"bust\")\n }else{\n print(\"win\")\n}\n}", "language": "Go", "metadata": {"date": 1575857099, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02835/input.txt", "sample_output_relpath": "derived/input_output/data/p02835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02835/Go/s473833048.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s473833048", "user_id": "u511254943"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var a,b,c int\n fmt.Scan(&a,&b,&c)\n if a+b+c >= 22{\n print(\"bust\")\n }else{\n print(\"win\")\n}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "sample_input": "5 7 9\n"}, "reference_outputs": ["win\n"], "source_document_id": "p02835", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 143, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497610157", "group_id": "codeNet:p02836", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar word string\n\tfmt.Scan(&word)\n\tpalindromeHugger(word)\n}\n\nfunc palindromeHugger(word string) int {\n\tvar incidences int\n\twordLenght := len(word) - 1\n\n\tfor i, letter := range word {\n\t\tif byte(letter) != word[wordLenght-i] {\n\t\t\tincidences++\n\t\t}\n\t}\n\n\treturn incidences / 2\n}", "language": "Go", "metadata": {"date": 1593452207, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/Go/s497610157.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s497610157", "user_id": "u799993908"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar word string\n\tfmt.Scan(&word)\n\tpalindromeHugger(word)\n}\n\nfunc palindromeHugger(word string) int {\n\tvar incidences int\n\twordLenght := len(word) - 1\n\n\tfor i, letter := range word {\n\t\tif byte(letter) != word[wordLenght-i] {\n\t\t\tincidences++\n\t\t}\n\t}\n\n\treturn incidences / 2\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 320, "cpu_time_ms": 7, "memory_kb": 1712}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s801016750", "group_id": "codeNet:p02836", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tres := 0\n\tfor i := 0; i < len(s)/2; i++ {\n\t\tif s[i:i+1] != s[len(s)-(i+1):len(s)-i] {\n\t\t\tres++\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1579623285, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/Go/s801016750.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s801016750", "user_id": "u029587648"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tres := 0\n\tfor i := 0; i < len(s)/2; i++ {\n\t\tif s[i:i+1] != s[len(s)-(i+1):len(s)-i] {\n\t\t\tres++\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 194, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s873040972", "group_id": "codeNet:p02836", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\ts := scanner.Text()\n\tn := len(s)\n\n\tvar count int\n\tfor i := 0; i < n/2; i++ {\n\t\tif s[i] != s[n-i-1] {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1576031327, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/Go/s873040972.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s873040972", "user_id": "u471898432"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\ts := scanner.Text()\n\tn := len(s)\n\n\tvar count int\n\tfor i := 0; i < n/2; i++ {\n\t\tif s[i] != s[n-i-1] {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 260, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s019947233", "group_id": "codeNet:p02836", "input_text": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n\tvar S string\n\tvar s []string\n\tvar r []string\n\tvar N int\n\n\tN = 0\n\tr = []string{}\n\n\tfmt.Scan(&S)\n\ts = strings.Split(S, \"\")\n\n\tfor i := 0; i < len(s); i++ {\n\t\tr = append(r, s[len(s)-i-1])\n\t}\n\n\tfor i := 0; i < len(s)/2; i++ {\n\t\tif s[i] != r[i] {\n\t\t\tN++\n\t\t}\n\t}\n fmt.Println(N)\n}\n", "language": "Go", "metadata": {"date": 1575949953, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/Go/s019947233.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s019947233", "user_id": "u924192547"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n\tvar S string\n\tvar s []string\n\tvar r []string\n\tvar N int\n\n\tN = 0\n\tr = []string{}\n\n\tfmt.Scan(&S)\n\ts = strings.Split(S, \"\")\n\n\tfor i := 0; i < len(s); i++ {\n\t\tr = append(r, s[len(s)-i-1])\n\t}\n\n\tfor i := 0; i < len(s)/2; i++ {\n\t\tif s[i] != r[i] {\n\t\t\tN++\n\t\t}\n\t}\n fmt.Println(N)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 341, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s186157266", "group_id": "codeNet:p02837", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tvar m int\n\t\tfmt.Scan(&m)\n\t\tfor ; m > 0; m-- {\n\t\t\tvar x, y uint\n\t\t\tfmt.Scan(&x, &y)\n\t\t\tx--\n\t\t\tif y == 1 {\n\t\t\t\th[i] |= 1 << x\n\t\t\t} else {\n\t\t\t\tl[i] |= 1 << x\n\t\t\t}\n\t\t}\n\t}\n\n\tvar ans int\n\tfor i := 0; i < (1 << uint(n)); i++ {\n\t\tx, y := i, ^i\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i>>uint(j)&1 == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tx |= h[j]\n\t\t\ty |= l[j]\n\t\t}\n\t\tok := true\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif x>>uint(j)&1 == 1 && i>>uint(j)&1 == 0 {\n\t\t\t\tok = false\n\t\t\t}\n\t\t\tif y>>uint(j)&1 == 1 && i>>uint(j)&1 == 1 {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\n\t\tif ok {\n\t\t\tvar cnt int\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif i>>uint(j)&1 == 1 {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ans < cnt {\n\t\t\t\tans = cnt\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592107300, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02837.html", "problem_id": "p02837", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02837/input.txt", "sample_output_relpath": "derived/input_output/data/p02837/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02837/Go/s186157266.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s186157266", "user_id": "u448258717"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tvar m int\n\t\tfmt.Scan(&m)\n\t\tfor ; m > 0; m-- {\n\t\t\tvar x, y uint\n\t\t\tfmt.Scan(&x, &y)\n\t\t\tx--\n\t\t\tif y == 1 {\n\t\t\t\th[i] |= 1 << x\n\t\t\t} else {\n\t\t\t\tl[i] |= 1 << x\n\t\t\t}\n\t\t}\n\t}\n\n\tvar ans int\n\tfor i := 0; i < (1 << uint(n)); i++ {\n\t\tx, y := i, ^i\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i>>uint(j)&1 == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tx |= h[j]\n\t\t\ty |= l[j]\n\t\t}\n\t\tok := true\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif x>>uint(j)&1 == 1 && i>>uint(j)&1 == 0 {\n\t\t\t\tok = false\n\t\t\t}\n\t\t\tif y>>uint(j)&1 == 1 && i>>uint(j)&1 == 1 {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\n\t\tif ok {\n\t\t\tvar cnt int\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif i>>uint(j)&1 == 1 {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ans < cnt {\n\t\t\t\tans = cnt\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always correct or an unkind person whose testimonies may be correct or not.\n\nPerson i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.\n\nHow many honest persons can be among those N people at most?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 15\n\n0 \\leq A_i \\leq N - 1\n\n1 \\leq x_{ij} \\leq N\n\nx_{ij} \\neq i\n\nx_{ij_1} \\neq x_{ij_2} (j_1 \\neq j_2)\n\ny_{ij} = 0, 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\nx_{11} y_{11}\nx_{12} y_{12}\n:\nx_{1A_1} y_{1A_1}\nA_2\nx_{21} y_{21}\nx_{22} y_{22}\n:\nx_{2A_2} y_{2A_2}\n:\nA_N\nx_{N1} y_{N1}\nx_{N2} y_{N2}\n:\nx_{NA_N} y_{NA_N}\n\nOutput\n\nPrint the maximum possible number of honest persons among the N people.\n\nSample Input 1\n\n3\n1\n2 1\n1\n1 1\n1\n2 0\n\nSample Output 1\n\n2\n\nIf Person 1 and Person 2 are honest and Person 3 is unkind, we have two honest persons without inconsistencies, which is the maximum possible number of honest persons.\n\nSample Input 2\n\n3\n2\n2 1\n3 0\n2\n3 1\n1 0\n2\n1 1\n2 0\n\nSample Output 2\n\n0\n\nAssuming that one or more of them are honest immediately leads to a contradiction.\n\nSample Input 3\n\n2\n1\n2 0\n1\n1 0\n\nSample Output 3\n\n1", "sample_input": "3\n1\n2 1\n1\n1 1\n1\n2 0\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02837", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always correct or an unkind person whose testimonies may be correct or not.\n\nPerson i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.\n\nHow many honest persons can be among those N people at most?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 15\n\n0 \\leq A_i \\leq N - 1\n\n1 \\leq x_{ij} \\leq N\n\nx_{ij} \\neq i\n\nx_{ij_1} \\neq x_{ij_2} (j_1 \\neq j_2)\n\ny_{ij} = 0, 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\nx_{11} y_{11}\nx_{12} y_{12}\n:\nx_{1A_1} y_{1A_1}\nA_2\nx_{21} y_{21}\nx_{22} y_{22}\n:\nx_{2A_2} y_{2A_2}\n:\nA_N\nx_{N1} y_{N1}\nx_{N2} y_{N2}\n:\nx_{NA_N} y_{NA_N}\n\nOutput\n\nPrint the maximum possible number of honest persons among the N people.\n\nSample Input 1\n\n3\n1\n2 1\n1\n1 1\n1\n2 0\n\nSample Output 1\n\n2\n\nIf Person 1 and Person 2 are honest and Person 3 is unkind, we have two honest persons without inconsistencies, which is the maximum possible number of honest persons.\n\nSample Input 2\n\n3\n2\n2 1\n3 0\n2\n3 1\n1 0\n2\n1 1\n2 0\n\nSample Output 2\n\n0\n\nAssuming that one or more of them are honest immediately leads to a contradiction.\n\nSample Input 3\n\n2\n1\n2 0\n1\n1 0\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 824, "cpu_time_ms": 8, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s788823659", "group_id": "codeNet:p02837", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn := uint(r.nextInt())\n\ttype say struct{\n\t\txSan uint\n\t\tyDa int\n\t}\n\ttype person struct {\n\t\tnum int\n\t\tsay []say\n\t}\n\tpeople := make([]person, n)\n\tfor i:=uint(0);i>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn := uint(r.nextInt())\n\ttype say struct{\n\t\txSan uint\n\t\tyDa int\n\t}\n\ttype person struct {\n\t\tnum int\n\t\tsay []say\n\t}\n\tpeople := make([]person, n)\n\tfor i:=uint(0);i> i)&1\n\t\t}\n\t}\n\n\tans := uint(0)\n\n\tfor i, e := range bitc {\n\t\tans = (ans+(e*(uint(n)-e)%mod)*(1<> i)&1\n\t\t}\n\t}\n\n\tans := uint(0)\n\n\tfor i, e := range bitc {\n\t\tans = (ans+(e*(uint(n)-e)%mod)*(1<= a[i] {\n\t\t\t\tdp[i+1][j] = dp[i][j] || dp[i][j-a[i]]\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = dp[i][j]\n\t\t\t}\n\t\t}\n\t}\n\tif dp[6000][x] {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1575256370, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02843.html", "problem_id": "p02843", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02843/input.txt", "sample_output_relpath": "derived/input_output/data/p02843/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02843/Go/s986897706.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s986897706", "user_id": "u651597583"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tx := nextInt()\n\ta := make([]int, 6000)\n\n\tfor i := 0; i < 6; i++ {\n\t\tfor j := 0; j < 1000; j++ {\n\t\t\tindex := i*1000 + j\n\t\t\ta[index] = (100 + i) * (j + 1)\n\t\t}\n\t}\n\tsort.Ints(a)\n\n\tdp := make([][]bool, 6010)\n\tfor i := 0; i < 6010; i++ {\n\t\tdp[i] = make([]bool, 100010)\n\t}\n\tdp[0][0] = true\n\n\tfor i := 0; i < 6000; i++ {\n\t\tfor j := 0; j <= x; j++ {\n\t\t\tif j >= a[i] {\n\t\t\t\tdp[i+1][j] = dp[i][j] || dp[i][j-a[i]]\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = dp[i][j]\n\t\t\t}\n\t\t}\n\t}\n\tif dp[6000][x] {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "sample_input": "615\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02843", "source_text": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 772, "cpu_time_ms": 1823, "memory_kb": 647552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s578123769", "group_id": "codeNet:p02845", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%v\", &N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%v\", &A[i])\n\t}\n\n\tnumR := 0\n\tnumG := 0\n\tnumB := 0\n\n\t// 最初の一人はRとする\n\tnumR = 1\n\tvar pat uint64 = 3\n\tfor i := 1; i < N; i++ {\n\t\tcand := 0\n\t\tvar candp *int\n\t\tif A[i] == numR {\n\t\t\tcand++\n\t\t\tcandp = &numR\n\t\t}\n\t\tif A[i] == numG {\n\t\t\tcand++\n\t\t\tcandp = &numG\n\t\t}\n\t\tif A[i] == numB {\n\t\t\tcand++\n\t\t\tcandp = &numB\n\t\t}\n\t\tif cand == 0 {\n\t\t\tfmt.Printf(\"0\\n\")\n\t\t\treturn\n\t\t}\n\t\t//fmt.Printf(\"cand=%v\\n\", cand)\n\t\tpat *= uint64(cand)\n\t\t*candp++\n\t}\n\n\tfmt.Printf(\"%v\\n\", pat%1000000007)\n\n}\n", "language": "Go", "metadata": {"date": 1601417416, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02845.html", "problem_id": "p02845", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02845/input.txt", "sample_output_relpath": "derived/input_output/data/p02845/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02845/Go/s578123769.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s578123769", "user_id": "u004477916"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%v\", &N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%v\", &A[i])\n\t}\n\n\tnumR := 0\n\tnumG := 0\n\tnumB := 0\n\n\t// 最初の一人はRとする\n\tnumR = 1\n\tvar pat uint64 = 3\n\tfor i := 1; i < N; i++ {\n\t\tcand := 0\n\t\tvar candp *int\n\t\tif A[i] == numR {\n\t\t\tcand++\n\t\t\tcandp = &numR\n\t\t}\n\t\tif A[i] == numG {\n\t\t\tcand++\n\t\t\tcandp = &numG\n\t\t}\n\t\tif A[i] == numB {\n\t\t\tcand++\n\t\t\tcandp = &numB\n\t\t}\n\t\tif cand == 0 {\n\t\t\tfmt.Printf(\"0\\n\")\n\t\t\treturn\n\t\t}\n\t\t//fmt.Printf(\"cand=%v\\n\", cand)\n\t\tpat *= uint64(cand)\n\t\t*candp++\n\t}\n\n\tfmt.Printf(\"%v\\n\", pat%1000000007)\n\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nN people are standing in a queue, numbered 1, 2, 3, ..., N from front to back. Each person wears a hat, which is red, blue, or green.\n\nThe person numbered i says:\n\n\"In front of me, exactly A_i people are wearing hats with the same color as mine.\"\n\nAssuming that all these statements are correct, find the number of possible combinations of colors of the N people's hats.\n\nSince the count can be enormous, compute it modulo 1000000007.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\n0 \\leq A_i \\leq N-1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 A_3 ... A_N\n\nOutput\n\nPrint the number of possible combinations of colors of the N people's hats, modulo 1000000007.\n\nSample Input 1\n\n6\n0 1 2 3 4 5\n\nSample Output 1\n\n3\n\nWe have three possible combinations, as follows:\n\nRed, Red, Red, Red, Red, Red\n\nBlue, Blue, Blue, Blue, Blue, Blue\n\nGreen, Green, Green, Green, Green, Green\n\nSample Input 2\n\n3\n0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n54\n0 0 1 0 1 2 1 2 3 2 3 3 4 4 5 4 6 5 7 8 5 6 6 7 7 8 8 9 9 10 10 11 9 12 10 13 14 11 11 12 12 13 13 14 14 15 15 15 16 16 16 17 17 17\n\nSample Output 3\n\n115295190", "sample_input": "6\n0 1 2 3 4 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02845", "source_text": "Score: 500 points\n\nProblem Statement\n\nN people are standing in a queue, numbered 1, 2, 3, ..., N from front to back. Each person wears a hat, which is red, blue, or green.\n\nThe person numbered i says:\n\n\"In front of me, exactly A_i people are wearing hats with the same color as mine.\"\n\nAssuming that all these statements are correct, find the number of possible combinations of colors of the N people's hats.\n\nSince the count can be enormous, compute it modulo 1000000007.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\n0 \\leq A_i \\leq N-1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 A_3 ... A_N\n\nOutput\n\nPrint the number of possible combinations of colors of the N people's hats, modulo 1000000007.\n\nSample Input 1\n\n6\n0 1 2 3 4 5\n\nSample Output 1\n\n3\n\nWe have three possible combinations, as follows:\n\nRed, Red, Red, Red, Red, Red\n\nBlue, Blue, Blue, Blue, Blue, Blue\n\nGreen, Green, Green, Green, Green, Green\n\nSample Input 2\n\n3\n0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n54\n0 0 1 0 1 2 1 2 3 2 3 3 4 4 5 4 6 5 7 8 5 6 6 7 7 8 8 9 9 10 10 11 9 12 10 13 14 11 11 12 12 13 13 14 14 15 15 15 16 16 16 17 17 17\n\nSample Output 3\n\n115295190", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 617, "cpu_time_ms": 484, "memory_kb": 6328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s782751863", "group_id": "codeNet:p02848", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tvar S string\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%s\", &S)\n\n\tans := \"\"\n\tfor i := 0; i < len(S); i++ {\n\t\tdiff := S[i] + byte(N) - 'A'\n\t\tdiff %= 26\n\t\tans += string(diff + 'A')\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1590862008, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02848/input.txt", "sample_output_relpath": "derived/input_output/data/p02848/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02848/Go/s782751863.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s782751863", "user_id": "u162326103"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tvar S string\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%s\", &S)\n\n\tans := \"\"\n\tfor i := 0; i < len(S); i++ {\n\t\tdiff := S[i] + byte(N) - 'A'\n\t\tdiff %= 26\n\t\tans += string(diff + 'A')\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "sample_input": "2\nABCXYZ\n"}, "reference_outputs": ["CDEZAB\n"], "source_document_id": "p02848", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 247, "cpu_time_ms": 24, "memory_kb": 7680}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s068934120", "group_id": "codeNet:p02848", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tN := sc.nextInt()\n\tS := sc.next()\n\n\tSArr := strings.Split(S, \"\")\n\tansArr := make([]string, len(S))\n\talphaArr := [...]string{\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"}\n\tmmap := make(map[string]int)\n\tfor i, v := range alphaArr {\n\t\tmmap[v] = i\n\t}\n\t// alpha := \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\tfor i := 0; i < len(S); i++ {\n\t\tvar c string\n\t\tc = SArr[i]\n\t\tindex := (mmap[c] + N) % 26\n\n\t\tansArr[i] = alphaArr[index]\n\t}\n\tfmt.Println(strings.Join(ansArr, \"\"))\n}\n\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Pair a\ntype Pair struct {\n\tfirst int\n\tsecond int\n}\n\n// Queue a\ntype Queue struct {\n\tv []Pair\n}\n\n// Push for queue\nfunc (q *Queue) Push(v Pair) {\n\tq.v = append(q.v, v)\n}\n\n// Pop for queue\nfunc (q *Queue) Pop() Pair {\n\tr := q.v[0]\n\tq.v = q.v[1:]\n\treturn r\n}\n\n// Front for queue\nfunc (q Queue) Front() Pair {\n\treturn q.v[0]\n}\n\n// Empty return true if empty\nfunc (q Queue) Empty() bool {\n\treturn len(q.v) == 0\n}\n", "language": "Go", "metadata": {"date": 1583809735, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02848/input.txt", "sample_output_relpath": "derived/input_output/data/p02848/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02848/Go/s068934120.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s068934120", "user_id": "u799236543"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tN := sc.nextInt()\n\tS := sc.next()\n\n\tSArr := strings.Split(S, \"\")\n\tansArr := make([]string, len(S))\n\talphaArr := [...]string{\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"}\n\tmmap := make(map[string]int)\n\tfor i, v := range alphaArr {\n\t\tmmap[v] = i\n\t}\n\t// alpha := \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\tfor i := 0; i < len(S); i++ {\n\t\tvar c string\n\t\tc = SArr[i]\n\t\tindex := (mmap[c] + N) % 26\n\n\t\tansArr[i] = alphaArr[index]\n\t}\n\tfmt.Println(strings.Join(ansArr, \"\"))\n}\n\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Pair a\ntype Pair struct {\n\tfirst int\n\tsecond int\n}\n\n// Queue a\ntype Queue struct {\n\tv []Pair\n}\n\n// Push for queue\nfunc (q *Queue) Push(v Pair) {\n\tq.v = append(q.v, v)\n}\n\n// Pop for queue\nfunc (q *Queue) Pop() Pair {\n\tr := q.v[0]\n\tq.v = q.v[1:]\n\treturn r\n}\n\n// Front for queue\nfunc (q Queue) Front() Pair {\n\treturn q.v[0]\n}\n\n// Empty return true if empty\nfunc (q Queue) Empty() bool {\n\treturn len(q.v) == 0\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "sample_input": "2\nABCXYZ\n"}, "reference_outputs": ["CDEZAB\n"], "source_document_id": "p02848", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3146, "cpu_time_ms": 2, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s472101076", "group_id": "codeNet:p02848", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar N int\n\tvar S string\n\n\tans := \"\"\n\tal := \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%s\", &S)\n\tfor index := 0; index < len(S); index++ {\n\t\tt := S[index : index+1]\n\t\tat := strings.Index(al, t)\n\t\ttargetJ := (at + N) % 26\n\t\ttarget := al[targetJ : targetJ+1]\n\t\tans = ans + target\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1575856674, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02848/input.txt", "sample_output_relpath": "derived/input_output/data/p02848/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02848/Go/s472101076.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s472101076", "user_id": "u966836999"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar N int\n\tvar S string\n\n\tans := \"\"\n\tal := \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%s\", &S)\n\tfor index := 0; index < len(S); index++ {\n\t\tt := S[index : index+1]\n\t\tat := strings.Index(al, t)\n\t\ttargetJ := (at + N) % 26\n\t\ttarget := al[targetJ : targetJ+1]\n\t\tans = ans + target\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "sample_input": "2\nABCXYZ\n"}, "reference_outputs": ["CDEZAB\n"], "source_document_id": "p02848", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 378, "cpu_time_ms": 32, "memory_kb": 8704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s367158275", "group_id": "codeNet:p02848", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\tS := nextBytes()\n\n\talpha := []byte(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\tdict := map[byte]byte{}\n\n\tfor i := 0; i < len(alpha); i++ {\n\t\tdict[alpha[i]] = alpha[(i+N)%26]\n\t}\n\tfor i := 0; i < len(S); i++ {\n\t\tfmt.Printf(\"%c\", dict[S[i]])\n\t}\n\tfmt.Println()\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1574647733, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02848/input.txt", "sample_output_relpath": "derived/input_output/data/p02848/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02848/Go/s367158275.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s367158275", "user_id": "u578274732"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\tS := nextBytes()\n\n\talpha := []byte(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\tdict := map[byte]byte{}\n\n\tfor i := 0; i < len(alpha); i++ {\n\t\tdict[alpha[i]] = alpha[(i+N)%26]\n\t}\n\tfor i := 0; i < len(S); i++ {\n\t\tfmt.Printf(\"%c\", dict[S[i]])\n\t}\n\tfmt.Println()\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "sample_input": "2\nABCXYZ\n"}, "reference_outputs": ["CDEZAB\n"], "source_document_id": "p02848", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 850, "cpu_time_ms": 23, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s570122714", "group_id": "codeNet:p02850", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype edge struct {\n\tto int\n\tid int\n}\n\nvar g [100005][]edge\nvar ans [100005]int\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tvar a, b int\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tfmt.Fscan(r, &b)\n\t\ta--\n\t\tb--\n\t\tg[a] = append(g[a], edge{b, i})\n\t\tg[b] = append(g[b], edge{a, i})\n\t}\n\n\t// 塗分け\n\tdfs(0, -1, -1)\n\n\tcolorNum := 0\n\tfor i := 0; i < len(g); i++ {\n\t\tcolorNum = max(colorNum, len(g[i]))\n\t}\n\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tfmt.Fprintln(w, colorNum)\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fprintln(w, ans[i])\n\t}\n}\n\nfunc dfs(curID, parentID, prevEdgeColor int) {\n\tcolor := 1\n\tfor _, e := range g[curID] {\n\t\tif e.to == parentID {\n\t\t\tcontinue\n\t\t}\n\t\tif color == prevEdgeColor {\n\t\t\tcolor++\n\t\t}\n\t\tans[e.id] = color\n\t\tdfs(e.to, curID, color)\n\t\tcolor++\n\t}\n}\n\n// func main() {\n// \tr := bufio.NewReader(os.Stdin)\n// \tvar n int\n// \tfmt.Fscan(r, &n)\n\n// \tnodes := make([]map[int]bool, n)\n// \tfor i := 0; i < n; i++ {\n// \t\tnodes[i] = make(map[int]bool)\n// \t}\n\n// \tans := make([]int, n-1)\n// \tvar colors []bool\n// \tvar a, b int\n// \tfor i := 0; i < n-1; i++ {\n// \t\tfmt.Fscan(r, &a)\n// \t\tfmt.Fscan(r, &b)\n// \t\ta--\n// \t\tb--\n\n// \t\tcolor := -1\n// \t\tfor j := range colors {\n// \t\t\tflg := true\n// \t\t\tif _, ok := nodes[a][j+1]; ok {\n// \t\t\t\tflg = false\n// \t\t\t} else if _, ok := nodes[b][j+1]; ok {\n// \t\t\t\tflg = false\n// \t\t\t}\n// \t\t\tif flg {\n// \t\t\t\tcolor = j + 1\n// \t\t\t\tbreak\n// \t\t\t}\n// \t\t}\n\n// \t\tif color == -1 {\n// \t\t\tcolors = append(colors, true)\n// \t\t\tcolor = len(colors)\n// \t\t}\n// \t\tans[i] = color\n// \t\tnodes[a][color] = true\n// \t\tnodes[b][color] = true\n// \t}\n\n// \tw := bufio.NewWriter(os.Stdout)\n// \tdefer w.Flush()\n// \tfmt.Fprintln(w, len(colors))\n// \tfor _, v := range ans {\n// \t\tfmt.Fprintln(w, v)\n// \t}\n\n// }\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589330458, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02850.html", "problem_id": "p02850", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02850/input.txt", "sample_output_relpath": "derived/input_output/data/p02850/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02850/Go/s570122714.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s570122714", "user_id": "u433254839"}, "prompt_components": {"gold_output": "2\n1\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype edge struct {\n\tto int\n\tid int\n}\n\nvar g [100005][]edge\nvar ans [100005]int\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tvar a, b int\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tfmt.Fscan(r, &b)\n\t\ta--\n\t\tb--\n\t\tg[a] = append(g[a], edge{b, i})\n\t\tg[b] = append(g[b], edge{a, i})\n\t}\n\n\t// 塗分け\n\tdfs(0, -1, -1)\n\n\tcolorNum := 0\n\tfor i := 0; i < len(g); i++ {\n\t\tcolorNum = max(colorNum, len(g[i]))\n\t}\n\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tfmt.Fprintln(w, colorNum)\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fprintln(w, ans[i])\n\t}\n}\n\nfunc dfs(curID, parentID, prevEdgeColor int) {\n\tcolor := 1\n\tfor _, e := range g[curID] {\n\t\tif e.to == parentID {\n\t\t\tcontinue\n\t\t}\n\t\tif color == prevEdgeColor {\n\t\t\tcolor++\n\t\t}\n\t\tans[e.id] = color\n\t\tdfs(e.to, curID, color)\n\t\tcolor++\n\t}\n}\n\n// func main() {\n// \tr := bufio.NewReader(os.Stdin)\n// \tvar n int\n// \tfmt.Fscan(r, &n)\n\n// \tnodes := make([]map[int]bool, n)\n// \tfor i := 0; i < n; i++ {\n// \t\tnodes[i] = make(map[int]bool)\n// \t}\n\n// \tans := make([]int, n-1)\n// \tvar colors []bool\n// \tvar a, b int\n// \tfor i := 0; i < n-1; i++ {\n// \t\tfmt.Fscan(r, &a)\n// \t\tfmt.Fscan(r, &b)\n// \t\ta--\n// \t\tb--\n\n// \t\tcolor := -1\n// \t\tfor j := range colors {\n// \t\t\tflg := true\n// \t\t\tif _, ok := nodes[a][j+1]; ok {\n// \t\t\t\tflg = false\n// \t\t\t} else if _, ok := nodes[b][j+1]; ok {\n// \t\t\t\tflg = false\n// \t\t\t}\n// \t\t\tif flg {\n// \t\t\t\tcolor = j + 1\n// \t\t\t\tbreak\n// \t\t\t}\n// \t\t}\n\n// \t\tif color == -1 {\n// \t\t\tcolors = append(colors, true)\n// \t\t\tcolor = len(colors)\n// \t\t}\n// \t\tans[i] = color\n// \t\tnodes[a][color] = true\n// \t\tnodes[b][color] = true\n// \t}\n\n// \tw := bufio.NewWriter(os.Stdout)\n// \tdefer w.Flush()\n// \tfmt.Fprintln(w, len(colors))\n// \tfor _, v := range ans {\n// \t\tfmt.Fprintln(w, v)\n// \t}\n\n// }\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "sample_input": "3\n1 2\n2 3\n"}, "reference_outputs": ["2\n1\n2\n"], "source_document_id": "p02850", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5300, "cpu_time_ms": 276, "memory_kb": 23680}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s257387375", "group_id": "codeNet:p02850", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tmod int = 1e9 + 7\n)\n\nfunc main() {\n\tN := getInt()\n\n\tpoints := make([]map[int]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tpoints[i] = make(map[int]int)\n\t}\n\n\tmaxColor := 0\n\tvar results []int\n\n\tfor i := 0; i < N-1; i++ {\n\t\ta := getInt()\n\t\tb := getInt()\n\n\t\tcolor := 0\n\t\tfor ; ; {\n\t\t\tcolor++\n\t\t\tif points[a - 1][color] == 0 && points[b - 1][color] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tpoints[a - 1][color] = i + 1\n\t\tpoints[b - 1][color] = i + 1\n\n\t\tif maxColor < color {\n\t\t\tmaxColor = color\n\t\t}\n\t\tresults = append(results, color)\n\t}\n\n\tfmt.Println(maxColor)\n\n\tfor _, result := range results {\n\t\tfmt.Println(result)\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "language": "Go", "metadata": {"date": 1574652410, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02850.html", "problem_id": "p02850", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02850/input.txt", "sample_output_relpath": "derived/input_output/data/p02850/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02850/Go/s257387375.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s257387375", "user_id": "u964273035"}, "prompt_components": {"gold_output": "2\n1\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tmod int = 1e9 + 7\n)\n\nfunc main() {\n\tN := getInt()\n\n\tpoints := make([]map[int]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tpoints[i] = make(map[int]int)\n\t}\n\n\tmaxColor := 0\n\tvar results []int\n\n\tfor i := 0; i < N-1; i++ {\n\t\ta := getInt()\n\t\tb := getInt()\n\n\t\tcolor := 0\n\t\tfor ; ; {\n\t\t\tcolor++\n\t\t\tif points[a - 1][color] == 0 && points[b - 1][color] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tpoints[a - 1][color] = i + 1\n\t\tpoints[b - 1][color] = i + 1\n\n\t\tif maxColor < color {\n\t\t\tmaxColor = color\n\t\t}\n\t\tresults = append(results, color)\n\t}\n\n\tfmt.Println(maxColor)\n\n\tfor _, result := range results {\n\t\tfmt.Println(result)\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "sample_input": "3\n1 2\n2 3\n"}, "reference_outputs": ["2\n1\n2\n"], "source_document_id": "p02850", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a tree G with N vertices.\nThe vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i.\n\nConsider painting the edges in G with some number of colors.\nWe want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different.\n\nAmong the colorings satisfying the condition above, construct one that uses the minimum number of colors.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le a_i \\lt b_i \\le N\n\nAll values in input are integers.\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n\\vdots\na_{N-1} b_{N-1}\n\nOutput\n\nPrint N lines.\n\nThe first line should contain K, the number of colors used.\n\nThe (i+1)-th line (1 \\le i \\le N-1) should contain c_i, the integer representing the color of the i-th edge, where 1 \\le c_i \\le K must hold.\n\nIf there are multiple colorings with the minimum number of colors that satisfy the condition, printing any of them will be accepted.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n2\n1\n2\n\nSample Input 2\n\n8\n1 2\n2 3\n2 4\n2 5\n4 7\n5 6\n6 8\n\nSample Output 2\n\n4\n1\n2\n3\n4\n1\n1\n2\n\nSample Input 3\n\n6\n1 2\n1 3\n1 4\n1 5\n1 6\n\nSample Output 3\n\n5\n1\n2\n3\n4\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1975, "cpu_time_ms": 2108, "memory_kb": 27264}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s265274953", "group_id": "codeNet:p02852", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, M := ReadInt(), ReadInt()\n\tS := ReadString()\n\tvar h Heap\n\th.push(State{\n\t\tp: 0,\n\t\tc: 0,\n\t\tpath: []int{},\n\t})\n\tfor len(h) > 0 {\n\t\tstate := h.pop()\n\t\tif state.p == N {\n\t\t\tfor _, c := range state.path {\n\t\t\t\tfmt.Printf(\"%d \", c)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tif S[state.p] == '1' {\n\t\t\tcontinue\n\t\t}\n\t\tfor i := 1; i <= M; i++ {\n\t\t\th.push(State{\n\t\t\t\tp: state.p + i,\n\t\t\t\tc: state.c + 1,\n\t\t\t\tpath: append(append([]int{}, state.path...), i),\n\t\t\t})\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\ntype State struct {\n\tp int\n\tc int\n\tpath []int\n}\n\ntype HeapElement = State\ntype Heap []HeapElement\n\nfunc (h Heap) Less(i, j int) bool {\n\tif h[i].c == h[j].c {\n\t\tfor k := 0; k < len(h[i].path); k++ {\n\t\t\tik, jk := h[i].path[k], h[j].path[k]\n\t\t\tif ik == jk {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn ik < jk\n\t\t}\n\t}\n\treturn h[i].c < h[j].c\n}\nfunc (h Heap) Len() int { return len(h) }\nfunc (h Heap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *Heap) Push(x interface{}) { *h = append(*h, x.(HeapElement)) }\nfunc (h *Heap) Pop() (x interface{}) { *h, x = (*h)[:len(*h)-1], (*h)[len(*h)-1]; return }\nfunc (h *Heap) push(v HeapElement) { heap.Push(h, v) }\nfunc (h *Heap) pop() HeapElement { return heap.Pop(h).(HeapElement) }\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\n", "language": "Go", "metadata": {"date": 1595124235, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02852.html", "problem_id": "p02852", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02852/input.txt", "sample_output_relpath": "derived/input_output/data/p02852/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02852/Go/s265274953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s265274953", "user_id": "u328656362"}, "prompt_components": {"gold_output": "1 3 2 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, M := ReadInt(), ReadInt()\n\tS := ReadString()\n\tvar h Heap\n\th.push(State{\n\t\tp: 0,\n\t\tc: 0,\n\t\tpath: []int{},\n\t})\n\tfor len(h) > 0 {\n\t\tstate := h.pop()\n\t\tif state.p == N {\n\t\t\tfor _, c := range state.path {\n\t\t\t\tfmt.Printf(\"%d \", c)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tif S[state.p] == '1' {\n\t\t\tcontinue\n\t\t}\n\t\tfor i := 1; i <= M; i++ {\n\t\t\th.push(State{\n\t\t\t\tp: state.p + i,\n\t\t\t\tc: state.c + 1,\n\t\t\t\tpath: append(append([]int{}, state.path...), i),\n\t\t\t})\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\ntype State struct {\n\tp int\n\tc int\n\tpath []int\n}\n\ntype HeapElement = State\ntype Heap []HeapElement\n\nfunc (h Heap) Less(i, j int) bool {\n\tif h[i].c == h[j].c {\n\t\tfor k := 0; k < len(h[i].path); k++ {\n\t\t\tik, jk := h[i].path[k], h[j].path[k]\n\t\t\tif ik == jk {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn ik < jk\n\t\t}\n\t}\n\treturn h[i].c < h[j].c\n}\nfunc (h Heap) Len() int { return len(h) }\nfunc (h Heap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *Heap) Push(x interface{}) { *h = append(*h, x.(HeapElement)) }\nfunc (h *Heap) Pop() (x interface{}) { *h, x = (*h)[:len(*h)-1], (*h)[len(*h)-1]; return }\nfunc (h *Heap) push(v HeapElement) { heap.Push(h, v) }\nfunc (h *Heap) pop() HeapElement { return heap.Pop(h).(HeapElement) }\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nTakahashi is playing a board game called Sugoroku.\n\nOn the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.\n\nThe game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.\n\nAdditionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \\leq i \\leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.\n\nFind the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n|S| = N + 1\n\nS consists of 0 and 1.\n\nS[0] = 0\n\nS[N] = 0\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\n\nOutput\n\nIf Takahashi can win the game, print the lexicographically smallest sequence among the shortest sequences of numbers coming up in the roulette in which Takahashi can win the game, with spaces in between.\n\nIf Takahashi cannot win the game, print -1.\n\nSample Input 1\n\n9 3\n0001000100\n\nSample Output 1\n\n1 3 2 3\n\nIf the numbers 1, 3, 2, 3 come up in this order, Takahashi can reach Square 9 via Square 1, 4, and 6. He cannot reach Square 9 in three or fewer turns, and this is the lexicographically smallest sequence in which he reaches Square 9 in four turns.\n\nSample Input 2\n\n5 4\n011110\n\nSample Output 2\n\n-1\n\nTakahashi cannot reach Square 5.\n\nSample Input 3\n\n6 6\n0101010\n\nSample Output 3\n\n6", "sample_input": "9 3\n0001000100\n"}, "reference_outputs": ["1 3 2 3\n"], "source_document_id": "p02852", "source_text": "Score : 600 points\n\nProblem Statement\n\nTakahashi is playing a board game called Sugoroku.\n\nOn the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.\n\nThe game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.\n\nAdditionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \\leq i \\leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.\n\nFind the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n|S| = N + 1\n\nS consists of 0 and 1.\n\nS[0] = 0\n\nS[N] = 0\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\n\nOutput\n\nIf Takahashi can win the game, print the lexicographically smallest sequence among the shortest sequences of numbers coming up in the roulette in which Takahashi can win the game, with spaces in between.\n\nIf Takahashi cannot win the game, print -1.\n\nSample Input 1\n\n9 3\n0001000100\n\nSample Output 1\n\n1 3 2 3\n\nIf the numbers 1, 3, 2, 3 come up in this order, Takahashi can reach Square 9 via Square 1, 4, and 6. He cannot reach Square 9 in three or fewer turns, and this is the lexicographically smallest sequence in which he reaches Square 9 in four turns.\n\nSample Input 2\n\n5 4\n011110\n\nSample Output 2\n\n-1\n\nTakahashi cannot reach Square 5.\n\nSample Input 3\n\n6 6\n0101010\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1539, "cpu_time_ms": 2226, "memory_kb": 891668}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s405630534", "group_id": "codeNet:p02855", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tH, W, K := ReadInt(), ReadInt(), ReadInt()\n\tgrid := make([]string, W)\n\tfor i := 0; i < H; i++ {\n\t\tgrid[i] = ReadString()\n\t}\n\n\tans := make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tans[i] = make([]int, W)\n\t}\n\n\tcnt := 0\n\tfor h := 0; h < H; h++ {\n\t\tpos := make([]int, 0) // この行のイチゴ位置\n\t\tfor w := 0; w < W; w++ {\n\t\t\tif grid[h][w] == '#' {\n\t\t\t\tpos = append(pos, w)\n\t\t\t}\n\t\t}\n\t\tif len(pos) == 0 {\n\t\t\t// イチゴがなければ次の行へ\n\t\t\tcontinue\n\t\t}\n\t\t// イチゴがあれば、この行のケーキの左から右まで、番号が決まる。\n\t\tleft := 0\n\t\tfor i, right := range pos {\n\t\t\tfor w := left; w <= right; w++ {\n\t\t\t\tans[h][w] = cnt + i + 1\n\t\t\t}\n\t\t\tleft = right + 1\n\t\t}\n\t\tfor w := left; w < W; w++ {\n\t\t\tans[h][w] = cnt + len(pos)\n\t\t}\n\t\tcnt += len(pos)\n\n\t\t// 上で0になっている行にも、同じ番号をつける\n\t\tfor nh := h - 1; nh >= 0 && ans[nh][0] == 0; nh-- {\n\t\t\tans[nh] = ans[h]\n\t\t}\n\t\tif cnt == K && h < H-1 {\n\t\t\t// イチゴが全部見つかったので下の行にも同じ番号をつける\n\t\t\tfor nh := h + 1; nh < H; nh++ {\n\t\t\t\tans[nh] = ans[h]\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor h := 0; h < H; h++ {\n\t\tfor w := 0; w < W; w++ {\n\t\t\tPrintf(\"%d \", ans[h][w])\n\t\t}\n\t\tPrintln()\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\n\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc Printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\nfunc Println(a ...interface{}) { fmt.Fprintln(writer, a...) }\n", "language": "Go", "metadata": {"date": 1595493696, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02855.html", "problem_id": "p02855", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02855/input.txt", "sample_output_relpath": "derived/input_output/data/p02855/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02855/Go/s405630534.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s405630534", "user_id": "u328656362"}, "prompt_components": {"gold_output": "1 2 2\n1 3 4\n5 5 4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tH, W, K := ReadInt(), ReadInt(), ReadInt()\n\tgrid := make([]string, W)\n\tfor i := 0; i < H; i++ {\n\t\tgrid[i] = ReadString()\n\t}\n\n\tans := make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tans[i] = make([]int, W)\n\t}\n\n\tcnt := 0\n\tfor h := 0; h < H; h++ {\n\t\tpos := make([]int, 0) // この行のイチゴ位置\n\t\tfor w := 0; w < W; w++ {\n\t\t\tif grid[h][w] == '#' {\n\t\t\t\tpos = append(pos, w)\n\t\t\t}\n\t\t}\n\t\tif len(pos) == 0 {\n\t\t\t// イチゴがなければ次の行へ\n\t\t\tcontinue\n\t\t}\n\t\t// イチゴがあれば、この行のケーキの左から右まで、番号が決まる。\n\t\tleft := 0\n\t\tfor i, right := range pos {\n\t\t\tfor w := left; w <= right; w++ {\n\t\t\t\tans[h][w] = cnt + i + 1\n\t\t\t}\n\t\t\tleft = right + 1\n\t\t}\n\t\tfor w := left; w < W; w++ {\n\t\t\tans[h][w] = cnt + len(pos)\n\t\t}\n\t\tcnt += len(pos)\n\n\t\t// 上で0になっている行にも、同じ番号をつける\n\t\tfor nh := h - 1; nh >= 0 && ans[nh][0] == 0; nh-- {\n\t\t\tans[nh] = ans[h]\n\t\t}\n\t\tif cnt == K && h < H-1 {\n\t\t\t// イチゴが全部見つかったので下の行にも同じ番号をつける\n\t\t\tfor nh := h + 1; nh < H; nh++ {\n\t\t\t\tans[nh] = ans[h]\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor h := 0; h < H; h++ {\n\t\tfor w := 0; w < W; w++ {\n\t\t\tPrintf(\"%d \", ans[h][w])\n\t\t}\n\t\tPrintln()\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\n\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc Printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\nfunc Println(a ...interface{}) { fmt.Fprintln(writer, a...) }\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nChokudai made a rectangular cake for contestants in DDCC 2020 Finals.\n\nThe cake has H - 1 horizontal notches and W - 1 vertical notches, which divide the cake into H \\times W equal sections. K of these sections has a strawberry on top of each of them.\n\nThe positions of the strawberries are given to you as H \\times W characters s_{i, j} (1 \\leq i \\leq H, 1 \\leq j \\leq W). If s_{i, j} is #, the section at the i-th row from the top and the j-th column from the left contains a strawberry; if s_{i, j} is ., the section does not contain one. There are exactly K occurrences of #s.\n\nTakahashi wants to cut this cake into K pieces and serve them to the contestants. Each of these pieces must satisfy the following conditions:\n\nHas a rectangular shape.\n\nContains exactly one strawberry.\n\nOne possible way to cut the cake is shown below:\n\nFind one way to cut the cake and satisfy the condition. We can show that this is always possible, regardless of the number and positions of the strawberries.\n\nConstraints\n\n1 \\leq H \\leq 300\n\n1 \\leq W \\leq 300\n\n1 \\leq K \\leq H \\times W\n\ns_{i, j} is # or ..\n\nThere are exactly K occurrences of # in s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\ns_{1, 1} s_{1, 2} \\cdots s_{1, W}\ns_{2, 1} s_{2, 2} \\cdots s_{2, W}\n:\ns_{H, 1} s_{H, 2} \\cdots s_{H, W}\n\nOutput\n\nAssign the numbers 1, 2, 3, \\dots, K to the K pieces obtained after the cut, in any order. Then, let a_{i, j} be the number representing the piece containing the section at the i-th row from the top and the j-th column from the left of the cake. Output should be in the following format:\n\na_{1, 1} \\ a_{1, 2} \\ \\cdots \\ a_{1, W}\na_{2, 1} \\ a_{2, 2} \\ \\cdots \\ a_{2, W}\n:\na_{H, 1} \\ a_{H, 2} \\ \\cdots \\ a_{H, W}\n\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3 3 5\n#.#\n.#.\n#.#\n\nSample Output 1\n\n1 2 2\n1 3 4\n5 5 4\n\nOne way to cut this cake is shown below:\n\nSample Input 2\n\n3 7 7\n#...#.#\n..#...#\n.#..#..\n\nSample Output 2\n\n1 1 2 2 3 4 4\n6 6 2 2 3 5 5\n6 6 7 7 7 7 7\n\nOne way to cut this cake is shown below:\n\nSample Input 3\n\n13 21 106\n.....................\n.####.####.####.####.\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n.####.####.####.####.\n.....................\n.####.####.####.####.\n....#.#..#....#.#..#.\n.####.#..#.####.#..#.\n.#....#..#.#....#..#.\n.####.####.####.####.\n.....................\n\nSample Output 3\n\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 56 89 89 89 60 104 82 31 31 46 13 24 35 35 61 61 39 50 50\n12 12 67 67 100 100 60 9 9 42 42 57 13 24 6 72 72 72 72 72 72\n12 12 78 5 5 5 20 20 20 53 68 68 90 24 6 83 83 83 83 83 83\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n32 32 43 54 65 65 80 11 106 95 22 22 33 44 55 55 70 1 96 85 85\n32 32 43 54 76 76 91 11 106 84 84 4 99 66 66 66 81 1 96 74 74\n14 14 3 98 87 87 102 11 73 73 73 4 99 88 77 77 92 92 63 63 63\n25 25 3 98 87 87 7 29 62 62 62 15 99 88 77 77 103 19 30 52 52\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41", "sample_input": "3 3 5\n#.#\n.#.\n#.#\n"}, "reference_outputs": ["1 2 2\n1 3 4\n5 5 4\n"], "source_document_id": "p02855", "source_text": "Score: 400 points\n\nProblem Statement\n\nChokudai made a rectangular cake for contestants in DDCC 2020 Finals.\n\nThe cake has H - 1 horizontal notches and W - 1 vertical notches, which divide the cake into H \\times W equal sections. K of these sections has a strawberry on top of each of them.\n\nThe positions of the strawberries are given to you as H \\times W characters s_{i, j} (1 \\leq i \\leq H, 1 \\leq j \\leq W). If s_{i, j} is #, the section at the i-th row from the top and the j-th column from the left contains a strawberry; if s_{i, j} is ., the section does not contain one. There are exactly K occurrences of #s.\n\nTakahashi wants to cut this cake into K pieces and serve them to the contestants. Each of these pieces must satisfy the following conditions:\n\nHas a rectangular shape.\n\nContains exactly one strawberry.\n\nOne possible way to cut the cake is shown below:\n\nFind one way to cut the cake and satisfy the condition. We can show that this is always possible, regardless of the number and positions of the strawberries.\n\nConstraints\n\n1 \\leq H \\leq 300\n\n1 \\leq W \\leq 300\n\n1 \\leq K \\leq H \\times W\n\ns_{i, j} is # or ..\n\nThere are exactly K occurrences of # in s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\ns_{1, 1} s_{1, 2} \\cdots s_{1, W}\ns_{2, 1} s_{2, 2} \\cdots s_{2, W}\n:\ns_{H, 1} s_{H, 2} \\cdots s_{H, W}\n\nOutput\n\nAssign the numbers 1, 2, 3, \\dots, K to the K pieces obtained after the cut, in any order. Then, let a_{i, j} be the number representing the piece containing the section at the i-th row from the top and the j-th column from the left of the cake. Output should be in the following format:\n\na_{1, 1} \\ a_{1, 2} \\ \\cdots \\ a_{1, W}\na_{2, 1} \\ a_{2, 2} \\ \\cdots \\ a_{2, W}\n:\na_{H, 1} \\ a_{H, 2} \\ \\cdots \\ a_{H, W}\n\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3 3 5\n#.#\n.#.\n#.#\n\nSample Output 1\n\n1 2 2\n1 3 4\n5 5 4\n\nOne way to cut this cake is shown below:\n\nSample Input 2\n\n3 7 7\n#...#.#\n..#...#\n.#..#..\n\nSample Output 2\n\n1 1 2 2 3 4 4\n6 6 2 2 3 5 5\n6 6 7 7 7 7 7\n\nOne way to cut this cake is shown below:\n\nSample Input 3\n\n13 21 106\n.....................\n.####.####.####.####.\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n..#.#..#.#.#....#....\n.####.####.####.####.\n.....................\n.####.####.####.####.\n....#.#..#....#.#..#.\n.####.#..#.####.#..#.\n.#....#..#.#....#..#.\n.####.####.####.####.\n.....................\n\nSample Output 3\n\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 23 34 45 45 60 71 82 93 93 2 13 24 35 35 17 28 39 50 50\n12 12 56 89 89 89 60 104 82 31 31 46 13 24 35 35 61 61 39 50 50\n12 12 67 67 100 100 60 9 9 42 42 57 13 24 6 72 72 72 72 72 72\n12 12 78 5 5 5 20 20 20 53 68 68 90 24 6 83 83 83 83 83 83\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n16 16 27 38 49 49 64 75 86 97 79 79 90 101 6 94 94 105 10 21 21\n32 32 43 54 65 65 80 11 106 95 22 22 33 44 55 55 70 1 96 85 85\n32 32 43 54 76 76 91 11 106 84 84 4 99 66 66 66 81 1 96 74 74\n14 14 3 98 87 87 102 11 73 73 73 4 99 88 77 77 92 92 63 63 63\n25 25 3 98 87 87 7 29 62 62 62 15 99 88 77 77 103 19 30 52 52\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41\n36 36 47 58 69 69 18 29 40 51 51 26 37 48 59 59 8 19 30 41 41", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1742, "cpu_time_ms": 32, "memory_kb": 6020}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s831400532", "group_id": "codeNet:p02860", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tscanner.Scan()\n\n\tS := scanner.Text()\n\n\tif N%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t\tos.Exit(0)\n\t}\n\tif S[0:N/2-1] != S[N/2:N-1] {\n\t\tfmt.Println(\"No\")\n\t\tos.Exit(0)\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1599232469, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02860.html", "problem_id": "p02860", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02860/input.txt", "sample_output_relpath": "derived/input_output/data/p02860/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02860/Go/s831400532.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s831400532", "user_id": "u785064577"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tscanner.Scan()\n\n\tS := scanner.Text()\n\n\tif N%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t\tos.Exit(0)\n\t}\n\tif S[0:N/2-1] != S[N/2:N-1] {\n\t\tfmt.Println(\"No\")\n\t\tos.Exit(0)\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "sample_input": "6\nabcabc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02860", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 394, "cpu_time_ms": 5, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s898477829", "group_id": "codeNet:p02861", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\txs, ys := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\txs[i], ys[i] = iScan(), iScan()\n\t}\n\tz := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tz[i] = i\n\t}\n\tperm := Permute(z)\n\tans := 0.\n\tfor _, v := range perm {\n\t\tx, y := xs[v[0]], ys[v[0]]\n\t\tfor _, idx := range v[1:] {\n\t\t\tans += math.Pow(float64((xs[idx]-x)*(xs[idx]-x)+(ys[idx]-y)*(ys[idx]-y)), 0.5)\n\t\t\tx, y = xs[idx], ys[idx]\n\t\t}\n\t}\n\tfmt.Println(ans / float64(len(perm)))\n}\nfunc Permute(nums []int) [][]int {\n\tn := factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermute(nums, &ret)\n\treturn ret\n}\nfunc permute(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\tn := len(nums)\n\tp := make([]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tp[i] = i\n\t}\n\tfor i := 1; i < n; {\n\t\tp[i]--\n\t\tj := 0\n\t\tif i%2 == 1 {\n\t\t\tj = p[i]\n\t\t}\n\n\t\tnums[i], nums[j] = nums[j], nums[i]\n\t\t*ret = append(*ret, makeCopy(nums))\n\t\tfor i = 1; p[i] == 0; i++ {\n\t\t\tp[i] = i\n\t\t}\n\t}\n}\nfunc factorial(n int) int {\n\tret := 1\n\tfor i := 2; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\n", "language": "Go", "metadata": {"date": 1597183859, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02861.html", "problem_id": "p02861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02861/input.txt", "sample_output_relpath": "derived/input_output/data/p02861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02861/Go/s898477829.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s898477829", "user_id": "u843722521"}, "prompt_components": {"gold_output": "2.2761423749\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\txs, ys := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\txs[i], ys[i] = iScan(), iScan()\n\t}\n\tz := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tz[i] = i\n\t}\n\tperm := Permute(z)\n\tans := 0.\n\tfor _, v := range perm {\n\t\tx, y := xs[v[0]], ys[v[0]]\n\t\tfor _, idx := range v[1:] {\n\t\t\tans += math.Pow(float64((xs[idx]-x)*(xs[idx]-x)+(ys[idx]-y)*(ys[idx]-y)), 0.5)\n\t\t\tx, y = xs[idx], ys[idx]\n\t\t}\n\t}\n\tfmt.Println(ans / float64(len(perm)))\n}\nfunc Permute(nums []int) [][]int {\n\tn := factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermute(nums, &ret)\n\treturn ret\n}\nfunc permute(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\tn := len(nums)\n\tp := make([]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tp[i] = i\n\t}\n\tfor i := 1; i < n; {\n\t\tp[i]--\n\t\tj := 0\n\t\tif i%2 == 1 {\n\t\t\tj = p[i]\n\t\t}\n\n\t\tnums[i], nums[j] = nums[j], nums[i]\n\t\t*ret = append(*ret, makeCopy(nums))\n\t\tfor i = 1; p[i] == 0; i++ {\n\t\t\tp[i] = i\n\t\t}\n\t}\n}\nfunc factorial(n int) int {\n\tret := 1\n\tfor i := 2; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "sample_input": "3\n0 0\n1 0\n0 1\n"}, "reference_outputs": ["2.2761423749\n"], "source_document_id": "p02861", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2308, "cpu_time_ms": 17, "memory_kb": 5404}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s243660988", "group_id": "codeNet:p02861", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tfmt.Scanf(\"%d\\n\", &N)\n\n\tX := make([]int, N)\n\tY := make([]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tvar x, y int\n\t\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\t\tX[i] = x\n\t\tY[i] = y\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\txo := X[i]\n\t\tyo := Y[i]\n\t\tx := append(append([]int{}, X[:i]...), X[i+1:]...)\n\t\ty := append(append([]int{}, Y[:i]...), Y[i+1:]...)\n\t\tdfs(0.0, x, y, xo, yo)\n\t}\n\tcnt := 1\n\tfor i := 1; i <= N; i++ {\n\t\tcnt *= i\n\t}\n\tfmt.Println(sum / float64(cnt))\n}\n\nvar N int\nvar sum = 0.0\n\nfunc dfs(d float64, x, y []int, xo, yo int) {\n\tif len(x) == 0 {\n\t\tsum += d\n\t\treturn\n\t}\n\n\tfor i := range x {\n\t\txi := x[i]\n\t\tyi := y[i]\n\t\tx := append(append([]int{}, x[:i]...), x[i+1:]...)\n\t\ty := append(append([]int{}, y[:i]...), y[i+1:]...)\n\t\tdfs(d+math.Sqrt(float64((xo-xi)*(xo-xi)+(yo-yi)*(yo-yi))), x, y, xi, yi)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586499823, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02861.html", "problem_id": "p02861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02861/input.txt", "sample_output_relpath": "derived/input_output/data/p02861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02861/Go/s243660988.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s243660988", "user_id": "u534481484"}, "prompt_components": {"gold_output": "2.2761423749\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tfmt.Scanf(\"%d\\n\", &N)\n\n\tX := make([]int, N)\n\tY := make([]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tvar x, y int\n\t\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\t\tX[i] = x\n\t\tY[i] = y\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\txo := X[i]\n\t\tyo := Y[i]\n\t\tx := append(append([]int{}, X[:i]...), X[i+1:]...)\n\t\ty := append(append([]int{}, Y[:i]...), Y[i+1:]...)\n\t\tdfs(0.0, x, y, xo, yo)\n\t}\n\tcnt := 1\n\tfor i := 1; i <= N; i++ {\n\t\tcnt *= i\n\t}\n\tfmt.Println(sum / float64(cnt))\n}\n\nvar N int\nvar sum = 0.0\n\nfunc dfs(d float64, x, y []int, xo, yo int) {\n\tif len(x) == 0 {\n\t\tsum += d\n\t\treturn\n\t}\n\n\tfor i := range x {\n\t\txi := x[i]\n\t\tyi := y[i]\n\t\tx := append(append([]int{}, x[:i]...), x[i+1:]...)\n\t\ty := append(append([]int{}, y[:i]...), y[i+1:]...)\n\t\tdfs(d+math.Sqrt(float64((xo-xi)*(xo-xi)+(yo-yi)*(yo-yi))), x, y, xi, yi)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "sample_input": "3\n0 0\n1 0\n0 1\n"}, "reference_outputs": ["2.2761423749\n"], "source_document_id": "p02861", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 838, "cpu_time_ms": 18, "memory_kb": 2688}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s143160922", "group_id": "codeNet:p02862", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tx,y := scanInt(), scanInt()\n\n\tif (x+y)%3 != 0 || (xy&&y*2> 1\n\t\t\tif n == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tfac[0] = 1\n\tifac[0] = 1\n\tfor i := 0; i < n; i++ {\n\t\tfac[i+1] = fac[i]*(i+1)%mod\n\t\tifac[i+1] = ifac[i]*mpow(i+1,mod-2)%mod\n\t}\n}\n\nfunc comb(a,b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 1\n\t}\n\treturn (fac[a]*ifac[b]%mod)*ifac[a-b]%mod\n}\n", "language": "Go", "metadata": {"date": 1577847677, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02862.html", "problem_id": "p02862", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02862/input.txt", "sample_output_relpath": "derived/input_output/data/p02862/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02862/Go/s143160922.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s143160922", "user_id": "u548992197"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tx,y := scanInt(), scanInt()\n\n\tif (x+y)%3 != 0 || (xy&&y*2> 1\n\t\t\tif n == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tfac[0] = 1\n\tifac[0] = 1\n\tfor i := 0; i < n; i++ {\n\t\tfac[i+1] = fac[i]*(i+1)%mod\n\t\tifac[i+1] = ifac[i]*mpow(i+1,mod-2)%mod\n\t}\n}\n\nfunc comb(a,b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 1\n\t}\n\treturn (fac[a]*ifac[b]%mod)*ifac[a-b]%mod\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a knight - the chess piece - at the origin (0, 0) of a two-dimensional grid.\n\nWhen the knight is at the square (i, j), it can be moved to either (i+1,j+2) or (i+2, j+1).\n\nIn how many ways can the knight reach the square (X, Y)?\n\nFind the number of ways modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq X \\leq 10^6\n\n1 \\leq Y \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the number of ways for the knight to reach (X, Y) from (0, 0), modulo 10^9 + 7.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\n2\n\nThere are two ways: (0,0) \\to (1,2) \\to (3,3) and (0,0) \\to (2,1) \\to (3,3).\n\nSample Input 2\n\n2 2\n\nSample Output 2\n\n0\n\nThe knight cannot reach (2,2).\n\nSample Input 3\n\n999999 999999\n\nSample Output 3\n\n151840682\n\nPrint the number of ways modulo 10^9 + 7.", "sample_input": "3 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02862", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a knight - the chess piece - at the origin (0, 0) of a two-dimensional grid.\n\nWhen the knight is at the square (i, j), it can be moved to either (i+1,j+2) or (i+2, j+1).\n\nIn how many ways can the knight reach the square (X, Y)?\n\nFind the number of ways modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq X \\leq 10^6\n\n1 \\leq Y \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the number of ways for the knight to reach (X, Y) from (0, 0), modulo 10^9 + 7.\n\nSample Input 1\n\n3 3\n\nSample Output 1\n\n2\n\nThere are two ways: (0,0) \\to (1,2) \\to (3,3) and (0,0) \\to (2,1) \\to (3,3).\n\nSample Input 2\n\n2 2\n\nSample Output 2\n\n0\n\nThe knight cannot reach (2,2).\n\nSample Input 3\n\n999999 999999\n\nSample Output 3\n\n151840682\n\nPrint the number of ways modulo 10^9 + 7.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1396, "cpu_time_ms": 385, "memory_kb": 32896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s757440738", "group_id": "codeNet:p02862", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tx := getNextInt(scanner)\n\ty := getNextInt(scanner)\n\n\tif x > y {\n\t\tx, y = y, x\n\t}\n\tif x*2 < y || (x+y)%3 != 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tc := (x + y) / 3\n\tfacs := make([]int64, c+1)\n\tinvs := make([]int64, c+1)\n\n\tfacs[0] = 1\n\tinvs[0] = inv(facs[0])\n\tmod := int64(1e9 + 7)\n\tfor i := 1; i <= c; i++ {\n\t\tfacs[i] = (facs[i-1] * int64(i)) % mod\n\t\tinvs[i] = inv(facs[i])\n\t}\n\tk := x - c\n\n\tfmt.Fprintln(writer, cm(facs[c], invs[c-k], invs[k]))\n\twriter.Flush()\n}\n\nfunc cm(f, i, ii int64) int64 {\n\tmod := int64(1e9 + 7)\n\treturn (((f * i) % mod) * ii) % mod\n}\nfunc inv(n int64) int64 {\n\tvar ii [32]int64\n\tmod := int64(1e9 + 7)\n\tii[0] = n\n\tfor i := 1; i < 31; i++ {\n\t\tii[i] = (ii[i-1] * ii[i-1]) % mod\n\t}\n\tvar ans int64\n\tans = 1\n\tm := mod - 2\n\tfor i := 30; i >= 0; i-- {\n\t\tfor m >= 1< y {\n\t\tx, y = y, x\n\t}\n\tif x*2 < y || (x+y)%3 != 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tc := (x + y) / 3\n\tfacs := make([]int64, c+1)\n\tinvs := make([]int64, c+1)\n\n\tfacs[0] = 1\n\tinvs[0] = inv(facs[0])\n\tmod := int64(1e9 + 7)\n\tfor i := 1; i <= c; i++ {\n\t\tfacs[i] = (facs[i-1] * int64(i)) % mod\n\t\tinvs[i] = inv(facs[i])\n\t}\n\tk := x - c\n\n\tfmt.Fprintln(writer, cm(facs[c], invs[c-k], invs[k]))\n\twriter.Flush()\n}\n\nfunc cm(f, i, ii int64) int64 {\n\tmod := int64(1e9 + 7)\n\treturn (((f * i) % mod) * ii) % mod\n}\nfunc inv(n int64) int64 {\n\tvar ii [32]int64\n\tmod := int64(1e9 + 7)\n\tii[0] = n\n\tfor i := 1; i < 31; i++ {\n\t\tii[i] = (ii[i-1] * ii[i-1]) % mod\n\t}\n\tvar ans int64\n\tans = 1\n\tm := mod - 2\n\tfor i := 30; i >= 0; i-- {\n\t\tfor m >= 1< ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, t := nextInt(), nextInt()\n\ta, b := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i] = nextInt(), nextInt()\n\t}\n\n\t// dp[i+1][j]: 料理iを時刻jに食べ終わるときの満足度の最大値\n\tdp := make([][10001]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= 10000; j++ {\n\t\t\t// j-a[i]: 料理iを注文して食べ始める時間\n\t\t\tif 0 <= j-a[i] && j-a[i] < t {\n\t\t\t\tdp[i+1][j] = max(dp[i][j], dp[i][j-a[i]]+b[i])\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = max(dp[i][j], dp[i+1][j-1])\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := range dp[n] {\n\t\tans = max(ans, dp[n][i])\n\t}\n\tputs(ans)\n}\n", "language": "Go", "metadata": {"date": 1592596508, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02863.html", "problem_id": "p02863", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02863/input.txt", "sample_output_relpath": "derived/input_output/data/p02863/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02863/Go/s380320318.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s380320318", "user_id": "u502813058"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc max(nums ...int) int {\n\tret := nums[0]\n\tfor _, v := range nums {\n\t\tif v > ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, t := nextInt(), nextInt()\n\ta, b := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i] = nextInt(), nextInt()\n\t}\n\n\t// dp[i+1][j]: 料理iを時刻jに食べ終わるときの満足度の最大値\n\tdp := make([][10001]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= 10000; j++ {\n\t\t\t// j-a[i]: 料理iを注文して食べ始める時間\n\t\t\tif 0 <= j-a[i] && j-a[i] < t {\n\t\t\t\tdp[i+1][j] = max(dp[i][j], dp[i][j-a[i]]+b[i])\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = max(dp[i][j], dp[i+1][j-1])\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := range dp[n] {\n\t\tans = max(ans, dp[n][i])\n\t}\n\tputs(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi is at an all-you-can-eat restaurant.\n\nThe restaurant offers N kinds of dishes. It takes A_i minutes to eat the i-th dish, whose deliciousness is B_i.\n\nThe restaurant has the following rules:\n\nYou can only order one dish at a time. The dish ordered will be immediately served and ready to eat.\n\nYou cannot order the same kind of dish more than once.\n\nUntil you finish eating the dish already served, you cannot order a new dish.\n\nAfter T-0.5 minutes from the first order, you can no longer place a new order, but you can continue eating the dish already served.\n\nLet Takahashi's happiness be the sum of the deliciousness of the dishes he eats in this restaurant.\n\nWhat is the maximum possible happiness achieved by making optimal choices?\n\nConstraints\n\n2 \\leq N \\leq 3000\n\n1 \\leq T \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\n1 \\leq B_i \\leq 3000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the maximum possible happiness Takahashi can achieve.\n\nSample Input 1\n\n2 60\n10 10\n100 100\n\nSample Output 1\n\n110\n\nBy ordering the first and second dishes in this order, Takahashi's happiness will be 110.\n\nNote that, if we manage to order a dish in time, we can spend any amount of time to eat it.\n\nSample Input 2\n\n3 60\n10 10\n10 20\n10 30\n\nSample Output 2\n\n60\n\nTakahashi can eat all the dishes within 60 minutes.\n\nSample Input 3\n\n3 60\n30 10\n30 20\n30 30\n\nSample Output 3\n\n50\n\nBy ordering the second and third dishes in this order, Takahashi's happiness will be 50.\n\nWe cannot order three dishes, in whatever order we place them.\n\nSample Input 4\n\n10 100\n15 23\n20 18\n13 17\n24 12\n18 29\n19 27\n23 21\n18 20\n27 15\n22 25\n\nSample Output 4\n\n145", "sample_input": "2 60\n10 10\n100 100\n"}, "reference_outputs": ["110\n"], "source_document_id": "p02863", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi is at an all-you-can-eat restaurant.\n\nThe restaurant offers N kinds of dishes. It takes A_i minutes to eat the i-th dish, whose deliciousness is B_i.\n\nThe restaurant has the following rules:\n\nYou can only order one dish at a time. The dish ordered will be immediately served and ready to eat.\n\nYou cannot order the same kind of dish more than once.\n\nUntil you finish eating the dish already served, you cannot order a new dish.\n\nAfter T-0.5 minutes from the first order, you can no longer place a new order, but you can continue eating the dish already served.\n\nLet Takahashi's happiness be the sum of the deliciousness of the dishes he eats in this restaurant.\n\nWhat is the maximum possible happiness achieved by making optimal choices?\n\nConstraints\n\n2 \\leq N \\leq 3000\n\n1 \\leq T \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\n1 \\leq B_i \\leq 3000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the maximum possible happiness Takahashi can achieve.\n\nSample Input 1\n\n2 60\n10 10\n100 100\n\nSample Output 1\n\n110\n\nBy ordering the first and second dishes in this order, Takahashi's happiness will be 110.\n\nNote that, if we manage to order a dish in time, we can spend any amount of time to eat it.\n\nSample Input 2\n\n3 60\n10 10\n10 20\n10 30\n\nSample Output 2\n\n60\n\nTakahashi can eat all the dishes within 60 minutes.\n\nSample Input 3\n\n3 60\n30 10\n30 20\n30 30\n\nSample Output 3\n\n50\n\nBy ordering the second and third dishes in this order, Takahashi's happiness will be 50.\n\nWe cannot order three dishes, in whatever order we place them.\n\nSample Input 4\n\n10 100\n15 23\n20 18\n13 17\n24 12\n18 29\n19 27\n23 21\n18 20\n27 15\n22 25\n\nSample Output 4\n\n145", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1199, "cpu_time_ms": 297, "memory_kb": 243924}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s143399880", "group_id": "codeNet:p02863", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn,t := scanInt(), scanInt()\n\n\tdp := [3001][6001]int{}\n\n\tfor i := 1; i < n+1; i++ {\n\t\ta,b := scanInt(),scanInt()\n\t\tfor j := 0; j < t+3001; j++ {\n\t\t\tif j-a >= t {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j-a < 0 {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[i][j] = max(dp[i-1][j-a]+b, dp[i-1][j])\n\t\t}\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < 3001; i++ {\n\t\tans = max(ans, dp[n][t+i])\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc min(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res > a[i] { res = a[i] }\n\t}\n\treturn res\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1576567882, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02863.html", "problem_id": "p02863", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02863/input.txt", "sample_output_relpath": "derived/input_output/data/p02863/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02863/Go/s143399880.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s143399880", "user_id": "u548992197"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn,t := scanInt(), scanInt()\n\n\tdp := [3001][6001]int{}\n\n\tfor i := 1; i < n+1; i++ {\n\t\ta,b := scanInt(),scanInt()\n\t\tfor j := 0; j < t+3001; j++ {\n\t\t\tif j-a >= t {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j-a < 0 {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[i][j] = max(dp[i-1][j-a]+b, dp[i-1][j])\n\t\t}\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < 3001; i++ {\n\t\tans = max(ans, dp[n][t+i])\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc min(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res > a[i] { res = a[i] }\n\t}\n\treturn res\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi is at an all-you-can-eat restaurant.\n\nThe restaurant offers N kinds of dishes. It takes A_i minutes to eat the i-th dish, whose deliciousness is B_i.\n\nThe restaurant has the following rules:\n\nYou can only order one dish at a time. The dish ordered will be immediately served and ready to eat.\n\nYou cannot order the same kind of dish more than once.\n\nUntil you finish eating the dish already served, you cannot order a new dish.\n\nAfter T-0.5 minutes from the first order, you can no longer place a new order, but you can continue eating the dish already served.\n\nLet Takahashi's happiness be the sum of the deliciousness of the dishes he eats in this restaurant.\n\nWhat is the maximum possible happiness achieved by making optimal choices?\n\nConstraints\n\n2 \\leq N \\leq 3000\n\n1 \\leq T \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\n1 \\leq B_i \\leq 3000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the maximum possible happiness Takahashi can achieve.\n\nSample Input 1\n\n2 60\n10 10\n100 100\n\nSample Output 1\n\n110\n\nBy ordering the first and second dishes in this order, Takahashi's happiness will be 110.\n\nNote that, if we manage to order a dish in time, we can spend any amount of time to eat it.\n\nSample Input 2\n\n3 60\n10 10\n10 20\n10 30\n\nSample Output 2\n\n60\n\nTakahashi can eat all the dishes within 60 minutes.\n\nSample Input 3\n\n3 60\n30 10\n30 20\n30 30\n\nSample Output 3\n\n50\n\nBy ordering the second and third dishes in this order, Takahashi's happiness will be 50.\n\nWe cannot order three dishes, in whatever order we place them.\n\nSample Input 4\n\n10 100\n15 23\n20 18\n13 17\n24 12\n18 29\n19 27\n23 21\n18 20\n27 15\n22 25\n\nSample Output 4\n\n145", "sample_input": "2 60\n10 10\n100 100\n"}, "reference_outputs": ["110\n"], "source_document_id": "p02863", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi is at an all-you-can-eat restaurant.\n\nThe restaurant offers N kinds of dishes. It takes A_i minutes to eat the i-th dish, whose deliciousness is B_i.\n\nThe restaurant has the following rules:\n\nYou can only order one dish at a time. The dish ordered will be immediately served and ready to eat.\n\nYou cannot order the same kind of dish more than once.\n\nUntil you finish eating the dish already served, you cannot order a new dish.\n\nAfter T-0.5 minutes from the first order, you can no longer place a new order, but you can continue eating the dish already served.\n\nLet Takahashi's happiness be the sum of the deliciousness of the dishes he eats in this restaurant.\n\nWhat is the maximum possible happiness achieved by making optimal choices?\n\nConstraints\n\n2 \\leq N \\leq 3000\n\n1 \\leq T \\leq 3000\n\n1 \\leq A_i \\leq 3000\n\n1 \\leq B_i \\leq 3000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN T\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the maximum possible happiness Takahashi can achieve.\n\nSample Input 1\n\n2 60\n10 10\n100 100\n\nSample Output 1\n\n110\n\nBy ordering the first and second dishes in this order, Takahashi's happiness will be 110.\n\nNote that, if we manage to order a dish in time, we can spend any amount of time to eat it.\n\nSample Input 2\n\n3 60\n10 10\n10 20\n10 30\n\nSample Output 2\n\n60\n\nTakahashi can eat all the dishes within 60 minutes.\n\nSample Input 3\n\n3 60\n30 10\n30 20\n30 30\n\nSample Output 3\n\n50\n\nBy ordering the second and third dishes in this order, Takahashi's happiness will be 50.\n\nWe cannot order three dishes, in whatever order we place them.\n\nSample Input 4\n\n10 100\n15 23\n20 18\n13 17\n24 12\n18 29\n19 27\n23 21\n18 20\n27 15\n22 25\n\nSample Output 4\n\n145", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1231, "cpu_time_ms": 149, "memory_kb": 146048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s968792047", "group_id": "codeNet:p02864", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn, k := r.nextInt(), r.nextInt()\n\tr.Scan(true)\n\th := r.nextStringArray().toInts()\n\n\tmaxInt := func(a int, vs ...int) int {\n\t\tfor i := range vs {\n\t\t\tv := &vs[i]\n\t\t\tif a < *v {\n\t\t\t\ta = *v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tminInt := func(a int, vs ...int) int {\n\t\tfor i := range vs {\n\t\t\tv := &vs[i]\n\t\t\tif a > *v {\n\t\t\t\ta = *v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tvar f func(c, aH, i int) int\n\tf = func(c, aH, i int) int {\n\t\tif i >= n {\n\t\t\treturn 0\n\t\t}\n\n\t\tans := maxInt(0, h[i]-aH) + f(c, h[i], i+1)\n\t\tif c > 0 {\n\t\t\tans = minInt(ans, f(c-1, aH, i+1))\n\t\t}\n\n\t\treturn ans\n\t}\n\n\tfmt.Fprintln(stdout, f(k, 0, 0))\n}\n", "language": "Go", "metadata": {"date": 1574015171, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02864.html", "problem_id": "p02864", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02864/input.txt", "sample_output_relpath": "derived/input_output/data/p02864/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02864/Go/s968792047.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s968792047", "user_id": "u463655976"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn, k := r.nextInt(), r.nextInt()\n\tr.Scan(true)\n\th := r.nextStringArray().toInts()\n\n\tmaxInt := func(a int, vs ...int) int {\n\t\tfor i := range vs {\n\t\t\tv := &vs[i]\n\t\t\tif a < *v {\n\t\t\t\ta = *v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tminInt := func(a int, vs ...int) int {\n\t\tfor i := range vs {\n\t\t\tv := &vs[i]\n\t\t\tif a > *v {\n\t\t\t\ta = *v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tvar f func(c, aH, i int) int\n\tf = func(c, aH, i int) int {\n\t\tif i >= n {\n\t\t\treturn 0\n\t\t}\n\n\t\tans := maxInt(0, h[i]-aH) + f(c, h[i], i+1)\n\t\tif c > 0 {\n\t\t\tans = minInt(ans, f(c-1, aH, i+1))\n\t\t}\n\n\t\treturn ans\n\t}\n\n\tfmt.Fprintln(stdout, f(k, 0, 0))\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe will create an artwork by painting black some squares in a white square grid with 10^9 rows and N columns.\n\nThe current plan is as follows: for the i-th column from the left, we will paint the H_i bottommost squares and will not paint the other squares in that column.\n\nBefore starting to work, you can choose at most K columns (possibly zero) and change the values of H_i for these columns to any integers of your choice between 0 and 10^9 (inclusive).\n\nDifferent values can be chosen for different columns.\n\nThen, you will create the modified artwork by repeating the following operation:\n\nChoose one or more consecutive squares in one row and paint them black. (Squares already painted black can be painted again, but squares not to be painted according to the modified plan should not be painted.)\n\nFind the minimum number of times you need to perform this operation.\n\nConstraints\n\n1 \\leq N \\leq 300\n\n0 \\leq K \\leq N\n\n0 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 1\n2 3 4 1\n\nSample Output 1\n\n3\n\nFor example, by changing the value of H_3 to 2, you can create the modified artwork by the following three operations:\n\nPaint black the 1-st through 4-th squares from the left in the 1-st row from the bottom.\n\nPaint black the 1-st through 3-rd squares from the left in the 2-nd row from the bottom.\n\nPaint black the 2-nd square from the left in the 3-rd row from the bottom.\n\nSample Input 2\n\n6 2\n8 6 9 1 2 1\n\nSample Output 2\n\n7\n\nSample Input 3\n\n10 0\n1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000\n\nSample Output 3\n\n4999999996", "sample_input": "4 1\n2 3 4 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02864", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe will create an artwork by painting black some squares in a white square grid with 10^9 rows and N columns.\n\nThe current plan is as follows: for the i-th column from the left, we will paint the H_i bottommost squares and will not paint the other squares in that column.\n\nBefore starting to work, you can choose at most K columns (possibly zero) and change the values of H_i for these columns to any integers of your choice between 0 and 10^9 (inclusive).\n\nDifferent values can be chosen for different columns.\n\nThen, you will create the modified artwork by repeating the following operation:\n\nChoose one or more consecutive squares in one row and paint them black. (Squares already painted black can be painted again, but squares not to be painted according to the modified plan should not be painted.)\n\nFind the minimum number of times you need to perform this operation.\n\nConstraints\n\n1 \\leq N \\leq 300\n\n0 \\leq K \\leq N\n\n0 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 1\n2 3 4 1\n\nSample Output 1\n\n3\n\nFor example, by changing the value of H_3 to 2, you can create the modified artwork by the following three operations:\n\nPaint black the 1-st through 4-th squares from the left in the 1-st row from the bottom.\n\nPaint black the 1-st through 3-rd squares from the left in the 2-nd row from the bottom.\n\nPaint black the 2-nd square from the left in the 3-rd row from the bottom.\n\nSample Input 2\n\n6 2\n8 6 9 1 2 1\n\nSample Output 2\n\n7\n\nSample Input 3\n\n10 0\n1 1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000\n\nSample Output 3\n\n4999999996", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3240, "cpu_time_ms": 2108, "memory_kb": 8996}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s957867357", "group_id": "codeNet:p02865", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn := r.nextInt()\n\n\tfmt.Fprintln(stdout, n/2-b2i(n%2 == 0))\n}\n", "language": "Go", "metadata": {"date": 1573358439, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02865.html", "problem_id": "p02865", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02865/input.txt", "sample_output_relpath": "derived/input_output/data/p02865/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02865/Go/s957867357.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s957867357", "user_id": "u463655976"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn := r.nextInt()\n\n\tfmt.Fprintln(stdout, n/2-b2i(n%2 == 0))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "sample_input": "4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02865", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2718, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s930064460", "group_id": "codeNet:p02873", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := ReadString()\n\ta := make([]int, len(S)+1)\n\tsum := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tl := 0\n\t\tfor j := i - 1; j >= 0 && S[j] == '<'; j-- {\n\t\t\tl++\n\t\t}\n\t\tr := 0\n\t\tfor j := i + 1; j < len(a) && S[j-1] == '>'; j++ {\n\t\t\tr++\n\t\t}\n\t\tv := l\n\t\tif l < r {\n\t\t\tv = r\n\t\t}\n\t\tsum += v\n\t}\n\tfmt.Println(sum)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1599097053, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02873.html", "problem_id": "p02873", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02873/input.txt", "sample_output_relpath": "derived/input_output/data/p02873/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02873/Go/s930064460.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s930064460", "user_id": "u328656362"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := ReadString()\n\ta := make([]int, len(S)+1)\n\tsum := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tl := 0\n\t\tfor j := i - 1; j >= 0 && S[j] == '<'; j-- {\n\t\t\tl++\n\t\t}\n\t\tr := 0\n\t\tfor j := i + 1; j < len(a) && S[j-1] == '>'; j++ {\n\t\t\tr++\n\t\t}\n\t\tv := l\n\t\tif l < r {\n\t\t\tv = r\n\t\t}\n\t\tsum += v\n\t}\n\tfmt.Println(sum)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S of length N-1.\nEach character in S is < or >.\n\nA sequence of N non-negative integers, a_1,a_2,\\cdots,a_N, is said to be good when the following condition is satisfied for all i (1 \\leq i \\leq N-1):\n\nIf S_i= <: a_i: a_i>a_{i+1}\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^5\n\nS is a string of length N-1 consisting of < and >.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nSample Input 1\n\n<>>\n\nSample Output 1\n\n3\n\na=(0,2,1,0) is a good sequence whose sum is 3.\nThere is no good sequence whose sum is less than 3.\n\nSample Input 2\n\n<>>><<><<<<<>>><\n\nSample Output 2\n\n28", "sample_input": "<>>\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02873", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S of length N-1.\nEach character in S is < or >.\n\nA sequence of N non-negative integers, a_1,a_2,\\cdots,a_N, is said to be good when the following condition is satisfied for all i (1 \\leq i \\leq N-1):\n\nIf S_i= <: a_i: a_i>a_{i+1}\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^5\n\nS is a string of length N-1 consisting of < and >.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nFind the minimum possible sum of the elements of a good sequence of N non-negative integers.\n\nSample Input 1\n\n<>>\n\nSample Output 1\n\n3\n\na=(0,2,1,0) is a good sequence whose sum is 3.\nThere is no good sequence whose sum is less than 3.\n\nSample Input 2\n\n<>>><<><<<<<>>><\n\nSample Output 2\n\n28", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 705, "cpu_time_ms": 2205, "memory_kb": 5516}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s115523094", "group_id": "codeNet:p02880", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tfor i := 1; i <= 9; i++ {\n\t\tif N%i == 0 {\n\t\t\tif 1 <= N/i && N/i <= 9 {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1572225093, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02880.html", "problem_id": "p02880", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02880/input.txt", "sample_output_relpath": "derived/input_output/data/p02880/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02880/Go/s115523094.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s115523094", "user_id": "u764320774"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tfor i := 1; i <= 9; i++ {\n\t\tif N%i == 0 {\n\t\t\tif 1 <= N/i && N/i <= 9 {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "sample_input": "10\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02880", "source_text": "Score : 200 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 206, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276147307", "group_id": "codeNet:p02881", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n)\n\nfunc main() {\n\n\t\n\tvar N int\n\n\tfmt.Scan(&N)\n\n\ttemp:=0\n\n\tmin :=N+1\n\n\tCnt := int((math.Sqrt(float64(N))))+1\n\n\tfor i:=1;i<=Cnt;i++{\n\n\t\tif N%i ==0{\n\n\t\t\ttemp = i + (N/i)\n\n\t\t\tif temp < min {\n\n\t\t\t min= temp\n\t\t\t}\n\t\t}\n\n\t}\n\n\tresult := min -2\n\n\tfmt.Println(result)\n\n}\n", "language": "Go", "metadata": {"date": 1586922259, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02881.html", "problem_id": "p02881", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02881/input.txt", "sample_output_relpath": "derived/input_output/data/p02881/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02881/Go/s276147307.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s276147307", "user_id": "u935254309"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n)\n\nfunc main() {\n\n\t\n\tvar N int\n\n\tfmt.Scan(&N)\n\n\ttemp:=0\n\n\tmin :=N+1\n\n\tCnt := int((math.Sqrt(float64(N))))+1\n\n\tfor i:=1;i<=Cnt;i++{\n\n\t\tif N%i ==0{\n\n\t\t\ttemp = i + (N/i)\n\n\t\t\tif temp < min {\n\n\t\t\t min= temp\n\t\t\t}\n\t\t}\n\n\t}\n\n\tresult := min -2\n\n\tfmt.Println(result)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "sample_input": "10\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02881", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 303, "cpu_time_ms": 12, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s014689453", "group_id": "codeNet:p02881", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\tvar divisor int\n\troot := int(math.Floor(math.Sqrt(float64(N))))\n\t//fmt.Println(root)\n\tfor i := 1; i <= root; i++ {\n\t\tif N%i == 0 {\n\t\t\tdivisor = i\n\t\t}\n\t}\n\tquotient := N / divisor\n\t// fmt.Println(quotient, divisor)\n\tfmt.Println(quotient + divisor - 2)\n}\n", "language": "Go", "metadata": {"date": 1573513134, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02881.html", "problem_id": "p02881", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02881/input.txt", "sample_output_relpath": "derived/input_output/data/p02881/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02881/Go/s014689453.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s014689453", "user_id": "u924691798"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\tvar divisor int\n\troot := int(math.Floor(math.Sqrt(float64(N))))\n\t//fmt.Println(root)\n\tfor i := 1; i <= root; i++ {\n\t\tif N%i == 0 {\n\t\t\tdivisor = i\n\t\t}\n\t}\n\tquotient := N / divisor\n\t// fmt.Println(quotient, divisor)\n\tfmt.Println(quotient + divisor - 2)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "sample_input": "10\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02881", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 967, "cpu_time_ms": 11, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s381467124", "group_id": "codeNet:p02881", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tmin := 1<<63-1\n\n\tfor i := 1; i <= int(math.Sqrt(float64(n))); i++ {\n\t\tif n % i == 0 {\n\t\t\tif min > i + n/i -2 {\n\t\t\t\tmin = i + n/i -2\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(min)\n}", "language": "Go", "metadata": {"date": 1572300270, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02881.html", "problem_id": "p02881", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02881/input.txt", "sample_output_relpath": "derived/input_output/data/p02881/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02881/Go/s381467124.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s381467124", "user_id": "u703739962"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tmin := 1<<63-1\n\n\tfor i := 1; i <= int(math.Sqrt(float64(n))); i++ {\n\t\tif n % i == 0 {\n\t\t\tif min > i + n/i -2 {\n\t\t\t\tmin = i + n/i -2\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(min)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "sample_input": "10\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02881", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\n\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\n\nIn one move, he can move from (i,j) to either (i+1,j) or (i,j+1).\n\nGiven an integer N, find the minimum number of moves needed to reach a square that contains N.\n\nConstraints\n\n2 \\leq N \\leq 10^{12}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum number of moves needed to reach a square that contains the integer N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n5\n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10 in less than five moves.\n\nSample Input 2\n\n50\n\nSample Output 2\n\n13\n\n(5, 10) can be reached in 13 moves.\n\nSample Input 3\n\n10000000019\n\nSample Output 3\n\n10000000018\n\nBoth input and output may be enormous.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 487, "cpu_time_ms": 13, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s330649905", "group_id": "codeNet:p02882", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, x float64\n\tfmt.Scan(&a, &b, &x)\n\n\tvar r float64\n\tif a*a*b <= x {\n\t\tfmt.Println(0.000001)\n\t\treturn\n\t}\n\n\tif a > b {\n\t\tr = math.Pow(a, 3) / (2*(math.Pow(a, 2)*b) - 2*x)\n\t} else {\n\t\tr = 2 * x / (a * math.Pow(b, 2))\n\t}\n\td := 90.0 - (math.Atan(r) * 180.0 / math.Pi)\n\n\tfmt.Println(d)\n}\n", "language": "Go", "metadata": {"date": 1572229497, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02882.html", "problem_id": "p02882", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02882/input.txt", "sample_output_relpath": "derived/input_output/data/p02882/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02882/Go/s330649905.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s330649905", "user_id": "u367908963"}, "prompt_components": {"gold_output": "45.0000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, x float64\n\tfmt.Scan(&a, &b, &x)\n\n\tvar r float64\n\tif a*a*b <= x {\n\t\tfmt.Println(0.000001)\n\t\treturn\n\t}\n\n\tif a > b {\n\t\tr = math.Pow(a, 3) / (2*(math.Pow(a, 2)*b) - 2*x)\n\t} else {\n\t\tr = 2 * x / (a * math.Pow(b, 2))\n\t}\n\td := 90.0 - (math.Atan(r) * 180.0 / math.Pi)\n\n\tfmt.Println(d)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\\mathrm{cm} and whose height is b~\\mathrm{cm}. (The thickness of the bottle can be ignored.)\n\nWe will pour x~\\mathrm{cm}^3 of water into the bottle, and gradually tilt the bottle around one of the sides of the base.\n\nWhen will the water be spilled? More formally, find the maximum angle in which we can tilt the bottle without spilling any water.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq a \\leq 100\n\n1 \\leq b \\leq 100\n\n1 \\leq x \\leq a^2b\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the maximum angle in which we can tilt the bottle without spilling any water, in degrees.\nYour output will be judged as correct when the absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n2 2 4\n\nSample Output 1\n\n45.0000000000\n\nThis bottle has a cubic shape, and it is half-full. The water gets spilled when we tilt the bottle more than 45 degrees.\n\nSample Input 2\n\n12 21 10\n\nSample Output 2\n\n89.7834636934\n\nThis bottle is almost empty. When the water gets spilled, the bottle is nearly horizontal.\n\nSample Input 3\n\n3 1 8\n\nSample Output 3\n\n4.2363947991\n\nThis bottle is almost full. When the water gets spilled, the bottle is still nearly vertical.", "sample_input": "2 2 4\n"}, "reference_outputs": ["45.0000000000\n"], "source_document_id": "p02882", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\\mathrm{cm} and whose height is b~\\mathrm{cm}. (The thickness of the bottle can be ignored.)\n\nWe will pour x~\\mathrm{cm}^3 of water into the bottle, and gradually tilt the bottle around one of the sides of the base.\n\nWhen will the water be spilled? More formally, find the maximum angle in which we can tilt the bottle without spilling any water.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq a \\leq 100\n\n1 \\leq b \\leq 100\n\n1 \\leq x \\leq a^2b\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the maximum angle in which we can tilt the bottle without spilling any water, in degrees.\nYour output will be judged as correct when the absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n2 2 4\n\nSample Output 1\n\n45.0000000000\n\nThis bottle has a cubic shape, and it is half-full. The water gets spilled when we tilt the bottle more than 45 degrees.\n\nSample Input 2\n\n12 21 10\n\nSample Output 2\n\n89.7834636934\n\nThis bottle is almost empty. When the water gets spilled, the bottle is nearly horizontal.\n\nSample Input 3\n\n3 1 8\n\nSample Output 3\n\n4.2363947991\n\nThis bottle is almost full. When the water gets spilled, the bottle is still nearly vertical.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 345, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s703812641", "group_id": "codeNet:p02883", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scan(&N, &K)\n\tA := make([]int, N)\n\tF := make([]int, N)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsumA := 0\n\tfor i := range A {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t\tsumA += A[i]\n\t}\n\tfor i := range F {\n\t\tsc.Scan()\n\t\tF[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Ints(A)\n\tsort.Sort(sort.Reverse(sort.IntSlice(F)))\n\t// fmt.Println(\"N\", N, \"K\", K, \"A\", A, \"F\", F)\n\tif K >= sumA { // 全員の消化コストを0にすることが可能\n\t\tfmt.Println(0)\n\t} else {\n\t\t// Aを昇順に、Fを降順にソートして、i番目のメンバーにi番目の食べ物を担当させるのが最適\n\t\t// 全てのメンバーについて完食にかかる時間をx以下にできるか?という問題を考える\n\t\t// 一人当たりで完食にかかる時間の最低値は0、最大値は10^6 x 10^6 = 10^12\n\t\tleft, right := -1, int(1e12)\n\t\tcnt := 1\n\t\tfor right-left > 1 {\n\t\t\ttarget := (right + left) / 2\n\t\t\tif isOK(A, F, target, K) {\n\t\t\t\tright = target\n\t\t\t} else {\n\t\t\t\tleft = target\n\t\t\t}\n\t\t\tcnt++\n\t\t}\n\t\tfmt.Println(right)\n\t}\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc isOK(a, f []int, target, training int) bool {\n\tvar sum int\n\tfor i := 0; i < len(a); i++ {\n\t\tsum += max(0, a[i]-target/f[i]) // 目標完食時間をXとしたときの、各人に必要なトレーニング回数\n\t}\n\tif sum <= training { // sum <= trainingであれば、間食目標 targetを達成できる\n\t\treturn true\n\t}\n\treturn false\n}\n", "language": "Go", "metadata": {"date": 1572284396, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02883.html", "problem_id": "p02883", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02883/input.txt", "sample_output_relpath": "derived/input_output/data/p02883/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02883/Go/s703812641.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s703812641", "user_id": "u196030116"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scan(&N, &K)\n\tA := make([]int, N)\n\tF := make([]int, N)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsumA := 0\n\tfor i := range A {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t\tsumA += A[i]\n\t}\n\tfor i := range F {\n\t\tsc.Scan()\n\t\tF[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Ints(A)\n\tsort.Sort(sort.Reverse(sort.IntSlice(F)))\n\t// fmt.Println(\"N\", N, \"K\", K, \"A\", A, \"F\", F)\n\tif K >= sumA { // 全員の消化コストを0にすることが可能\n\t\tfmt.Println(0)\n\t} else {\n\t\t// Aを昇順に、Fを降順にソートして、i番目のメンバーにi番目の食べ物を担当させるのが最適\n\t\t// 全てのメンバーについて完食にかかる時間をx以下にできるか?という問題を考える\n\t\t// 一人当たりで完食にかかる時間の最低値は0、最大値は10^6 x 10^6 = 10^12\n\t\tleft, right := -1, int(1e12)\n\t\tcnt := 1\n\t\tfor right-left > 1 {\n\t\t\ttarget := (right + left) / 2\n\t\t\tif isOK(A, F, target, K) {\n\t\t\t\tright = target\n\t\t\t} else {\n\t\t\t\tleft = target\n\t\t\t}\n\t\t\tcnt++\n\t\t}\n\t\tfmt.Println(right)\n\t}\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc isOK(a, f []int, target, training int) bool {\n\tvar sum int\n\tfor i := 0; i < len(a); i++ {\n\t\tsum += max(0, a[i]-target/f[i]) // 目標完食時間をXとしたときの、各人に必要なトレーニング回数\n\t}\n\tif sum <= training { // sum <= trainingであれば、間食目標 targetを達成できる\n\t\treturn true\n\t}\n\treturn false\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nTakahashi will take part in an eating contest. Teams of N members will compete in this contest, and Takahashi's team consists of N players numbered 1 through N from youngest to oldest. The consumption coefficient of Member i is A_i.\n\nIn the contest, N foods numbered 1 through N will be presented, and the difficulty of Food i is F_i. The details of the contest are as follows:\n\nA team should assign one member to each food, and should not assign the same member to multiple foods.\n\nIt will take x \\times y seconds for a member to finish the food, where x is the consumption coefficient of the member and y is the difficulty of the dish.\n\nThe score of a team is the longest time it takes for an individual member to finish the food.\n\nBefore the contest, Takahashi's team decided to do some training. In one set of training, a member can reduce his/her consumption coefficient by 1, as long as it does not go below 0. However, for financial reasons, the N members can do at most K sets of training in total.\n\nWhat is the minimum possible score of the team, achieved by choosing the amounts of members' training and allocating the dishes optimally?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 10^{18}\n\n1 \\leq A_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\n1 \\leq F_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\nF_1 F_2 ... F_N\n\nOutput\n\nPrint the minimum possible score of the team.\n\nSample Input 1\n\n3 5\n4 2 1\n2 3 1\n\nSample Output 1\n\n2\n\nThey can achieve the score of 2, as follows:\n\nMember 1 does 4 sets of training and eats Food 2 in (4-4) \\times 3 = 0 seconds.\n\nMember 2 does 1 set of training and eats Food 3 in (2-1) \\times 1 = 1 second.\n\nMember 3 does 0 sets of training and eats Food 1 in (1-0) \\times 2 = 2 seconds.\n\nThey cannot achieve a score of less than 2, so the answer is 2.\n\nSample Input 2\n\n3 8\n4 2 1\n2 3 1\n\nSample Output 2\n\n0\n\nThey can choose not to do exactly K sets of training.\n\nSample Input 3\n\n11 14\n3 1 4 1 5 9 2 6 5 3 5\n8 9 7 9 3 2 3 8 4 6 2\n\nSample Output 3\n\n12", "sample_input": "3 5\n4 2 1\n2 3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02883", "source_text": "Score: 500 points\n\nProblem Statement\n\nTakahashi will take part in an eating contest. Teams of N members will compete in this contest, and Takahashi's team consists of N players numbered 1 through N from youngest to oldest. The consumption coefficient of Member i is A_i.\n\nIn the contest, N foods numbered 1 through N will be presented, and the difficulty of Food i is F_i. The details of the contest are as follows:\n\nA team should assign one member to each food, and should not assign the same member to multiple foods.\n\nIt will take x \\times y seconds for a member to finish the food, where x is the consumption coefficient of the member and y is the difficulty of the dish.\n\nThe score of a team is the longest time it takes for an individual member to finish the food.\n\nBefore the contest, Takahashi's team decided to do some training. In one set of training, a member can reduce his/her consumption coefficient by 1, as long as it does not go below 0. However, for financial reasons, the N members can do at most K sets of training in total.\n\nWhat is the minimum possible score of the team, achieved by choosing the amounts of members' training and allocating the dishes optimally?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 10^{18}\n\n1 \\leq A_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\n1 \\leq F_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\nF_1 F_2 ... F_N\n\nOutput\n\nPrint the minimum possible score of the team.\n\nSample Input 1\n\n3 5\n4 2 1\n2 3 1\n\nSample Output 1\n\n2\n\nThey can achieve the score of 2, as follows:\n\nMember 1 does 4 sets of training and eats Food 2 in (4-4) \\times 3 = 0 seconds.\n\nMember 2 does 1 set of training and eats Food 3 in (2-1) \\times 1 = 1 second.\n\nMember 3 does 0 sets of training and eats Food 1 in (1-0) \\times 2 = 2 seconds.\n\nThey cannot achieve a score of less than 2, so the answer is 2.\n\nSample Input 2\n\n3 8\n4 2 1\n2 3 1\n\nSample Output 2\n\n0\n\nThey can choose not to do exactly K sets of training.\n\nSample Input 3\n\n11 14\n3 1 4 1 5 9 2 6 5 3 5\n8 9 7 9 3 2 3 8 4 6 2\n\nSample Output 3\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1563, "cpu_time_ms": 297, "memory_kb": 6272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s649913197", "group_id": "codeNet:p02883", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t\tif len(os.Args) > 2 {\n\t\t\twfp, _ = os.Create(os.Args[2])\n\t\t}\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\tk := getNextInt64(scanner)\n\n\taa := make([]int, n)\n\tff := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tff[i] = getNextInt(scanner)\n\t}\n\n\tsort.Ints(aa)\n\tsort.Ints(ff)\n\tfoods := make([]Food, n)\n\tfor i := 0; i < n; i++ {\n\t\tfoods[i].a = aa[i]\n\t\tfoods[i].f = ff[n-1-i]\n\t\tfoods[i].sum = int64(foods[i].a) * int64(foods[i].f)\n\t}\n\tl := int64(0)\n\tr := int64(1e3)\n\n\tfor l < r {\n\t\tsum := int64(0)\n\t\tm := (l + r) >> 1\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif foods[i].sum <= m {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsum += int64(foods[i].a) - ((m - 1) / int64(foods[i].f))\n\t\t}\n\t\tif sum <= k {\n\t\t\tr = m\n\t\t\tcontinue\n\t\t}\n\t\tl = m + 1\n\t}\n\n\tif r > 0 {\n\t\tr--\n\t}\n\tfmt.Fprintln(writer, r)\n\n\twriter.Flush()\n}\n\ntype Food struct {\n\ta, f int\n\tsum int64\n}\n", "language": "Go", "metadata": {"date": 1572232326, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02883.html", "problem_id": "p02883", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02883/input.txt", "sample_output_relpath": "derived/input_output/data/p02883/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02883/Go/s649913197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s649913197", "user_id": "u150542210"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t\tif len(os.Args) > 2 {\n\t\t\twfp, _ = os.Create(os.Args[2])\n\t\t}\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\tk := getNextInt64(scanner)\n\n\taa := make([]int, n)\n\tff := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tff[i] = getNextInt(scanner)\n\t}\n\n\tsort.Ints(aa)\n\tsort.Ints(ff)\n\tfoods := make([]Food, n)\n\tfor i := 0; i < n; i++ {\n\t\tfoods[i].a = aa[i]\n\t\tfoods[i].f = ff[n-1-i]\n\t\tfoods[i].sum = int64(foods[i].a) * int64(foods[i].f)\n\t}\n\tl := int64(0)\n\tr := int64(1e3)\n\n\tfor l < r {\n\t\tsum := int64(0)\n\t\tm := (l + r) >> 1\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif foods[i].sum <= m {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsum += int64(foods[i].a) - ((m - 1) / int64(foods[i].f))\n\t\t}\n\t\tif sum <= k {\n\t\t\tr = m\n\t\t\tcontinue\n\t\t}\n\t\tl = m + 1\n\t}\n\n\tif r > 0 {\n\t\tr--\n\t}\n\tfmt.Fprintln(writer, r)\n\n\twriter.Flush()\n}\n\ntype Food struct {\n\ta, f int\n\tsum int64\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nTakahashi will take part in an eating contest. Teams of N members will compete in this contest, and Takahashi's team consists of N players numbered 1 through N from youngest to oldest. The consumption coefficient of Member i is A_i.\n\nIn the contest, N foods numbered 1 through N will be presented, and the difficulty of Food i is F_i. The details of the contest are as follows:\n\nA team should assign one member to each food, and should not assign the same member to multiple foods.\n\nIt will take x \\times y seconds for a member to finish the food, where x is the consumption coefficient of the member and y is the difficulty of the dish.\n\nThe score of a team is the longest time it takes for an individual member to finish the food.\n\nBefore the contest, Takahashi's team decided to do some training. In one set of training, a member can reduce his/her consumption coefficient by 1, as long as it does not go below 0. However, for financial reasons, the N members can do at most K sets of training in total.\n\nWhat is the minimum possible score of the team, achieved by choosing the amounts of members' training and allocating the dishes optimally?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 10^{18}\n\n1 \\leq A_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\n1 \\leq F_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\nF_1 F_2 ... F_N\n\nOutput\n\nPrint the minimum possible score of the team.\n\nSample Input 1\n\n3 5\n4 2 1\n2 3 1\n\nSample Output 1\n\n2\n\nThey can achieve the score of 2, as follows:\n\nMember 1 does 4 sets of training and eats Food 2 in (4-4) \\times 3 = 0 seconds.\n\nMember 2 does 1 set of training and eats Food 3 in (2-1) \\times 1 = 1 second.\n\nMember 3 does 0 sets of training and eats Food 1 in (1-0) \\times 2 = 2 seconds.\n\nThey cannot achieve a score of less than 2, so the answer is 2.\n\nSample Input 2\n\n3 8\n4 2 1\n2 3 1\n\nSample Output 2\n\n0\n\nThey can choose not to do exactly K sets of training.\n\nSample Input 3\n\n11 14\n3 1 4 1 5 9 2 6 5 3 5\n8 9 7 9 3 2 3 8 4 6 2\n\nSample Output 3\n\n12", "sample_input": "3 5\n4 2 1\n2 3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02883", "source_text": "Score: 500 points\n\nProblem Statement\n\nTakahashi will take part in an eating contest. Teams of N members will compete in this contest, and Takahashi's team consists of N players numbered 1 through N from youngest to oldest. The consumption coefficient of Member i is A_i.\n\nIn the contest, N foods numbered 1 through N will be presented, and the difficulty of Food i is F_i. The details of the contest are as follows:\n\nA team should assign one member to each food, and should not assign the same member to multiple foods.\n\nIt will take x \\times y seconds for a member to finish the food, where x is the consumption coefficient of the member and y is the difficulty of the dish.\n\nThe score of a team is the longest time it takes for an individual member to finish the food.\n\nBefore the contest, Takahashi's team decided to do some training. In one set of training, a member can reduce his/her consumption coefficient by 1, as long as it does not go below 0. However, for financial reasons, the N members can do at most K sets of training in total.\n\nWhat is the minimum possible score of the team, achieved by choosing the amounts of members' training and allocating the dishes optimally?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 10^{18}\n\n1 \\leq A_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\n1 \\leq F_i \\leq 10^6\\ (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\nF_1 F_2 ... F_N\n\nOutput\n\nPrint the minimum possible score of the team.\n\nSample Input 1\n\n3 5\n4 2 1\n2 3 1\n\nSample Output 1\n\n2\n\nThey can achieve the score of 2, as follows:\n\nMember 1 does 4 sets of training and eats Food 2 in (4-4) \\times 3 = 0 seconds.\n\nMember 2 does 1 set of training and eats Food 3 in (2-1) \\times 1 = 1 second.\n\nMember 3 does 0 sets of training and eats Food 1 in (1-0) \\times 2 = 2 seconds.\n\nThey cannot achieve a score of less than 2, so the answer is 2.\n\nSample Input 2\n\n3 8\n4 2 1\n2 3 1\n\nSample Output 2\n\n0\n\nThey can choose not to do exactly K sets of training.\n\nSample Input 3\n\n11 14\n3 1 4 1 5 9 2 6 5 3 5\n8 9 7 9 3 2 3 8 4 6 2\n\nSample Output 3\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1828, "cpu_time_ms": 217, "memory_kb": 12160}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s877036674", "group_id": "codeNet:p02886", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\td := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&d[i])\n\t}\n\n\tsum := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tsum += d[i] * d[j]\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1595629658, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02886.html", "problem_id": "p02886", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02886/input.txt", "sample_output_relpath": "derived/input_output/data/p02886/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02886/Go/s877036674.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s877036674", "user_id": "u173515518"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\td := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&d[i])\n\t}\n\n\tsum := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tsum += d[i] * d[j]\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt's now the season of TAKOYAKI FESTIVAL!\n\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\n\nAs is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \\times y health points.\n\nThere are \\frac{N \\times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \\frac{N \\times (N - 1)}{2} values.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\n0 \\leq d_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.\n\nSample Input 1\n\n3\n3 1 2\n\nSample Output 1\n\n11\n\nThere are three possible choices:\n\nEat the first and second takoyaki. You will restore 3 health points.\n\nEat the second and third takoyaki. You will restore 2 health points.\n\nEat the first and third takoyaki. You will restore 6 health points.\n\nThe sum of these values is 11.\n\nSample Input 2\n\n7\n5 0 7 8 3 3 2\n\nSample Output 2\n\n312", "sample_input": "3\n3 1 2\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02886", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt's now the season of TAKOYAKI FESTIVAL!\n\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\n\nAs is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \\times y health points.\n\nThere are \\frac{N \\times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \\frac{N \\times (N - 1)}{2} values.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\n0 \\leq d_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.\n\nSample Input 1\n\n3\n3 1 2\n\nSample Output 1\n\n11\n\nThere are three possible choices:\n\nEat the first and second takoyaki. You will restore 3 health points.\n\nEat the second and third takoyaki. You will restore 2 health points.\n\nEat the first and third takoyaki. You will restore 6 health points.\n\nThe sum of these values is 11.\n\nSample Input 2\n\n7\n5 0 7 8 3 3 2\n\nSample Output 2\n\n312", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 261, "cpu_time_ms": 7, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s003307224", "group_id": "codeNet:p02886", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a int\n\tfmt.Scan(&a)\n\n\tlist := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\th := 0\n\tfor i := 0; i < a; i++ {\n\t\tfor j := i + 1; j < a; j++ {\n\t\t\th += list[i] * list[j]\n\t\t}\n\t}\n\tfmt.Println(h)\n}\n", "language": "Go", "metadata": {"date": 1575922460, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02886.html", "problem_id": "p02886", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02886/input.txt", "sample_output_relpath": "derived/input_output/data/p02886/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02886/Go/s003307224.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003307224", "user_id": "u346986631"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a int\n\tfmt.Scan(&a)\n\n\tlist := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\th := 0\n\tfor i := 0; i < a; i++ {\n\t\tfor j := i + 1; j < a; j++ {\n\t\t\th += list[i] * list[j]\n\t\t}\n\t}\n\tfmt.Println(h)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt's now the season of TAKOYAKI FESTIVAL!\n\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\n\nAs is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \\times y health points.\n\nThere are \\frac{N \\times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \\frac{N \\times (N - 1)}{2} values.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\n0 \\leq d_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.\n\nSample Input 1\n\n3\n3 1 2\n\nSample Output 1\n\n11\n\nThere are three possible choices:\n\nEat the first and second takoyaki. You will restore 3 health points.\n\nEat the second and third takoyaki. You will restore 2 health points.\n\nEat the first and third takoyaki. You will restore 6 health points.\n\nThe sum of these values is 11.\n\nSample Input 2\n\n7\n5 0 7 8 3 3 2\n\nSample Output 2\n\n312", "sample_input": "3\n3 1 2\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02886", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt's now the season of TAKOYAKI FESTIVAL!\n\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\n\nAs is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \\times y health points.\n\nThere are \\frac{N \\times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \\frac{N \\times (N - 1)}{2} values.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\n0 \\leq d_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.\n\nSample Input 1\n\n3\n3 1 2\n\nSample Output 1\n\n11\n\nThere are three possible choices:\n\nEat the first and second takoyaki. You will restore 3 health points.\n\nEat the second and third takoyaki. You will restore 2 health points.\n\nEat the first and third takoyaki. You will restore 6 health points.\n\nThe sum of these values is 11.\n\nSample Input 2\n\n7\n5 0 7 8 3 3 2\n\nSample Output 2\n\n312", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 260, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s410362960", "group_id": "codeNet:p02887", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tgetInt()\n\tS := getString()\n\n\tbefore := ' '\n\tvar inputs []string\n\tfor _, c := range S {\n\t\tif before != c {\n\t\t\tinputs = append(inputs, string(c))\n\t\t\tbefore = c\n\t\t}\n\t}\n\n\tfmt.Println(len(inputs))\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "language": "Go", "metadata": {"date": 1571538983, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02887.html", "problem_id": "p02887", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02887/input.txt", "sample_output_relpath": "derived/input_output/data/p02887/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02887/Go/s410362960.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s410362960", "user_id": "u964273035"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tgetInt()\n\tS := getString()\n\n\tbefore := ' '\n\tvar inputs []string\n\tfor _, c := range S {\n\t\tif before != c {\n\t\t\tinputs = append(inputs, string(c))\n\t\t\tbefore = c\n\t\t}\n\t}\n\n\tfmt.Println(len(inputs))\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.\n\nAdjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.\n\nUltimately, how many slimes will be there?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the final number of slimes.\n\nSample Input 1\n\n10\naabbbbaaca\n\nSample Output 1\n\n5\n\nUltimately, these slimes will fuse into abaca.\n\nSample Input 2\n\n5\naaaaa\n\nSample Output 2\n\n1\n\nAll the slimes will fuse into one.\n\nSample Input 3\n\n20\nxxzaffeeeeddfkkkkllq\n\nSample Output 3\n\n10", "sample_input": "10\naabbbbaaca\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02887", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.\n\nAdjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.\n\nUltimately, how many slimes will be there?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the final number of slimes.\n\nSample Input 1\n\n10\naabbbbaaca\n\nSample Output 1\n\n5\n\nUltimately, these slimes will fuse into abaca.\n\nSample Input 2\n\n5\naaaaa\n\nSample Output 2\n\n1\n\nAll the slimes will fuse into one.\n\nSample Input 3\n\n20\nxxzaffeeeeddfkkkkllq\n\nSample Output 3\n\n10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1423, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s019704326", "group_id": "codeNet:p02888", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t// Code for D - Triangles\n\tvar N int\n\tfmt.Scan(&N)\n\n\tsc.Split(bufio.ScanWords)\n\tl := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tl[i] = nextInt()\n\t}\n\n\tsort.Sort(sort.IntSlice(l))\n\n\tvar count int\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tfor k := j + 1; k < N; k++ {\n\t\t\t\tif l[i] < l[j]+l[k] && l[j] < l[i]+l[k] && l[k] < l[i]+l[j] {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1600166057, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02888.html", "problem_id": "p02888", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02888/input.txt", "sample_output_relpath": "derived/input_output/data/p02888/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02888/Go/s019704326.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s019704326", "user_id": "u128015095"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t// Code for D - Triangles\n\tvar N int\n\tfmt.Scan(&N)\n\n\tsc.Split(bufio.ScanWords)\n\tl := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tl[i] = nextInt()\n\t}\n\n\tsort.Sort(sort.IntSlice(l))\n\n\tvar count int\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tfor k := j + 1; k < N; k++ {\n\t\t\t\tif l[i] < l[j]+l[k] && l[j] < l[i]+l[k] && l[k] < l[i]+l[j] {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "sample_input": "4\n3 4 2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02888", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 629, "cpu_time_ms": 1523, "memory_kb": 1896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s244217978", "group_id": "codeNet:p02888", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tLn := make([]int, N)\n\tfor i := range Ln {\n\t\tLn[i] = nextInt()\n\t}\n\tsort.Ints(Ln)\n\tvar ans int\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tfor k := j + 1; k < N; k++ {\n\t\t\t\ta, b, c := Ln[i], Ln[j], Ln[k]\n\t\t\t\tif a+c > b && a+b > c {\n\t\t\t\t\t// fmt.Println(a, b, c)\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t\tif a+b < c {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "language": "Go", "metadata": {"date": 1593858392, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02888.html", "problem_id": "p02888", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02888/input.txt", "sample_output_relpath": "derived/input_output/data/p02888/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02888/Go/s244217978.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s244217978", "user_id": "u605443479"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tLn := make([]int, N)\n\tfor i := range Ln {\n\t\tLn[i] = nextInt()\n\t}\n\tsort.Ints(Ln)\n\tvar ans int\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tfor k := j + 1; k < N; k++ {\n\t\t\t\ta, b, c := Ln[i], Ln[j], Ln[k]\n\t\t\t\tif a+c > b && a+b > c {\n\t\t\t\t\t// fmt.Println(a, b, c)\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t\tif a+b < c {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "sample_input": "4\n3 4 2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02888", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2107, "cpu_time_ms": 2205, "memory_kb": 1860}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s031544029", "group_id": "codeNet:p02888", "input_text": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n \nvar sc = bufio.NewScanner(os.Stdin)\n \nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n \n\tN := nextInt()\n\tL := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tL[i] = nextInt()\n\t}\n \n fmt.Println(solver(N,L))\n}\n\nfunc solver(N int, L []int) int {\n var ans int\n ans = 0\n sort.Sort(sort.Reverse(sort.IntSlice(L)))\n for i := 0; i < N-2; i++ {\n for j := i+1; j < N-1; j++ {\n for k := j+1; k < N; k++ {\n if L[i] < L[j] + L[k] && \n L[j] < L[i] + L[k] &&\n L[k] < L[j] + L[i] {\n ans++\n continue\n }\n break\n }\n }\n }\n return ans\n}\n", "language": "Go", "metadata": {"date": 1571686099, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02888.html", "problem_id": "p02888", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02888/input.txt", "sample_output_relpath": "derived/input_output/data/p02888/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02888/Go/s031544029.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s031544029", "user_id": "u555298461"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n \nvar sc = bufio.NewScanner(os.Stdin)\n \nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n \n\tN := nextInt()\n\tL := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tL[i] = nextInt()\n\t}\n \n fmt.Println(solver(N,L))\n}\n\nfunc solver(N int, L []int) int {\n var ans int\n ans = 0\n sort.Sort(sort.Reverse(sort.IntSlice(L)))\n for i := 0; i < N-2; i++ {\n for j := i+1; j < N-1; j++ {\n for k := j+1; k < N; k++ {\n if L[i] < L[j] + L[k] && \n L[j] < L[i] + L[k] &&\n L[k] < L[j] + L[i] {\n ans++\n continue\n }\n break\n }\n }\n }\n return ans\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "sample_input": "4\n3 4 2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02888", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 913, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s693275248", "group_id": "codeNet:p02888", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"sort\"\n \"strconv\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n scanner.Scan()\n N, _ := strconv.Atoi(scanner.Text())\n L := make([]int, N)\n for i := range L {\n scanner.Scan()\n L[i], _ = strconv.Atoi(scanner.Text())\n }\n\n cnt := 0\n sort.Ints(L)\n for i := range L {\n a := L[i]\n for j := i + 1; j < len(L); j++ {\n b := L[j]\n for k := j + 1; k < len(L); k++ {\n c := L[k]\n if a < b+c && b < c+a && c < a+b {\n cnt++\n }\n }\n }\n }\n writer.WriteString(strconv.Itoa(cnt) + \"\\n\")\n}\n", "language": "Go", "metadata": {"date": 1571593986, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02888.html", "problem_id": "p02888", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02888/input.txt", "sample_output_relpath": "derived/input_output/data/p02888/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02888/Go/s693275248.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s693275248", "user_id": "u882460931"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"sort\"\n \"strconv\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n scanner.Scan()\n N, _ := strconv.Atoi(scanner.Text())\n L := make([]int, N)\n for i := range L {\n scanner.Scan()\n L[i], _ = strconv.Atoi(scanner.Text())\n }\n\n cnt := 0\n sort.Ints(L)\n for i := range L {\n a := L[i]\n for j := i + 1; j < len(L); j++ {\n b := L[j]\n for k := j + 1; k < len(L); k++ {\n c := L[k]\n if a < b+c && b < c+a && c < a+b {\n cnt++\n }\n }\n }\n }\n writer.WriteString(strconv.Itoa(cnt) + \"\\n\")\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "sample_input": "4\n3 4 2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02888", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1013, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s983121100", "group_id": "codeNet:p02888", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = nextInt()\n\t}\n\treturn ints\n}\nfunc createTriangles(rods []int) (total int) {\n\tn := len(rods)\n\tfor a := 0; a < n; a++ {\n\t\tfor b := a + 1; b < n; b++ {\n\t\t\tfor c := b + 1; c < n; c++ {\n\t\t\t\trodsA := rods[a]\n\t\t\t\trodsB := rods[b]\n\t\t\t\trodsC := rods[c]\n\t\t\t\tif rodsA < rodsB+rodsC && rodsB < rodsC+rodsA && rodsC < rodsA+rodsB {\n\t\t\t\t\ttotal++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\nfunc main() {\n\tn := nextInt()\n\trods := nextInts(n)\n\tfmt.Println(createTriangles(rods))\n}\n", "language": "Go", "metadata": {"date": 1571537899, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02888.html", "problem_id": "p02888", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02888/input.txt", "sample_output_relpath": "derived/input_output/data/p02888/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02888/Go/s983121100.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s983121100", "user_id": "u727347518"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = nextInt()\n\t}\n\treturn ints\n}\nfunc createTriangles(rods []int) (total int) {\n\tn := len(rods)\n\tfor a := 0; a < n; a++ {\n\t\tfor b := a + 1; b < n; b++ {\n\t\t\tfor c := b + 1; c < n; c++ {\n\t\t\t\trodsA := rods[a]\n\t\t\t\trodsB := rods[b]\n\t\t\t\trodsC := rods[c]\n\t\t\t\tif rodsA < rodsB+rodsC && rodsB < rodsC+rodsA && rodsC < rodsA+rodsB {\n\t\t\t\t\ttotal++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\nfunc main() {\n\tn := nextInt()\n\trods := nextInts(n)\n\tfmt.Println(createTriangles(rods))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "sample_input": "4\n3 4 2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02888", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\n\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied:\n\na < b + c\n\nb < c + a\n\nc < a + b\n\nHow many different triangles can be formed? Two triangles are considered different when there is a stick used in only one of them.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 2 \\times 10^3\n\n1 \\leq L_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nConstraints\n\nPrint the number of different triangles that can be formed.\n\nSample Input 1\n\n4\n3 4 2 1\n\nSample Output 1\n\n1\n\nOnly one triangle can be formed: the triangle formed by the first, second, and third sticks.\n\nSample Input 2\n\n3\n1 1000 1\n\nSample Output 2\n\n0\n\nNo triangles can be formed.\n\nSample Input 3\n\n7\n218 786 704 233 645 728 389\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 829, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s140183220", "group_id": "codeNet:p02897", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n float64\n\tfmt.Scan(&n)\n\tif int(n)%2 == 0 {\n\t\tfmt.Println(1.0 / 2)\n\t} else {\n\t\tfmt.Println(math.Ceil(n/2) / n)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581179192, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/Go/s140183220.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s140183220", "user_id": "u363118893"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n float64\n\tfmt.Scan(&n)\n\tif int(n)%2 == 0 {\n\t\tfmt.Println(1.0 / 2)\n\t} else {\n\t\tfmt.Println(math.Ceil(n/2) / n)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 176, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s755999300", "group_id": "codeNet:p02897", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc in() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc str() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar out = fmt.Println\n\nfunc main() {\n\tn := float64(in())\n\tout(float64(int((n + 1) / 2)) / n)\n}\n", "language": "Go", "metadata": {"date": 1571062443, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/Go/s755999300.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s755999300", "user_id": "u303059352"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc in() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc str() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar out = fmt.Println\n\nfunc main() {\n\tn := float64(in())\n\tout(float64(int((n + 1) / 2)) / n)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 314, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s043529056", "group_id": "codeNet:p02897", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc solve() {\n\tvar N int\n\tReadf(\"%d\", &N)\n\n\tvar c float32 = float32(N/2)\n\tif (N % 2 ) == 1 {\n\t\tc++\n\t}\n\n\tWritef(\"%f\", c/float32(N))\n}\n\nfunc main() {\n\t// If io still contains some buffered data flush it before\n\t// quiting\n\tdefer io.Flush()\n\n\t// Solution of the problem goes here\n\tsolve()\n}\n\nvar (\n\t// fmt.Print and fmt.Scan is slow, we will use bufio\n\t// for read and write from stdin.\n\tio = bufio.NewReadWriter(\n\t\tbufio.NewReader(os.Stdin),\n\t\tbufio.NewWriter(os.Stdout),\n\t)\n)\n\nfunc Readf(format string, args ...interface{}) {\n\tfmt.Fscanf(io, format, args...)\n}\n\nfunc Writef(format string, args ...interface{}) {\n\tfmt.Fprintf(io, format, args...)\n}\n", "language": "Go", "metadata": {"date": 1570228406, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/Go/s043529056.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s043529056", "user_id": "u664491426"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc solve() {\n\tvar N int\n\tReadf(\"%d\", &N)\n\n\tvar c float32 = float32(N/2)\n\tif (N % 2 ) == 1 {\n\t\tc++\n\t}\n\n\tWritef(\"%f\", c/float32(N))\n}\n\nfunc main() {\n\t// If io still contains some buffered data flush it before\n\t// quiting\n\tdefer io.Flush()\n\n\t// Solution of the problem goes here\n\tsolve()\n}\n\nvar (\n\t// fmt.Print and fmt.Scan is slow, we will use bufio\n\t// for read and write from stdin.\n\tio = bufio.NewReadWriter(\n\t\tbufio.NewReader(os.Stdin),\n\t\tbufio.NewWriter(os.Stdout),\n\t)\n)\n\nfunc Readf(format string, args ...interface{}) {\n\tfmt.Fscanf(io, format, args...)\n}\n\nfunc Writef(format string, args ...interface{}) {\n\tfmt.Fprintf(io, format, args...)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 699, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s872371471", "group_id": "codeNet:p02898", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nconst MaxBuf = 200100\nvar buf []byte\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf,MaxBuf)\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\tr,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn r\n}\n\nfunc readInt() int {\n sc.Scan()\n r,_ := strconv.Atoi(sc.Text())\n return r\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr,_ := strconv.ParseFloat(sc.Text(),64)\n\treturn r\n}\n\nfunc main() {\n\tn := readInt()\n\tk := readInt()\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif readInt() >= k {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}", "language": "Go", "metadata": {"date": 1569754429, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02898.html", "problem_id": "p02898", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02898/input.txt", "sample_output_relpath": "derived/input_output/data/p02898/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02898/Go/s872371471.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s872371471", "user_id": "u330661451"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nconst MaxBuf = 200100\nvar buf []byte\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf,MaxBuf)\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\tr,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn r\n}\n\nfunc readInt() int {\n sc.Scan()\n r,_ := strconv.Atoi(sc.Text())\n return r\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr,_ := strconv.ParseFloat(sc.Text(),64)\n\treturn r\n}\n\nfunc main() {\n\tn := readInt()\n\tk := readInt()\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif readInt() >= k {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "sample_input": "4 150\n150 140 100 200\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02898", "source_text": "Score : 200 points\n\nProblem Statement\n\nN friends of Takahashi has come to a theme park.\n\nTo ride the most popular roller coaster in the park, you must be at least K centimeters tall.\n\nThe i-th friend is h_i centimeters tall.\n\nHow many of the Takahashi's friends can ride the roller coaster?\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le K \\le 500\n\n1 \\le h_i \\le 500\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the number of people among the Takahashi's friends who can ride the roller coaster.\n\nSample Input 1\n\n4 150\n150 140 100 200\n\nSample Output 1\n\n2\n\nTwo of them can ride the roller coaster: the first and fourth friends.\n\nSample Input 2\n\n1 500\n499\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5 1\n100 200 300 400 500\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 675, "cpu_time_ms": 16, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117608982", "group_id": "codeNet:p02899", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\t_, _ = fmt.Scan(&n)\n\tstudents := make([]int, n)\n\tstu := make(map[int]int, n)\n\t\n\tfor i := 0; i < n; i++ {\n\t\tvar s int\n\t\t_, _ = fmt.Scan(&s)\n\t\tstudents[i] = s\n\t\tstu[s] = i\n\t}\n\t\n\tsort.Ints(students)\n\t\n\tfor _, s := range students {\n\t\tfmt.Print(stu[s]+1, \" \")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1575231456, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02899.html", "problem_id": "p02899", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02899/input.txt", "sample_output_relpath": "derived/input_output/data/p02899/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02899/Go/s117608982.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s117608982", "user_id": "u336949031"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\t_, _ = fmt.Scan(&n)\n\tstudents := make([]int, n)\n\tstu := make(map[int]int, n)\n\t\n\tfor i := 0; i < n; i++ {\n\t\tvar s int\n\t\t_, _ = fmt.Scan(&s)\n\t\tstudents[i] = s\n\t\tstu[s] = i\n\t}\n\t\n\tsort.Ints(students)\n\t\n\tfor _, s := range students {\n\t\tfmt.Print(stu[s]+1, \" \")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "sample_input": "3\n2 3 1\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02899", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 327, "cpu_time_ms": 731, "memory_kb": 7424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s066008306", "group_id": "codeNet:p02900", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tA := getInt()\n\tB := getInt()\n\n\tgcd := calcGcd(A, B)\n\tcd := getDivisor(gcd)\n\t\n\tresult := 0\n\n\tfor _, cd := range cd {\n\t\tif cd == 1 || isPrime(cd) {\n\t\t\tresult++\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tdivisor = append(divisor, n)\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n", "language": "Go", "metadata": {"date": 1585495075, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02900/input.txt", "sample_output_relpath": "derived/input_output/data/p02900/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02900/Go/s066008306.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s066008306", "user_id": "u964273035"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tA := getInt()\n\tB := getInt()\n\n\tgcd := calcGcd(A, B)\n\tcd := getDivisor(gcd)\n\t\n\tresult := 0\n\n\tfor _, cd := range cd {\n\t\tif cd == 1 || isPrime(cd) {\n\t\t\tresult++\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tdivisor = append(divisor, n)\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "sample_input": "12 18\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02900", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3913, "cpu_time_ms": 16, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s844225238", "group_id": "codeNet:p02900", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tA := readi()\n\tB := readi()\n\td := gcd(A, B)\n\tif d == 1 {\n\t\tprintln(1)\n\t\treturn\n\t}\n\n\tp := NewPrimes(d + 1)\n\tprintln(len(p.Factorize(d)) + 1)\n\n}\n\ntype Primes struct {\n\tp []bool\n\td []int\n}\n\nfunc NewPrimes(n int) Primes {\n\tm := n + 1\n\tp := Primes{\n\t\tp: make([]bool, m),\n\t\td: make([]int, m),\n\t}\n\tp.d[1] = 1\n\tfor i := 3; i < m; i += 2 {\n\t\tp.p[i] = true\n\t\tp.d[i-1] = 2\n\t}\n\tif n%2 == 0 {\n\t\tp.d[n] = 2\n\t}\n\tp.p[2] = true\n\ti := 3\n\tfor ; i*i < m; i += 2 {\n\t\tif !p.p[i] {\n\t\t\tcontinue\n\t\t}\n\t\tp.d[i] = i\n\t\tfor j := i * i; j < m; j += i {\n\t\t\tp.p[j] = false\n\t\t\tif p.d[j] == 0 {\n\t\t\t\tp.d[j] = i\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i = i - 2; i < m; i += 2 {\n\t\tif p.d[i] == 0 {\n\t\t\tp.d[i] = i\n\t\t}\n\t}\n\n\treturn p\n}\n\nfunc (ps Primes) IsPrime(x int) bool {\n\treturn ps.p[x]\n}\n\nfunc (ps Primes) Divisor(x int) int {\n\treturn ps.d[x]\n}\n\nfunc (ps Primes) Factorize(x int) [][2]int {\n\tres := make([][2]int, 0)\n\tif x == 1 {\n\t\tres = append(res, [2]int{1, 1})\n\t\treturn res\n\t}\n\tv := x\n\tfor v != 1 {\n\t\td := ps.d[v]\n\t\tif d == x {\n\t\t\tbreak\n\t\t}\n\t\tif 0 < len(res) && res[len(res)-1][0] == d {\n\t\t\tres[len(res)-1][1]++\n\t\t} else {\n\t\t\tres = append(res, [2]int{d, 1})\n\t\t}\n\t\tv /= d\n\t}\n\treturn res\n}\n\nfunc (ps Primes) FactorizeMap(x int) map[int]int {\n\tm := make(map[int]int)\n\tfor _, f := range ps.Factorize(x) {\n\t\tm[f[0]] = f[1]\n\t}\n\treturn m\n}\n\n// newFactorial(n, p int) returns 2 functions.\n// 1. factorial(x int) int: returns factorial x modulo p (0 <= x <= n)\n// 2. combination(x, r int int: returns xCr modulo p (1 <= r <= x <= n)\nfunc newFactorial(n, p int) (factorial func(int) int, combination func(int, int) int) {\n\tif n < 1 {\n\t\tpanic(\"newFactorial: n must be more than 0\")\n\t}\n\n\tfact := make([]int, n+1)\n\tfact[1] = 1\n\tfor i := 2; i <= n; i++ {\n\t\tfact[i] = mul(fact[i-1], i, p)\n\t}\n\n\tifact := make([]int, n+1)\n\tifact[n] = inv(fact[n], p)\n\tfor i := n - 1; 0 <= i; i-- {\n\t\tifact[i] = mul(ifact[i+1], i+1, p)\n\t}\n\n\tfactorial = func(i int) int {\n\t\treturn fact[i]\n\t}\n\tcombination = func(n, r int) int {\n\t\treturn mul3(fact[n], ifact[n-r], ifact[r], p)\n\t}\n\treturn\n}\n\nfunc mul(a, b, p int) int {\n\treturn int(int64(a) * int64(b) % int64(p))\n}\n\nfunc mul3(a, b, c, p int) int {\n\treturn int(int64(a) * int64(b) % int64(p) * int64(c) % int64(p))\n}\n\nfunc mulm(a, b int, rest ...int) int {\n\tn := len(rest) - 1\n\tp := int64(rest[n])\n\trest = rest[:n]\n\tres := int64(a) * int64(b) % p\n\tfor _, v := range rest {\n\t\tres = res * int64(v) % p\n\t}\n\n\treturn int(res)\n}\n\nfunc div(n, d, p int) int {\n\treturn mul(n, inv(d, p), p)\n}\n\nfunc inv(a, p int) int {\n\treturn exp(a, p-2, p)\n}\n\nfunc exp(n, e, p int) int {\n\tif e == 0 {\n\t\treturn 1\n\t}\n\tif e&1 == 1 {\n\t\treturn mul(n, exp(n, e-1, p), p)\n\t} else {\n\t\treturn square(exp(n, e/2, p), p)\n\t}\n}\n\nfunc square(a, p int) int {\n\treturn mul(a, a, p)\n}\n", "language": "Go", "metadata": {"date": 1580826289, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02900/input.txt", "sample_output_relpath": "derived/input_output/data/p02900/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02900/Go/s844225238.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s844225238", "user_id": "u705974985"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tA := readi()\n\tB := readi()\n\td := gcd(A, B)\n\tif d == 1 {\n\t\tprintln(1)\n\t\treturn\n\t}\n\n\tp := NewPrimes(d + 1)\n\tprintln(len(p.Factorize(d)) + 1)\n\n}\n\ntype Primes struct {\n\tp []bool\n\td []int\n}\n\nfunc NewPrimes(n int) Primes {\n\tm := n + 1\n\tp := Primes{\n\t\tp: make([]bool, m),\n\t\td: make([]int, m),\n\t}\n\tp.d[1] = 1\n\tfor i := 3; i < m; i += 2 {\n\t\tp.p[i] = true\n\t\tp.d[i-1] = 2\n\t}\n\tif n%2 == 0 {\n\t\tp.d[n] = 2\n\t}\n\tp.p[2] = true\n\ti := 3\n\tfor ; i*i < m; i += 2 {\n\t\tif !p.p[i] {\n\t\t\tcontinue\n\t\t}\n\t\tp.d[i] = i\n\t\tfor j := i * i; j < m; j += i {\n\t\t\tp.p[j] = false\n\t\t\tif p.d[j] == 0 {\n\t\t\t\tp.d[j] = i\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i = i - 2; i < m; i += 2 {\n\t\tif p.d[i] == 0 {\n\t\t\tp.d[i] = i\n\t\t}\n\t}\n\n\treturn p\n}\n\nfunc (ps Primes) IsPrime(x int) bool {\n\treturn ps.p[x]\n}\n\nfunc (ps Primes) Divisor(x int) int {\n\treturn ps.d[x]\n}\n\nfunc (ps Primes) Factorize(x int) [][2]int {\n\tres := make([][2]int, 0)\n\tif x == 1 {\n\t\tres = append(res, [2]int{1, 1})\n\t\treturn res\n\t}\n\tv := x\n\tfor v != 1 {\n\t\td := ps.d[v]\n\t\tif d == x {\n\t\t\tbreak\n\t\t}\n\t\tif 0 < len(res) && res[len(res)-1][0] == d {\n\t\t\tres[len(res)-1][1]++\n\t\t} else {\n\t\t\tres = append(res, [2]int{d, 1})\n\t\t}\n\t\tv /= d\n\t}\n\treturn res\n}\n\nfunc (ps Primes) FactorizeMap(x int) map[int]int {\n\tm := make(map[int]int)\n\tfor _, f := range ps.Factorize(x) {\n\t\tm[f[0]] = f[1]\n\t}\n\treturn m\n}\n\n// newFactorial(n, p int) returns 2 functions.\n// 1. factorial(x int) int: returns factorial x modulo p (0 <= x <= n)\n// 2. combination(x, r int int: returns xCr modulo p (1 <= r <= x <= n)\nfunc newFactorial(n, p int) (factorial func(int) int, combination func(int, int) int) {\n\tif n < 1 {\n\t\tpanic(\"newFactorial: n must be more than 0\")\n\t}\n\n\tfact := make([]int, n+1)\n\tfact[1] = 1\n\tfor i := 2; i <= n; i++ {\n\t\tfact[i] = mul(fact[i-1], i, p)\n\t}\n\n\tifact := make([]int, n+1)\n\tifact[n] = inv(fact[n], p)\n\tfor i := n - 1; 0 <= i; i-- {\n\t\tifact[i] = mul(ifact[i+1], i+1, p)\n\t}\n\n\tfactorial = func(i int) int {\n\t\treturn fact[i]\n\t}\n\tcombination = func(n, r int) int {\n\t\treturn mul3(fact[n], ifact[n-r], ifact[r], p)\n\t}\n\treturn\n}\n\nfunc mul(a, b, p int) int {\n\treturn int(int64(a) * int64(b) % int64(p))\n}\n\nfunc mul3(a, b, c, p int) int {\n\treturn int(int64(a) * int64(b) % int64(p) * int64(c) % int64(p))\n}\n\nfunc mulm(a, b int, rest ...int) int {\n\tn := len(rest) - 1\n\tp := int64(rest[n])\n\trest = rest[:n]\n\tres := int64(a) * int64(b) % p\n\tfor _, v := range rest {\n\t\tres = res * int64(v) % p\n\t}\n\n\treturn int(res)\n}\n\nfunc div(n, d, p int) int {\n\treturn mul(n, inv(d, p), p)\n}\n\nfunc inv(a, p int) int {\n\treturn exp(a, p-2, p)\n}\n\nfunc exp(n, e, p int) int {\n\tif e == 0 {\n\t\treturn 1\n\t}\n\tif e&1 == 1 {\n\t\treturn mul(n, exp(n, e-1, p), p)\n\t} else {\n\t\treturn square(exp(n, e/2, p), p)\n\t}\n}\n\nfunc square(a, p int) int {\n\treturn mul(a, a, p)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "sample_input": "12 18\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02900", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8216, "cpu_time_ms": 2112, "memory_kb": 1668096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s412098305", "group_id": "codeNet:p02900", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc calcGcd(l, r int) int {\n\tif r > l {\n\t\tr, l = l, r\n\t}\n\n\td := l % r\n\tfor d != 0 {\n\t\tl = r\n\t\tr = d\n\t\td = l % r\n\t}\n\treturn r\n}\n\nfunc calcDsOCd(l, r int) int {\n\tgcd := calcGcd(l, r)\n\tprimes := []int{1}\n\n\tfor i := 2; i <= gcd; i++ {\n\t\tisDivid := false\n\t\tfor gcd%i == 0 {\n\t\t\tgcd = gcd / i\n\t\t\tisDivid = true\n\t\t}\n\t\tif isDivid {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\treturn len(primes)\n}\n\nfunc main() {\n\tl, r := nextInt(), nextInt()\n\tresult := calcDsOCd(l, r)\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1575603560, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02900/input.txt", "sample_output_relpath": "derived/input_output/data/p02900/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02900/Go/s412098305.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s412098305", "user_id": "u727347518"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc calcGcd(l, r int) int {\n\tif r > l {\n\t\tr, l = l, r\n\t}\n\n\td := l % r\n\tfor d != 0 {\n\t\tl = r\n\t\tr = d\n\t\td = l % r\n\t}\n\treturn r\n}\n\nfunc calcDsOCd(l, r int) int {\n\tgcd := calcGcd(l, r)\n\tprimes := []int{1}\n\n\tfor i := 2; i <= gcd; i++ {\n\t\tisDivid := false\n\t\tfor gcd%i == 0 {\n\t\t\tgcd = gcd / i\n\t\t\tisDivid = true\n\t\t}\n\t\tif isDivid {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\treturn len(primes)\n}\n\nfunc main() {\n\tl, r := nextInt(), nextInt()\n\tresult := calcDsOCd(l, r)\n\tfmt.Println(result)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "sample_input": "12 18\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02900", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 769, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s152721873", "group_id": "codeNet:p02900", "input_text": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n)\n\ntype int int64\n\n\nfunc main() {\n\n\tvar A,B int\n\tfmt.Scan(&A,&B)\n\n\n\tvar gcd int\n\tgcd, _ = GCD(A,B)\n\n\tvar ans []int\n\tans = PrimeFactors(gcd)\n\n\n\tfmt.Println(len(ans) + 1)\n\n}\n\nfunc GCD(a, b int) (int, error) {\n\tret := int(-1)\n\n\tvar n int\n\tfor n = 1; n*n <= a; n++ {\n\t\tif a%n == 0 {\n\t\t\tif b%n == 0 {\n\t\t\t\tret = int(math.Max(float64(n), float64(ret)))\n\t\t\t}\n\n\t\t\tt := a / n\n\t\t\tif b%t == 0 {\n\t\t\t\tret = int(math.Max(float64(t), float64(ret)))\n\t\t\t}\n\t\t}\n\t}\n\n\tif ret == -1 {\n\t\treturn ret, errors.New(\"empty!\")\n\t} else {\n\t\treturn ret, nil\n\t}\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tvar i int\n\tfor i = 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}", "language": "Go", "metadata": {"date": 1570726344, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02900/input.txt", "sample_output_relpath": "derived/input_output/data/p02900/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02900/Go/s152721873.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s152721873", "user_id": "u187669010"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n)\n\ntype int int64\n\n\nfunc main() {\n\n\tvar A,B int\n\tfmt.Scan(&A,&B)\n\n\n\tvar gcd int\n\tgcd, _ = GCD(A,B)\n\n\tvar ans []int\n\tans = PrimeFactors(gcd)\n\n\n\tfmt.Println(len(ans) + 1)\n\n}\n\nfunc GCD(a, b int) (int, error) {\n\tret := int(-1)\n\n\tvar n int\n\tfor n = 1; n*n <= a; n++ {\n\t\tif a%n == 0 {\n\t\t\tif b%n == 0 {\n\t\t\t\tret = int(math.Max(float64(n), float64(ret)))\n\t\t\t}\n\n\t\t\tt := a / n\n\t\t\tif b%t == 0 {\n\t\t\t\tret = int(math.Max(float64(t), float64(ret)))\n\t\t\t}\n\t\t}\n\t}\n\n\tif ret == -1 {\n\t\treturn ret, errors.New(\"empty!\")\n\t} else {\n\t\treturn ret, nil\n\t}\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tvar i int\n\tfor i = 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "sample_input": "12 18\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02900", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1079, "cpu_time_ms": 16, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s463239455", "group_id": "codeNet:p02900", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc gcd(a, b int) int {\n if b == 0 {\n return a\n }\n return gcd(b, a%b)\n}\n\nfunc primeSet(n int) []int {\n if n == 1 { return []int{} }\n for i := 2; i * i < n; i++ {\n if n % i > 0 { continue }\n P := append([]int{i}, primeSet(n / i)...)\n if len(P) > 1 && P[0] == P[1] {\n return P[1:]\n }\n return P\n }\n return []int{n}\n}\n\nfunc main() {\n AB := NextIntVec()\n GCD := gcd(AB[0], AB[1])\n Write(len(primeSet(GCD)) + 1)\n Output()\n}", "language": "Go", "metadata": {"date": 1569730642, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02900.html", "problem_id": "p02900", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02900/input.txt", "sample_output_relpath": "derived/input_output/data/p02900/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02900/Go/s463239455.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s463239455", "user_id": "u415905784"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc gcd(a, b int) int {\n if b == 0 {\n return a\n }\n return gcd(b, a%b)\n}\n\nfunc primeSet(n int) []int {\n if n == 1 { return []int{} }\n for i := 2; i * i < n; i++ {\n if n % i > 0 { continue }\n P := append([]int{i}, primeSet(n / i)...)\n if len(P) > 1 && P[0] == P[1] {\n return P[1:]\n }\n return P\n }\n return []int{n}\n}\n\nfunc main() {\n AB := NextIntVec()\n GCD := gcd(AB[0], AB[1])\n Write(len(primeSet(GCD)) + 1)\n Output()\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "sample_input": "12 18\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02900", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are positive integers A and B.\n\nLet us choose some number of positive common divisors of A and B.\n\nHere, any two of the chosen divisors must be coprime.\n\nAt most, how many divisors can we choose?\n\nDefinition of common divisor\n\nAn integer d is said to be a common divisor of integers x and y when d divides both x and y.\n\nDefinition of being coprime\n\nIntegers x and y are said to be coprime when x and y have no positive common divisors other than 1.\n\nDefinition of dividing\n\nAn integer x is said to divide another integer y when there exists an integer \\alpha such that y = \\alpha x.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of divisors that can be chosen to satisfy the condition.\n\nSample Input 1\n\n12 18\n\nSample Output 1\n\n3\n\n12 and 18 have the following positive common divisors: 1, 2, 3, and 6.\n\n1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.\n\nSample Input 2\n\n420 660\n\nSample Output 2\n\n4\n\nSample Input 3\n\n1 2019\n\nSample Output 3\n\n1\n\n1 and 2019 have no positive common divisors other than 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1142, "cpu_time_ms": 11, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s203782877", "group_id": "codeNet:p02901", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ta, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc powUInt2(n int) uint {\n\tret := uint(1)\n\tfor i := 0; i < n; i++ {\n\t\tret *= 2\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tm := scanInt()\n\n\ta := make([]int, m)\n\tb := make([]uint, m)\n\tfor i := 0; i < m; i++ {\n\t\ta[i] = scanInt()\n\t\tnb := scanInt()\n\t\tfor j := 0; j < nb; j++ {\n\t\t\tb[i] |= powUInt2(scanInt() - 1)\n\t\t}\n\t}\n\n\tbMaskMap := map[uint]uint{}\n\tbMaskMap[0] = uint(0)\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := powUInt2(i - 1); j < powUInt2(i); j++ {\n\t\t\tbMaskMap[j] = powUInt2(i) - 1\n\t\t}\n\t}\n\n\tdp := make([][]int, m+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, powUInt2(n))\n\t}\n\n\tdp[0][0] = 0\n\tfor i := 1; i < int(powUInt2(n)); i++ {\n\t\tdp[0][i] = math.MaxInt32\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfor j := uint(0); j < powUInt2(n); j++ {\n\n\t\t\tl := dp[i][j^(bMaskMap[j]&b[i])] + a[i]\n\t\t\tr := dp[i][j]\n\t\t\tif l > r {\n\t\t\t\tdp[i+1][j] = r\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = l\n\t\t\t}\n\t\t}\n\t}\n\tif dp[m][powUInt2(n)-1] == math.MaxInt32 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(dp[m][int(powUInt2(n))-1])\n\t}\n}", "language": "Go", "metadata": {"date": 1582560723, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02901.html", "problem_id": "p02901", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02901/input.txt", "sample_output_relpath": "derived/input_output/data/p02901/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02901/Go/s203782877.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s203782877", "user_id": "u605983940"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ta, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc powUInt2(n int) uint {\n\tret := uint(1)\n\tfor i := 0; i < n; i++ {\n\t\tret *= 2\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tm := scanInt()\n\n\ta := make([]int, m)\n\tb := make([]uint, m)\n\tfor i := 0; i < m; i++ {\n\t\ta[i] = scanInt()\n\t\tnb := scanInt()\n\t\tfor j := 0; j < nb; j++ {\n\t\t\tb[i] |= powUInt2(scanInt() - 1)\n\t\t}\n\t}\n\n\tbMaskMap := map[uint]uint{}\n\tbMaskMap[0] = uint(0)\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := powUInt2(i - 1); j < powUInt2(i); j++ {\n\t\t\tbMaskMap[j] = powUInt2(i) - 1\n\t\t}\n\t}\n\n\tdp := make([][]int, m+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, powUInt2(n))\n\t}\n\n\tdp[0][0] = 0\n\tfor i := 1; i < int(powUInt2(n)); i++ {\n\t\tdp[0][i] = math.MaxInt32\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfor j := uint(0); j < powUInt2(n); j++ {\n\n\t\t\tl := dp[i][j^(bMaskMap[j]&b[i])] + a[i]\n\t\t\tr := dp[i][j]\n\t\t\tif l > r {\n\t\t\t\tdp[i+1][j] = r\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = l\n\t\t\t}\n\t\t}\n\t}\n\tif dp[m][powUInt2(n)-1] == math.MaxInt32 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(dp[m][int(powUInt2(n))-1])\n\t}\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N locked treasure boxes, numbered 1 to N.\n\nA shop sells M keys. The i-th key is sold for a_i yen (the currency of Japan), and it can unlock b_i of the boxes: Box c_{i1}, c_{i2}, ..., c_{i{b_i}}. Each key purchased can be used any number of times.\n\nFind the minimum cost required to unlock all the treasure boxes. If it is impossible to unlock all of them, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 12\n\n1 \\leq M \\leq 10^3\n\n1 \\leq a_i \\leq 10^5\n\n1 \\leq b_i \\leq N\n\n1 \\leq c_{i1} < c_{i2} < ... < c_{i{b_i}} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\nc_{11} c_{12} ... c_{1{b_1}}\n:\na_M b_M\nc_{M1} c_{M2} ... c_{M{b_M}}\n\nOutput\n\nPrint the minimum cost required to unlock all the treasure boxes.\nIf it is impossible to unlock all of them, print -1.\n\nSample Input 1\n\n2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n\nSample Output 1\n\n25\n\nWe can unlock all the boxes by purchasing the first and second keys, at the cost of 25 yen, which is the minimum cost required.\n\nSample Input 2\n\n12 1\n100000 1\n2\n\nSample Output 2\n\n-1\n\nWe cannot unlock all the boxes.\n\nSample Input 3\n\n4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3\n\nSample Output 3\n\n69942", "sample_input": "2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n"}, "reference_outputs": ["25\n"], "source_document_id": "p02901", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N locked treasure boxes, numbered 1 to N.\n\nA shop sells M keys. The i-th key is sold for a_i yen (the currency of Japan), and it can unlock b_i of the boxes: Box c_{i1}, c_{i2}, ..., c_{i{b_i}}. Each key purchased can be used any number of times.\n\nFind the minimum cost required to unlock all the treasure boxes. If it is impossible to unlock all of them, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 12\n\n1 \\leq M \\leq 10^3\n\n1 \\leq a_i \\leq 10^5\n\n1 \\leq b_i \\leq N\n\n1 \\leq c_{i1} < c_{i2} < ... < c_{i{b_i}} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\nc_{11} c_{12} ... c_{1{b_1}}\n:\na_M b_M\nc_{M1} c_{M2} ... c_{M{b_M}}\n\nOutput\n\nPrint the minimum cost required to unlock all the treasure boxes.\nIf it is impossible to unlock all of them, print -1.\n\nSample Input 1\n\n2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n\nSample Output 1\n\n25\n\nWe can unlock all the boxes by purchasing the first and second keys, at the cost of 25 yen, which is the minimum cost required.\n\nSample Input 2\n\n12 1\n100000 1\n2\n\nSample Output 2\n\n-1\n\nWe cannot unlock all the boxes.\n\nSample Input 3\n\n4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3\n\nSample Output 3\n\n69942", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1260, "cpu_time_ms": 209, "memory_kb": 34048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s209788662", "group_id": "codeNet:p02901", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype key struct {\n\ta int\n\tc int\n}\n\nconst inf = 1 << 60\n\nfunc main() {\n\tn, m := getInt(), getInt()\n\tks := make([]key, m)\n\tfor i := range ks {\n\t\tks[i].a = getInt()\n\n\t\tb := getInt()\n\t\tfor j := 0; j < b; j++ {\n\t\t\ttmp := uint(getInt()) - 1\n\t\t\tks[i].c += 1 << tmp\n\t\t}\n\t}\n\n\tif !checker(ks, n) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tdp := make([]int, (1 << uint(n)))\n\tfor i := range dp {\n\t\tdp[i] = inf\n\t}\n\tdp[0] = 0\n\n\tfor _, k := range ks {\n\t\tdp[k.c] = min(dp[k.c], k.a)\n\t\tfor j := range dp {\n\t\t\tdp[k.c|j] = min(dp[k.c|j], dp[k.c]+dp[j])\n\t\t}\n\t}\n\n\tfmt.Println(dp[(1< m {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// -----------------------------------------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc getInt() int {\n\ti, err := strconv.Atoi(getString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1569724434, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02901.html", "problem_id": "p02901", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02901/input.txt", "sample_output_relpath": "derived/input_output/data/p02901/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02901/Go/s209788662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s209788662", "user_id": "u543933043"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype key struct {\n\ta int\n\tc int\n}\n\nconst inf = 1 << 60\n\nfunc main() {\n\tn, m := getInt(), getInt()\n\tks := make([]key, m)\n\tfor i := range ks {\n\t\tks[i].a = getInt()\n\n\t\tb := getInt()\n\t\tfor j := 0; j < b; j++ {\n\t\t\ttmp := uint(getInt()) - 1\n\t\t\tks[i].c += 1 << tmp\n\t\t}\n\t}\n\n\tif !checker(ks, n) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tdp := make([]int, (1 << uint(n)))\n\tfor i := range dp {\n\t\tdp[i] = inf\n\t}\n\tdp[0] = 0\n\n\tfor _, k := range ks {\n\t\tdp[k.c] = min(dp[k.c], k.a)\n\t\tfor j := range dp {\n\t\t\tdp[k.c|j] = min(dp[k.c|j], dp[k.c]+dp[j])\n\t\t}\n\t}\n\n\tfmt.Println(dp[(1< m {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// -----------------------------------------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc getInt() int {\n\ti, err := strconv.Atoi(getString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N locked treasure boxes, numbered 1 to N.\n\nA shop sells M keys. The i-th key is sold for a_i yen (the currency of Japan), and it can unlock b_i of the boxes: Box c_{i1}, c_{i2}, ..., c_{i{b_i}}. Each key purchased can be used any number of times.\n\nFind the minimum cost required to unlock all the treasure boxes. If it is impossible to unlock all of them, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 12\n\n1 \\leq M \\leq 10^3\n\n1 \\leq a_i \\leq 10^5\n\n1 \\leq b_i \\leq N\n\n1 \\leq c_{i1} < c_{i2} < ... < c_{i{b_i}} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\nc_{11} c_{12} ... c_{1{b_1}}\n:\na_M b_M\nc_{M1} c_{M2} ... c_{M{b_M}}\n\nOutput\n\nPrint the minimum cost required to unlock all the treasure boxes.\nIf it is impossible to unlock all of them, print -1.\n\nSample Input 1\n\n2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n\nSample Output 1\n\n25\n\nWe can unlock all the boxes by purchasing the first and second keys, at the cost of 25 yen, which is the minimum cost required.\n\nSample Input 2\n\n12 1\n100000 1\n2\n\nSample Output 2\n\n-1\n\nWe cannot unlock all the boxes.\n\nSample Input 3\n\n4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3\n\nSample Output 3\n\n69942", "sample_input": "2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n"}, "reference_outputs": ["25\n"], "source_document_id": "p02901", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N locked treasure boxes, numbered 1 to N.\n\nA shop sells M keys. The i-th key is sold for a_i yen (the currency of Japan), and it can unlock b_i of the boxes: Box c_{i1}, c_{i2}, ..., c_{i{b_i}}. Each key purchased can be used any number of times.\n\nFind the minimum cost required to unlock all the treasure boxes. If it is impossible to unlock all of them, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 12\n\n1 \\leq M \\leq 10^3\n\n1 \\leq a_i \\leq 10^5\n\n1 \\leq b_i \\leq N\n\n1 \\leq c_{i1} < c_{i2} < ... < c_{i{b_i}} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\nc_{11} c_{12} ... c_{1{b_1}}\n:\na_M b_M\nc_{M1} c_{M2} ... c_{M{b_M}}\n\nOutput\n\nPrint the minimum cost required to unlock all the treasure boxes.\nIf it is impossible to unlock all of them, print -1.\n\nSample Input 1\n\n2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n\nSample Output 1\n\n25\n\nWe can unlock all the boxes by purchasing the first and second keys, at the cost of 25 yen, which is the minimum cost required.\n\nSample Input 2\n\n12 1\n100000 1\n2\n\nSample Output 2\n\n-1\n\nWe cannot unlock all the boxes.\n\nSample Input 3\n\n4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3\n\nSample Output 3\n\n69942", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1173, "cpu_time_ms": 12, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s271509439", "group_id": "codeNet:p02903", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tH := readi()\n\tW := readi()\n\tA := readi()\n\tB := readi()\n\n\tf := make([][]int, H)\n\tfor i := range f {\n\t\tf[i] = make([]int, W)\n\t}\n\n\tsolve(f, A, B)\n\t//for i := range f {\n\t//\teprintln(f[i])\n\t//}\n\n\tif !check(f, A, B) {\n\t\tprintln(\"No\")\n\t\treturn\n\t}\n\tfor i := range f {\n\t\tfor j := range f[i] {\n\t\t\tprintf(\"%d\", f[i][j])\n\t\t}\n\t\tprintln()\n\t}\n\n}\n\nfunc solve(f [][]int, A, B int) {\n\tH := len(f)\n\tW := len(f[0])\n\tif A == 0 {\n\t\tA = len(f[0])\n\t}\n\tif B == 0 {\n\t\tB = len(f)\n\t}\n\t//eprintln(H, W, A, B)\n\tfor i, j := 0, 0; i < H && j < W; i, j = i+B, j+A {\n\t\tfor k := i; k < H && k < i+B; k++ {\n\t\t\tfor l := j; l < W && l < j+A; l++ {\n\t\t\t\tf[k][l] = 1\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc check(f [][]int, A, B int) bool {\n\tH := len(f)\n\tW := len(f[0])\n\tfor i := range f {\n\t\tvar count int\n\t\tfor j := range f[i] {\n\t\t\tif f[i][j] == 1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif min(count, W-count) != A {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor j := range f[0] {\n\t\tvar count int\n\t\tfor i := range f {\n\t\t\tif f[i][j] == 1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif min(count, H-count) != B {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1576457712, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02903.html", "problem_id": "p02903", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02903/input.txt", "sample_output_relpath": "derived/input_output/data/p02903/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02903/Go/s271509439.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s271509439", "user_id": "u705974985"}, "prompt_components": {"gold_output": "100\n010\n001\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tH := readi()\n\tW := readi()\n\tA := readi()\n\tB := readi()\n\n\tf := make([][]int, H)\n\tfor i := range f {\n\t\tf[i] = make([]int, W)\n\t}\n\n\tsolve(f, A, B)\n\t//for i := range f {\n\t//\teprintln(f[i])\n\t//}\n\n\tif !check(f, A, B) {\n\t\tprintln(\"No\")\n\t\treturn\n\t}\n\tfor i := range f {\n\t\tfor j := range f[i] {\n\t\t\tprintf(\"%d\", f[i][j])\n\t\t}\n\t\tprintln()\n\t}\n\n}\n\nfunc solve(f [][]int, A, B int) {\n\tH := len(f)\n\tW := len(f[0])\n\tif A == 0 {\n\t\tA = len(f[0])\n\t}\n\tif B == 0 {\n\t\tB = len(f)\n\t}\n\t//eprintln(H, W, A, B)\n\tfor i, j := 0, 0; i < H && j < W; i, j = i+B, j+A {\n\t\tfor k := i; k < H && k < i+B; k++ {\n\t\t\tfor l := j; l < W && l < j+A; l++ {\n\t\t\t\tf[k][l] = 1\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc check(f [][]int, A, B int) bool {\n\tH := len(f)\n\tW := len(f[0])\n\tfor i := range f {\n\t\tvar count int\n\t\tfor j := range f[i] {\n\t\t\tif f[i][j] == 1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif min(count, W-count) != A {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor j := range f[0] {\n\t\tvar count int\n\t\tfor i := range f {\n\t\t\tif f[i][j] == 1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif min(count, H-count) != B {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a square grid with H rows and W columns.\nSnuke wants to write 0 or 1 in each of the squares.\nHere, all of the following conditions have to be satisfied:\n\nFor every row, the smaller of the following is A: the number of 0s contained in the row, and the number of 1s contained in the row. (If these two numbers are equal, “the smaller” should be read as “either”.)\n\nFor every column, the smaller of the following is B: the number of 0s contained in the column, and the number of 1s contained in the column.\n\nDetermine if these conditions can be satisfied by writing 0 or 1 in each of the squares. If the answer is yes, show one way to fill the squares so that the conditions are satisfied.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\n0 \\leq A\n\n2 \\times A \\leq W\n\n0 \\leq B\n\n2 \\times B \\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W A B\n\nOutput\n\nIf the conditions cannot be satisfied by writing 0 or 1 in each of the squares, print -1.\n\nIf the conditions can be satisfied, print one way to fill the squares so that the conditions are satisfied, in the following format:\n\ns_{11}s_{12}\\cdots s_{1W}\ns_{21}s_{22}\\cdots s_{2W}\n\\vdots\ns_{H1}s_{H2}\\cdots s_{HW}\n\nHere s_{ij} is the digit written in the square at the i-th row from the top and the j-th column from the left in the grid.\n\nIf multiple solutions exist, printing any of them will be accepted.\n\nSample Input 1\n\n3 3 1 1\n\nSample Output 1\n\n100\n010\n001\n\nEvery row contains two 0s and one 1, so the first condition is satisfied.\nAlso, every column contains two 0s and one 1, so the second condition is satisfied.\n\nSample Input 2\n\n1 5 2 0\n\nSample Output 2\n\n01010", "sample_input": "3 3 1 1\n"}, "reference_outputs": ["100\n010\n001\n"], "source_document_id": "p02903", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a square grid with H rows and W columns.\nSnuke wants to write 0 or 1 in each of the squares.\nHere, all of the following conditions have to be satisfied:\n\nFor every row, the smaller of the following is A: the number of 0s contained in the row, and the number of 1s contained in the row. (If these two numbers are equal, “the smaller” should be read as “either”.)\n\nFor every column, the smaller of the following is B: the number of 0s contained in the column, and the number of 1s contained in the column.\n\nDetermine if these conditions can be satisfied by writing 0 or 1 in each of the squares. If the answer is yes, show one way to fill the squares so that the conditions are satisfied.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\n0 \\leq A\n\n2 \\times A \\leq W\n\n0 \\leq B\n\n2 \\times B \\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W A B\n\nOutput\n\nIf the conditions cannot be satisfied by writing 0 or 1 in each of the squares, print -1.\n\nIf the conditions can be satisfied, print one way to fill the squares so that the conditions are satisfied, in the following format:\n\ns_{11}s_{12}\\cdots s_{1W}\ns_{21}s_{22}\\cdots s_{2W}\n\\vdots\ns_{H1}s_{H2}\\cdots s_{HW}\n\nHere s_{ij} is the digit written in the square at the i-th row from the top and the j-th column from the left in the grid.\n\nIf multiple solutions exist, printing any of them will be accepted.\n\nSample Input 1\n\n3 3 1 1\n\nSample Output 1\n\n100\n010\n001\n\nEvery row contains two 0s and one 1, so the first condition is satisfied.\nAlso, every column contains two 0s and one 1, so the second condition is satisfied.\n\nSample Input 2\n\n1 5 2 0\n\nSample Output 2\n\n01010", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5442, "cpu_time_ms": 218, "memory_kb": 17152}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s810965543", "group_id": "codeNet:p02909", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar weathers []string = []string{\"Sunny\", \"Cloudy\", \"Rainy\"}\n\nfunc main() {\n\tvar in string\n\tfmt.Scanf(\"%s\", &in)\n\n\tfor i := 0; i < len(weathers); i++ {\n\t\tif weathers[i] == in {\n\t\t\tfmt.Printf(\"%s\\n\", weathers[(i+1)%len(weathers)])\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1569317364, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/Go/s810965543.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s810965543", "user_id": "u456983904"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar weathers []string = []string{\"Sunny\", \"Cloudy\", \"Rainy\"}\n\nfunc main() {\n\tvar in string\n\tfmt.Scanf(\"%s\", &in)\n\n\tfor i := 0; i < len(weathers); i++ {\n\t\tif weathers[i] == in {\n\t\t\tfmt.Printf(\"%s\\n\", weathers[(i+1)%len(weathers)])\n\t\t}\n\t}\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 272, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s703094861", "group_id": "codeNet:p02910", "input_text": "package main\n \nimport ( \n \"errors\" \n \"fmt\"\n \"strings\"\n) \n \nfunc isTapDanceEasy(s string) bool {\n if len(s) >= 1 && len(s) <= 100 {\n odds := make([]string, 0)\n evens := make([]string, 0)\n sl := strings.Split(s, \"\")\n \n for i, char := range sl { \n if (i+1)%2 == 0 {\n evens = append(evens, char)\n continue\n }\n odds = append(odds, char)\n } \n odd := strings.Join(odds, \"\") \n even := strings.Join(evens, \"\") \n if strings.Contains(odd, \"L\") || strings.Contains(even, \"R\") {\n return false \n } \n return true\n } \n panic(errors.New(\"No solution\"))\n}\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if isTapDanceEasy(s) {\n fmt.Println(\"Yes\")\n }\n fmt.Println(\"No\")\n}", "language": "Go", "metadata": {"date": 1568600876, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02910.html", "problem_id": "p02910", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02910/input.txt", "sample_output_relpath": "derived/input_output/data/p02910/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02910/Go/s703094861.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s703094861", "user_id": "u568763892"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n \nimport ( \n \"errors\" \n \"fmt\"\n \"strings\"\n) \n \nfunc isTapDanceEasy(s string) bool {\n if len(s) >= 1 && len(s) <= 100 {\n odds := make([]string, 0)\n evens := make([]string, 0)\n sl := strings.Split(s, \"\")\n \n for i, char := range sl { \n if (i+1)%2 == 0 {\n evens = append(evens, char)\n continue\n }\n odds = append(odds, char)\n } \n odd := strings.Join(odds, \"\") \n even := strings.Join(evens, \"\") \n if strings.Contains(odd, \"L\") || strings.Contains(even, \"R\") {\n return false \n } \n return true\n } \n panic(errors.New(\"No solution\"))\n}\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if isTapDanceEasy(s) {\n fmt.Println(\"Yes\")\n }\n fmt.Println(\"No\")\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "sample_input": "RUDLUDR\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02910", "source_text": "Score: 200 points\n\nProblem Statement\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1346, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s069683999", "group_id": "codeNet:p02911", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanLines)\n\tvar n, k, q int\n\t_, _ = fmt.Scan(&n, &k, &q)\n\t\n\tscores := make([]int, n)\n\t\n\tfor i, _ := range scores {\n\t\tscores[i] = k\n\t}\n\t\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\ta, _ := strconv.Atoi(scanner.Text())\n\t\tfor j, s := range scores {\n\t\t\tif a-1 != j {\n\t\t\t\tscores[j] = s - 1\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfor _, s := range scores {\n\t\tif s > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1575244594, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02911.html", "problem_id": "p02911", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02911/input.txt", "sample_output_relpath": "derived/input_output/data/p02911/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02911/Go/s069683999.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s069683999", "user_id": "u336949031"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanLines)\n\tvar n, k, q int\n\t_, _ = fmt.Scan(&n, &k, &q)\n\t\n\tscores := make([]int, n)\n\t\n\tfor i, _ := range scores {\n\t\tscores[i] = k\n\t}\n\t\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\ta, _ := strconv.Atoi(scanner.Text())\n\t\tfor j, s := range scores {\n\t\t\tif a-1 != j {\n\t\t\t\tscores[j] = s - 1\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfor _, s := range scores {\n\t\tif s > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "sample_input": "6 3 4\n3\n1\n3\n2\n"}, "reference_outputs": ["No\nNo\nYes\nNo\nNo\nNo\n"], "source_document_id": "p02911", "source_text": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 537, "cpu_time_ms": 2107, "memory_kb": 3456}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s087070271", "group_id": "codeNet:p02911", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tk := nextInt()\n\tq := nextInt()\n\tscores := make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tscores[nextInt()-1]++\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif score := k - q + scores[i]; score > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1570824449, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02911.html", "problem_id": "p02911", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02911/input.txt", "sample_output_relpath": "derived/input_output/data/p02911/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02911/Go/s087070271.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s087070271", "user_id": "u665224938"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tk := nextInt()\n\tq := nextInt()\n\tscores := make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tscores[nextInt()-1]++\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif score := k - q + scores[i]; score > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "sample_input": "6 3 4\n3\n1\n3\n2\n"}, "reference_outputs": ["No\nNo\nYes\nNo\nNo\nNo\n"], "source_document_id": "p02911", "source_text": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 505, "cpu_time_ms": 225, "memory_kb": 3968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s188720008", "group_id": "codeNet:p02911", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\tbasicIO \"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tprotagonist(os.Stdin, os.Stdout)\n}\n\nfunc protagonist(r basicIO.Reader, w basicIO.Writer) {\n\tio := NewIO(r, w)\n\tN, _ := io.nextInt()\n\tK, _ := io.nextInt()\n\tQ, _ := io.nextInt()\n\n\tA := make([]int, N)\n\n\tfor i := 0; i < Q; i++ {\n\t\tn, _ := io.nextInt()\n\t\tA[n-1]++\n\t}\n\n\tfor _, val := range A {\n\t\tif (Q - val) < K {\n\t\t\tio.PutString(\"Yes\")\n\t\t} else {\n\t\t\tio.PutString(\"No\")\n\t\t}\n\t}\n}\n\ntype IO struct {\n\tScanner *bufio.Scanner\n\tWriter basicIO.Writer\n}\n\nfunc NewIO(r basicIO.Reader, w basicIO.Writer) *IO {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\treturn &IO{\n\t\tScanner: s,\n\t\tWriter: w,\n\t}\n}\n\nfunc (io *IO) nextString() string {\n\tio.Scanner.Scan()\n\treturn io.Scanner.Text()\n}\n\nfunc (io *IO) nextInt() (int, error) {\n\tio.Scanner.Scan()\n\ti, err := strconv.Atoi(io.Scanner.Text())\n\treturn i, err\n}\n\nfunc (io *IO) PutInt(v int) {\n\tfmt.Fprintf(io.Writer, \"%d\\n\", v)\n}\n\nfunc (io *IO) PutString(s string) {\n\tfmt.Fprintf(io.Writer, \"%s\\n\", s)\n}\n", "language": "Go", "metadata": {"date": 1568598879, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02911.html", "problem_id": "p02911", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02911/input.txt", "sample_output_relpath": "derived/input_output/data/p02911/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02911/Go/s188720008.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s188720008", "user_id": "u289119898"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\tbasicIO \"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tprotagonist(os.Stdin, os.Stdout)\n}\n\nfunc protagonist(r basicIO.Reader, w basicIO.Writer) {\n\tio := NewIO(r, w)\n\tN, _ := io.nextInt()\n\tK, _ := io.nextInt()\n\tQ, _ := io.nextInt()\n\n\tA := make([]int, N)\n\n\tfor i := 0; i < Q; i++ {\n\t\tn, _ := io.nextInt()\n\t\tA[n-1]++\n\t}\n\n\tfor _, val := range A {\n\t\tif (Q - val) < K {\n\t\t\tio.PutString(\"Yes\")\n\t\t} else {\n\t\t\tio.PutString(\"No\")\n\t\t}\n\t}\n}\n\ntype IO struct {\n\tScanner *bufio.Scanner\n\tWriter basicIO.Writer\n}\n\nfunc NewIO(r basicIO.Reader, w basicIO.Writer) *IO {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\treturn &IO{\n\t\tScanner: s,\n\t\tWriter: w,\n\t}\n}\n\nfunc (io *IO) nextString() string {\n\tio.Scanner.Scan()\n\treturn io.Scanner.Text()\n}\n\nfunc (io *IO) nextInt() (int, error) {\n\tio.Scanner.Scan()\n\ti, err := strconv.Atoi(io.Scanner.Text())\n\treturn i, err\n}\n\nfunc (io *IO) PutInt(v int) {\n\tfmt.Fprintf(io.Writer, \"%d\\n\", v)\n}\n\nfunc (io *IO) PutString(s string) {\n\tfmt.Fprintf(io.Writer, \"%s\\n\", s)\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "sample_input": "6 3 4\n3\n1\n3\n2\n"}, "reference_outputs": ["No\nNo\nYes\nNo\nNo\nNo\n"], "source_document_id": "p02911", "source_text": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1027, "cpu_time_ms": 238, "memory_kb": 3968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s466123260", "group_id": "codeNet:p02915", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tfmt.Println(N * N * N)\n}\n", "language": "Go", "metadata": {"date": 1596009408, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/Go/s466123260.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s466123260", "user_id": "u128015095"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tfmt.Println(N * N * N)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 107, "cpu_time_ms": 3, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276020180", "group_id": "codeNet:p02915", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(n * n * n)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1595528500, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/Go/s276020180.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s276020180", "user_id": "u282164747"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(n * n * n)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 288, "cpu_time_ms": 7, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s966757914", "group_id": "codeNet:p02915", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(n * n * n)\n}\n", "language": "Go", "metadata": {"date": 1569884078, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/Go/s966757914.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s966757914", "user_id": "u937220467"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(n * n * n)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 93, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s733450726", "group_id": "codeNet:p02915", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tfmt.Println(math.Pow(float64(N), float64(3)))\n\n}", "language": "Go", "metadata": {"date": 1568290581, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/Go/s733450726.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s733450726", "user_id": "u298152049"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tfmt.Println(math.Pow(float64(N), float64(3)))\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 129, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s342923546", "group_id": "codeNet:p02915", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tfmt.Println(pow(N, 3))\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1567904554, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/Go/s342923546.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s342923546", "user_id": "u266742706"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tfmt.Println(pow(N, 3))\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2653, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s688370681", "group_id": "codeNet:p02916", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int,n)\n\tb := make([]int,n)\n\tc := make([]int,n-1)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar val int\n\t\tfmt.Scan(&val)\n\t\ta[i] = val\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tvar val int\n\t\tfmt.Scan(&val)\n\t\tb[i] = val\n\t}\n\n\tfor i := 0; i < n - 1; i++ {\n\t\tvar val int\n\t\tfmt.Scan(&val)\n\t\tc[i] = val\n\t}\n\n\ttmp := a[0]\n\tvar ans int\n\tfor i := 0; i < n; i++ {\n\t\tans += b[a[i] - 1]\n\t\tif a[i] == tmp + 1 {\n\t\t\tans += c[a[i] - 2]\n\t\t}\n\t\ttmp = a[i]\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1568688574, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02916.html", "problem_id": "p02916", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02916/input.txt", "sample_output_relpath": "derived/input_output/data/p02916/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02916/Go/s688370681.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688370681", "user_id": "u390374229"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int,n)\n\tb := make([]int,n)\n\tc := make([]int,n-1)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar val int\n\t\tfmt.Scan(&val)\n\t\ta[i] = val\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tvar val int\n\t\tfmt.Scan(&val)\n\t\tb[i] = val\n\t}\n\n\tfor i := 0; i < n - 1; i++ {\n\t\tvar val int\n\t\tfmt.Scan(&val)\n\t\tc[i] = val\n\t}\n\n\ttmp := a[0]\n\tvar ans int\n\tfor i := 0; i < n; i++ {\n\t\tans += b[a[i] - 1]\n\t\tif a[i] == tmp + 1 {\n\t\t\tans += c[a[i] - 2]\n\t\t}\n\t\ttmp = a[i]\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \\ldots, Dish N) once.\n\nThe i-th dish (1 \\leq i \\leq N) he ate was Dish A_i.\n\nWhen he eats Dish i (1 \\leq i \\leq N), he gains B_i satisfaction points.\n\nAdditionally, when he eats Dish i+1 just after eating Dish i (1 \\leq i \\leq N - 1), he gains C_i more satisfaction points.\n\nFind the sum of the satisfaction points he gained.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 20\n\n1 \\leq A_i \\leq N\n\nA_1, A_2, ..., A_N are all different.\n\n1 \\leq B_i \\leq 50\n\n1 \\leq C_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\nC_1 C_2 ... C_{N-1}\n\nOutput\n\nPrint the sum of the satisfaction points Takahashi gained, as an integer.\n\nSample Input 1\n\n3\n3 1 2\n2 5 4\n3 6\n\nSample Output 1\n\n14\n\nTakahashi gained 14 satisfaction points in total, as follows:\n\nFirst, he ate Dish 3 and gained 4 satisfaction points.\n\nNext, he ate Dish 1 and gained 2 satisfaction points.\n\nLastly, he ate Dish 2 and gained 5 + 3 = 8 satisfaction points.\n\nSample Input 2\n\n4\n2 3 4 1\n13 5 8 24\n45 9 15\n\nSample Output 2\n\n74\n\nSample Input 3\n\n2\n1 2\n50 50\n50\n\nSample Output 3\n\n150", "sample_input": "3\n3 1 2\n2 5 4\n3 6\n"}, "reference_outputs": ["14\n"], "source_document_id": "p02916", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \\ldots, Dish N) once.\n\nThe i-th dish (1 \\leq i \\leq N) he ate was Dish A_i.\n\nWhen he eats Dish i (1 \\leq i \\leq N), he gains B_i satisfaction points.\n\nAdditionally, when he eats Dish i+1 just after eating Dish i (1 \\leq i \\leq N - 1), he gains C_i more satisfaction points.\n\nFind the sum of the satisfaction points he gained.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 20\n\n1 \\leq A_i \\leq N\n\nA_1, A_2, ..., A_N are all different.\n\n1 \\leq B_i \\leq 50\n\n1 \\leq C_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\nC_1 C_2 ... C_{N-1}\n\nOutput\n\nPrint the sum of the satisfaction points Takahashi gained, as an integer.\n\nSample Input 1\n\n3\n3 1 2\n2 5 4\n3 6\n\nSample Output 1\n\n14\n\nTakahashi gained 14 satisfaction points in total, as follows:\n\nFirst, he ate Dish 3 and gained 4 satisfaction points.\n\nNext, he ate Dish 1 and gained 2 satisfaction points.\n\nLastly, he ate Dish 2 and gained 5 + 3 = 8 satisfaction points.\n\nSample Input 2\n\n4\n2 3 4 1\n13 5 8 24\n45 9 15\n\nSample Output 2\n\n74\n\nSample Input 3\n\n2\n1 2\n50 50\n50\n\nSample Output 3\n\n150", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 519, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s931188737", "group_id": "codeNet:p02917", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readInt()\n\n\tans, pre := 0, math.MaxInt64\n\tfor i := 0; i < n-1; i++ {\n\t\tcur := readInt()\n\t\tans += min(cur, pre)\n\t\tpre = cur\n\t}\n\tans += pre\n\n\tfmt.Println(ans)\n}\n\n// sort ------------------------------------------------------------\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "language": "Go", "metadata": {"date": 1572454054, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02917.html", "problem_id": "p02917", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02917/input.txt", "sample_output_relpath": "derived/input_output/data/p02917/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02917/Go/s931188737.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s931188737", "user_id": "u295946532"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readInt()\n\n\tans, pre := 0, math.MaxInt64\n\tfor i := 0; i < n-1; i++ {\n\t\tcur := readInt()\n\t\tans += min(cur, pre)\n\t\tpre = cur\n\t}\n\tans += pre\n\n\tfmt.Println(ans)\n}\n\n// sort ------------------------------------------------------------\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "sample_input": "3\n2 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02917", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1944, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s919601593", "group_id": "codeNet:p02917", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := getInt()\n\n\tvar bs []int\n\n\tfor i := 0; i < n-1; i++ {\n\t\tbs = append(bs, getInt())\n\t}\n\n\tvar as []int\n\tas = append(as, bs[0])\n\tfor i := 0; i < n-2; i++ {\n\t\tb1 := bs[i]\n\t\tb2 := bs[i+1]\n\n\t\tif b1 <= b2 {\n\t\t\tas = append(as, b1)\n\t\t} else {\n\t\t\tas = append(as, b2)\n\t\t}\n\t}\n\tas = append(as, bs[n-2])\n\n\tsum := 0\n\tfor _, a := range as {\n\t\tsum += a\n\t}\n\tfmt.Println(sum)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "language": "Go", "metadata": {"date": 1567906672, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02917.html", "problem_id": "p02917", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02917/input.txt", "sample_output_relpath": "derived/input_output/data/p02917/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02917/Go/s919601593.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s919601593", "user_id": "u964273035"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := getInt()\n\n\tvar bs []int\n\n\tfor i := 0; i < n-1; i++ {\n\t\tbs = append(bs, getInt())\n\t}\n\n\tvar as []int\n\tas = append(as, bs[0])\n\tfor i := 0; i < n-2; i++ {\n\t\tb1 := bs[i]\n\t\tb2 := bs[i+1]\n\n\t\tif b1 <= b2 {\n\t\t\tas = append(as, b1)\n\t\t} else {\n\t\t\tas = append(as, b2)\n\t\t}\n\t}\n\tas = append(as, bs[n-2])\n\n\tsum := 0\n\tfor _, a := range as {\n\t\tsum += a\n\t}\n\tfmt.Println(sum)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "sample_input": "3\n2 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02917", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is an integer sequence A of length N whose values are unknown.\n\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n\nB_i \\geq \\max(A_i, A_{i+1})\n\nFind the maximum possible sum of the elements of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq B_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nB_1 B_2 ... B_{N-1}\n\nOutput\n\nPrint the maximum possible sum of the elements of A.\n\nSample Input 1\n\n3\n2 5\n\nSample Output 1\n\n9\n\nA can be, for example, ( 2 , 1 , 5 ), ( -1 , -2 , -3 ), or ( 2 , 2 , 5 ). Among those candidates, A = ( 2 , 2 , 5 ) has the maximum possible sum.\n\nSample Input 2\n\n2\n3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n6\n0 153 10 10 23\n\nSample Output 3\n\n53", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1591, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s412831024", "group_id": "codeNet:p02918", "input_text": "// https://atcoder.jp/contests/abc140/tasks/abc140_d\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\t_ = io.NextInt()\n\tK := io.NextInt()\n\tS := io.NextRunes()\n\n\tres := 0\n\tcan := K\n\n\tswitchedCt := 0\n\n\tcurr := S[0]\n\n\tfor i := 1; i < len(S); i++ {\n\t\tprev := curr\n\t\tcurr = S[i]\n\n\t\tif prev == curr {\n\t\t\tres++\n\t\t\tcontinue\n\t\t}\n\n\t\tif prev != curr {\n\t\t\tswitchedCt++\n\t\t}\n\n\t\tif switchedCt == 2 && can > 0 {\n\t\t\tswitchedCt = 0\n\t\t\tres += 2\n\t\t\tcan--\n\t\t}\n\t}\n\n\tif switchedCt == 1 && can > 0 {\n\t\tres++\n\t}\n\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextRunes returns next string as []rune\nfunc (io *Io) NextRunes() []rune {\n\treturn []rune(io.Next())\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n// Assert checks the value equality for debug\nfunc (io *Io) Assert(a, b interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tif !reflect.DeepEqual(a, b) {\n\t\t_, _, line, _ := runtime.Caller(1)\n\t\tio.Debug(\"Diff:\", line, \"\\na:\", a, \"\\nb:\", b)\n\t}\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmin := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif min > number {\n\t\t\tmin = number\n\t\t}\n\t}\n\treturn min\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "language": "Go", "metadata": {"date": 1567906842, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02918.html", "problem_id": "p02918", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02918/input.txt", "sample_output_relpath": "derived/input_output/data/p02918/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02918/Go/s412831024.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s412831024", "user_id": "u751468134"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc140/tasks/abc140_d\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\t_ = io.NextInt()\n\tK := io.NextInt()\n\tS := io.NextRunes()\n\n\tres := 0\n\tcan := K\n\n\tswitchedCt := 0\n\n\tcurr := S[0]\n\n\tfor i := 1; i < len(S); i++ {\n\t\tprev := curr\n\t\tcurr = S[i]\n\n\t\tif prev == curr {\n\t\t\tres++\n\t\t\tcontinue\n\t\t}\n\n\t\tif prev != curr {\n\t\t\tswitchedCt++\n\t\t}\n\n\t\tif switchedCt == 2 && can > 0 {\n\t\t\tswitchedCt = 0\n\t\t\tres += 2\n\t\t\tcan--\n\t\t}\n\t}\n\n\tif switchedCt == 1 && can > 0 {\n\t\tres++\n\t}\n\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextRunes returns next string as []rune\nfunc (io *Io) NextRunes() []rune {\n\treturn []rune(io.Next())\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n// Assert checks the value equality for debug\nfunc (io *Io) Assert(a, b interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tif !reflect.DeepEqual(a, b) {\n\t\t_, _, line, _ := runtime.Caller(1)\n\t\tio.Debug(\"Diff:\", line, \"\\na:\", a, \"\\nb:\", b)\n\t}\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmin := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif min > number {\n\t\t\tmin = number\n\t\t}\n\t}\n\treturn min\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N people standing in a queue from west to east.\n\nGiven is a string S of length N representing the directions of the people.\nThe i-th person from the west is facing west if the i-th character of S is L, and east if that character of S is R.\n\nA person is happy if the person in front of him/her is facing the same direction.\nIf no person is standing in front of a person, however, he/she is not happy.\n\nYou can perform the following operation any number of times between 0 and K (inclusive):\n\nOperation: Choose integers l and r such that 1 \\leq l \\leq r \\leq N, and rotate by 180 degrees the part of the queue: the l-th, (l+1)-th, ..., r-th persons. That is, for each i = 0, 1, ..., r-l, the (l + i)-th person from the west will stand the (r - i)-th from the west after the operation, facing east if he/she is facing west now, and vice versa.\n\nWhat is the maximum possible number of happy people you can have?\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\n|S| = N\n\nEach character of S is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of happy people after at most K operations.\n\nSample Input 1\n\n6 1\nLRLRRL\n\nSample Output 1\n\n3\n\nIf we choose (l, r) = (2, 5), we have LLLRLL, where the 2-nd, 3-rd, and 6-th persons from the west are happy.\n\nSample Input 2\n\n13 3\nLRRLRLRRLRLLR\n\nSample Output 2\n\n9\n\nSample Input 3\n\n10 1\nLLLLLRRRRR\n\nSample Output 3\n\n9\n\nSample Input 4\n\n9 2\nRRRLRLRLL\n\nSample Output 4\n\n7", "sample_input": "6 1\nLRLRRL\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02918", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N people standing in a queue from west to east.\n\nGiven is a string S of length N representing the directions of the people.\nThe i-th person from the west is facing west if the i-th character of S is L, and east if that character of S is R.\n\nA person is happy if the person in front of him/her is facing the same direction.\nIf no person is standing in front of a person, however, he/she is not happy.\n\nYou can perform the following operation any number of times between 0 and K (inclusive):\n\nOperation: Choose integers l and r such that 1 \\leq l \\leq r \\leq N, and rotate by 180 degrees the part of the queue: the l-th, (l+1)-th, ..., r-th persons. That is, for each i = 0, 1, ..., r-l, the (l + i)-th person from the west will stand the (r - i)-th from the west after the operation, facing east if he/she is facing west now, and vice versa.\n\nWhat is the maximum possible number of happy people you can have?\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\n|S| = N\n\nEach character of S is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of happy people after at most K operations.\n\nSample Input 1\n\n6 1\nLRLRRL\n\nSample Output 1\n\n3\n\nIf we choose (l, r) = (2, 5), we have LLLRLL, where the 2-nd, 3-rd, and 6-th persons from the west are happy.\n\nSample Input 2\n\n13 3\nLRRLRLRRLRLLR\n\nSample Output 2\n\n9\n\nSample Input 3\n\n10 1\nLLLLLRRRRR\n\nSample Output 3\n\n9\n\nSample Input 4\n\n9 2\nRRRLRLRLL\n\nSample Output 4\n\n7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6462, "cpu_time_ms": 5, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063902233", "group_id": "codeNet:p02920", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc main() {\n N := NextInt()\n S := NextIntVec()\n M := len(S)\n sort.Sort(sort.Reverse(sort.IntSlice(S)))\n C := make([]int, M)\n C[0] = N\n pos := 1\n ans := \"Yes\"\n for i, c := range C {\n for j := 0; j < c - 1; j++ {\n if S[i] == S[pos + j] { ans = \"No\" } \n C[pos + j] = c - j - 1\n }\n pos += c - 1\n }\n M /= 2\n for i := 0; i < M; i++ {\n if S[i] == S[M + i] { ans = \"No\" }\n }\n Write(ans)\n Output()\n}", "language": "Go", "metadata": {"date": 1571864292, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02920.html", "problem_id": "p02920", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02920/input.txt", "sample_output_relpath": "derived/input_output/data/p02920/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02920/Go/s063902233.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s063902233", "user_id": "u415905784"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc main() {\n N := NextInt()\n S := NextIntVec()\n M := len(S)\n sort.Sort(sort.Reverse(sort.IntSlice(S)))\n C := make([]int, M)\n C[0] = N\n pos := 1\n ans := \"Yes\"\n for i, c := range C {\n for j := 0; j < c - 1; j++ {\n if S[i] == S[pos + j] { ans = \"No\" } \n C[pos + j] = c - j - 1\n }\n pos += c - 1\n }\n M /= 2\n for i := 0; i < M; i++ {\n if S[i] == S[M + i] { ans = \"No\" }\n }\n Write(ans)\n Output()\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have one slime.\n\nYou can set the health of this slime to any integer value of your choice.\n\nA slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.\n\nDetermine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.\n\nHere S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 18\n\n1 \\leq S_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_{2^N}\n\nOutput\n\nIf it is possible to set the healths of the first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals S, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n4 2 3 1\n\nSample Output 1\n\nYes\n\nWe will show one way to make the multiset of the healths of the slimes that will exist in 2 seconds equal to S.\n\nFirst, set the health of the first slime to 4.\n\nBy letting the first slime spawn a slime whose health is 3, the healths of the slimes that exist in 1 second can be 4,~3.\n\nThen, by letting the first slime spawn a slime whose health is 2, and letting the second slime spawn a slime whose health is 1, the healths of the slimes that exist in 2 seconds can be 4,~3,~2,~1, which is equal to S as multisets.\n\nSample Input 2\n\n2\n1 2 3 1\n\nSample Output 2\n\nYes\n\nS may contain multiple instances of the same integer.\n\nSample Input 3\n\n1\n1 1\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n5\n4 3 5 3 1 2 7 8 7 4 6 3 7 2 3 6 2 7 3 2 6 7 3 4 6 7 3 4 2 5 2 3\n\nSample Output 4\n\nNo", "sample_input": "2\n4 2 3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02920", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have one slime.\n\nYou can set the health of this slime to any integer value of your choice.\n\nA slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.\n\nDetermine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.\n\nHere S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 18\n\n1 \\leq S_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_{2^N}\n\nOutput\n\nIf it is possible to set the healths of the first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals S, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n4 2 3 1\n\nSample Output 1\n\nYes\n\nWe will show one way to make the multiset of the healths of the slimes that will exist in 2 seconds equal to S.\n\nFirst, set the health of the first slime to 4.\n\nBy letting the first slime spawn a slime whose health is 3, the healths of the slimes that exist in 1 second can be 4,~3.\n\nThen, by letting the first slime spawn a slime whose health is 2, and letting the second slime spawn a slime whose health is 1, the healths of the slimes that exist in 2 seconds can be 4,~3,~2,~1, which is equal to S as multisets.\n\nSample Input 2\n\n2\n1 2 3 1\n\nSample Output 2\n\nYes\n\nS may contain multiple instances of the same integer.\n\nSample Input 3\n\n1\n1 1\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n5\n4 3 5 3 1 2 7 8 7 4 6 3 7 2 3 6 2 7 3 2 6 7 3 4 6 7 3 4 2 5 2 3\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1199, "cpu_time_ms": 170, "memory_kb": 15104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s349784933", "group_id": "codeNet:p02921", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t []byte\n\tfmt.Scan(&s, &t)\n\tvar count int\n\tfor i := 0; i < 3; i++ {\n\t\tif s[i] == t[i] {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1584912805, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02921.html", "problem_id": "p02921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02921/input.txt", "sample_output_relpath": "derived/input_output/data/p02921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02921/Go/s349784933.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s349784933", "user_id": "u717943620"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t []byte\n\tfmt.Scan(&s, &t)\n\tvar count int\n\tfor i := 0; i < 3; i++ {\n\t\tif s[i] == t[i] {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "sample_input": "CSS\nCSR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02921", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 177, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s342199670", "group_id": "codeNet:p02921", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t//\"math\"\n)\n\nfunc main() {\n\tvar s1 string\n\tfmt.Scanf(\"%s\", &s1)\n\tvar s2 string\n\tfmt.Scanf(\"%s\", &s2)\n\tc := 0 \n\tfor i:=0;i<3;i++{\n\t\tif s1[i] == s2[i]{\n\t\t\tc++\n\t\t}\n\t}\n\tprint(c)\n}", "language": "Go", "metadata": {"date": 1569433803, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02921.html", "problem_id": "p02921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02921/input.txt", "sample_output_relpath": "derived/input_output/data/p02921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02921/Go/s342199670.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s342199670", "user_id": "u625741705"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t//\"math\"\n)\n\nfunc main() {\n\tvar s1 string\n\tfmt.Scanf(\"%s\", &s1)\n\tvar s2 string\n\tfmt.Scanf(\"%s\", &s2)\n\tc := 0 \n\tfor i:=0;i<3;i++{\n\t\tif s1[i] == s2[i]{\n\t\t\tc++\n\t\t}\n\t}\n\tprint(c)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "sample_input": "CSS\nCSR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02921", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 205, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s018045325", "group_id": "codeNet:p02921", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tS, _ := reader.ReadString('\\n')\n\tT, _ := reader.ReadString('\\n')\n\tvar n int\n\tfor i:=0;i<3;i++ {\n\t\tif S[i] == T[i] {\n\t\t\tn++\n\t\t}\n\t}\n\tfmt.Println(n)\n}", "language": "Go", "metadata": {"date": 1567604859, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02921.html", "problem_id": "p02921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02921/input.txt", "sample_output_relpath": "derived/input_output/data/p02921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02921/Go/s018045325.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s018045325", "user_id": "u050145896"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tS, _ := reader.ReadString('\\n')\n\tT, _ := reader.ReadString('\\n')\n\tvar n int\n\tfor i:=0;i<3;i++ {\n\t\tif S[i] == T[i] {\n\t\t\tn++\n\t\t}\n\t}\n\tfmt.Println(n)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "sample_input": "CSS\nCSR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02921", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 247, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s788969624", "group_id": "codeNet:p02921", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tvar cnt int\n\tfor i := 0; i < 3; i++ {\n\t\tstr1 := s[i : i+1]\n\t\tstr2 := t[i : i+1]\n\n\t\tif str1 == str2 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1567364651, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02921.html", "problem_id": "p02921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02921/input.txt", "sample_output_relpath": "derived/input_output/data/p02921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02921/Go/s788969624.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s788969624", "user_id": "u550296200"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tvar cnt int\n\tfor i := 0; i < 3; i++ {\n\t\tstr1 := s[i : i+1]\n\t\tstr2 := t[i : i+1]\n\n\t\tif str1 == str2 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "sample_input": "CSS\nCSR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02921", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 217, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s879701984", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tfmt.Println(solve(a, b))\n}\n\nfunc solve(a, b int) int {\n\tif (b-1)%(a-1) == 0 {\n\t\treturn (b - 1) / (a - 1)\n\t} else {\n\t\treturn (b-1)/(a-1) + 1\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598782745, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/Go/s879701984.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s879701984", "user_id": "u090225501"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tfmt.Println(solve(a, b))\n}\n\nfunc solve(a, b int) int {\n\tif (b-1)%(a-1) == 0 {\n\t\treturn (b - 1) / (a - 1)\n\t} else {\n\t\treturn (b-1)/(a-1) + 1\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 232, "cpu_time_ms": 6, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s839930753", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tA := getInt()\n\tB := getInt()\n\n\tnum := 1\n\tcnt := 0\n\tfor ; num < B; {\n\t\tnum += A\n\t\tnum--\n\t\tcnt++\n\t}\n\n\tfmt.Println(cnt)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1585416452, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/Go/s839930753.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s839930753", "user_id": "u964273035"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tA := getInt()\n\tB := getInt()\n\n\tnum := 1\n\tcnt := 0\n\tfor ; num < B; {\n\t\tnum += A\n\t\tnum--\n\t\tcnt++\n\t}\n\n\tfmt.Println(cnt)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2604, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s569114581", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\n\tif b > a {\n\t\tfmt.Println(0)\n\t}\n\tfmt.Println(math.Ceil(b / a))\n}\n", "language": "Go", "metadata": {"date": 1575362359, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/Go/s569114581.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s569114581", "user_id": "u380695762"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\n\tif b > a {\n\t\tfmt.Println(0)\n\t}\n\tfmt.Println(math.Ceil(b / a))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 157, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s401493670", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tcurrentTap := 1\n\ttapCount := 0\n\tfor {\n\t\tif b == 1 {\n\t\t\tbreak\n\t\t}\n\t\tcurrentTap = currentTap - 1 + a\n\t\ttapCount++\n\t\tif currentTap >= b {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(tapCount)\n\n}\n", "language": "Go", "metadata": {"date": 1567366298, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/Go/s401493670.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s401493670", "user_id": "u950580836"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tcurrentTap := 1\n\ttapCount := 0\n\tfor {\n\t\tif b == 1 {\n\t\t\tbreak\n\t\t}\n\t\tcurrentTap = currentTap - 1 + a\n\t\ttapCount++\n\t\tif currentTap >= b {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(tapCount)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 269, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s905844706", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype MyScanner struct {\n\tsc *bufio.Scanner\n}\n\ntype MyWriter struct {\n\tstdout io.Writer\n}\n\ntype MyPut interface{}\n\nfunc getScanner(fp io.Reader) *bufio.Scanner {\n\tsc := bufio.NewScanner(fp)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 500001), 500000)\n\treturn sc\n}\n\nfunc getHugeScanner(fp io.Reader, size int) *bufio.Scanner {\n\tsc := bufio.NewScanner(fp)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, size), size)\n\treturn sc\n}\n\nfunc (mysc *MyScanner)String() string {\n\tmysc.sc.Scan()\n\treturn mysc.sc.Text()\n}\n\nfunc (mysc *MyScanner)Int() int {\n\ti, _ := strconv.Atoi(mysc.String())\n\treturn i\n}\n\nfunc (mysc *MyScanner)Int64() int64 {\n\ti, _ := strconv.ParseInt(mysc.String(), 10, 64)\n\treturn i\n}\n\nfunc (mysc *MyScanner)Float64() float64 {\n\ti, _ := strconv.ParseFloat(mysc.String(), 64)\n\treturn i\n}\n\nfunc (mw MyWriter)Puts(v MyPut) {\n\t_, _ = fmt.Fprintf(mw.stdout, \"%v\\n\", v)\n}\n\nfunc Solve(stdin io.Reader, stdout io.Writer) {\n\tsc := MyScanner{getScanner(stdin)}\n\tmw := MyWriter{stdout}\n\n\ta := sc.Int()\n\tb := sc.Int()\n\n\tnum := 1\n\tans := 0\n\n\tfor b > num {\n\t\tans++\n\t\tnum += a - 1\n\t}\n\n\tmw.Puts(ans)\n}\n\nfunc main() {\n\tSolve(os.Stdin, os.Stdout)\n\treturn\n}", "language": "Go", "metadata": {"date": 1567364814, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/Go/s905844706.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s905844706", "user_id": "u212486902"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype MyScanner struct {\n\tsc *bufio.Scanner\n}\n\ntype MyWriter struct {\n\tstdout io.Writer\n}\n\ntype MyPut interface{}\n\nfunc getScanner(fp io.Reader) *bufio.Scanner {\n\tsc := bufio.NewScanner(fp)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 500001), 500000)\n\treturn sc\n}\n\nfunc getHugeScanner(fp io.Reader, size int) *bufio.Scanner {\n\tsc := bufio.NewScanner(fp)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, size), size)\n\treturn sc\n}\n\nfunc (mysc *MyScanner)String() string {\n\tmysc.sc.Scan()\n\treturn mysc.sc.Text()\n}\n\nfunc (mysc *MyScanner)Int() int {\n\ti, _ := strconv.Atoi(mysc.String())\n\treturn i\n}\n\nfunc (mysc *MyScanner)Int64() int64 {\n\ti, _ := strconv.ParseInt(mysc.String(), 10, 64)\n\treturn i\n}\n\nfunc (mysc *MyScanner)Float64() float64 {\n\ti, _ := strconv.ParseFloat(mysc.String(), 64)\n\treturn i\n}\n\nfunc (mw MyWriter)Puts(v MyPut) {\n\t_, _ = fmt.Fprintf(mw.stdout, \"%v\\n\", v)\n}\n\nfunc Solve(stdin io.Reader, stdout io.Writer) {\n\tsc := MyScanner{getScanner(stdin)}\n\tmw := MyWriter{stdout}\n\n\ta := sc.Int()\n\tb := sc.Int()\n\n\tnum := 1\n\tans := 0\n\n\tfor b > num {\n\t\tans++\n\t\tnum += a - 1\n\t}\n\n\tmw.Puts(ans)\n}\n\nfunc main() {\n\tSolve(os.Stdin, os.Stdout)\n\treturn\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1221, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s450505334", "group_id": "codeNet:p02923", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\t// sc.Scan()\n\t// fmt.Println(n, sc.Text())\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\t// fmt.Scan(&h[i])\n\t\tsc.Scan()\n\t\th[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tvar cnt int\n\tvar ans int\n\tfor i := 0; i < n-1; i++ {\n\t\tif h[i] >= h[i+1] {\n\t\t\tcnt++\n\t\t\tans = max(cnt, ans)\n\t\t} else {\n\t\t\tcnt = 0\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n", "language": "Go", "metadata": {"date": 1572356591, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/Go/s450505334.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s450505334", "user_id": "u696272993"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\t// sc.Scan()\n\t// fmt.Println(n, sc.Text())\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\t// fmt.Scan(&h[i])\n\t\tsc.Scan()\n\t\th[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tvar cnt int\n\tvar ans int\n\tfor i := 0; i < n-1; i++ {\n\t\tif h[i] >= h[i+1] {\n\t\t\tcnt++\n\t\t\tans = max(cnt, ans)\n\t\t} else {\n\t\t\tcnt = 0\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 613, "cpu_time_ms": 28, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s918819985", "group_id": "codeNet:p02923", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// main is...\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tvar list = make([]string, n)\n\t// var listInt = make([]int64, n)\n\tvar listInt = make([]int, n)\n\n\tif sc.Scan() {\n\t\tlist = strings.Fields(sc.Text())\n\t}\n\n\tfor idx, value := range list {\n\t\tvalueInt, _ := strconv.Atoi(value)\n\t\t// valueInt, _ := strconv.ParseInt(value, 10, 64)\n\t\tlistInt[idx] = valueInt\n\t}\n\n\tmax, tmp := 0, 0\n\t// for i := n - 1; i > 0; i-- {\n\t// \tif listInt[i-1] >= listInt[i] {\n\t// \t\ttmp++\n\t// \t} else {\n\t// \t\ttmp = 0\n\t// \t}\n\n\t// \tif tmp > max {\n\t// \t\tmax = tmp\n\t// \t}\n\t// }\n\tfor i := 1; i < n; i++ {\n\t\tif listInt[i-1] >= listInt[i] {\n\t\t\ttmp++\n\t\t} else {\n\t\t\ttmp = 0\n\t\t}\n\n\t\tif tmp > max {\n\t\t\tmax = tmp\n\t\t}\n\t}\n\tfmt.Println(max)\n\n}", "language": "Go", "metadata": {"date": 1567374543, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/Go/s918819985.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s918819985", "user_id": "u618957182"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// main is...\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tvar list = make([]string, n)\n\t// var listInt = make([]int64, n)\n\tvar listInt = make([]int, n)\n\n\tif sc.Scan() {\n\t\tlist = strings.Fields(sc.Text())\n\t}\n\n\tfor idx, value := range list {\n\t\tvalueInt, _ := strconv.Atoi(value)\n\t\t// valueInt, _ := strconv.ParseInt(value, 10, 64)\n\t\tlistInt[idx] = valueInt\n\t}\n\n\tmax, tmp := 0, 0\n\t// for i := n - 1; i > 0; i-- {\n\t// \tif listInt[i-1] >= listInt[i] {\n\t// \t\ttmp++\n\t// \t} else {\n\t// \t\ttmp = 0\n\t// \t}\n\n\t// \tif tmp > max {\n\t// \t\tmax = tmp\n\t// \t}\n\t// }\n\tfor i := 1; i < n; i++ {\n\t\tif listInt[i-1] >= listInt[i] {\n\t\t\ttmp++\n\t\t} else {\n\t\t\ttmp = 0\n\t\t}\n\n\t\tif tmp > max {\n\t\t\tmax = tmp\n\t\t}\n\t}\n\tfmt.Println(max)\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 803, "cpu_time_ms": 15, "memory_kb": 4352}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s913075272", "group_id": "codeNet:p02923", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n hs := make([]int, n)\n for i := range hs {\n fmt.Scan(&hs[i])\n }\n var ph, cnt, max int\n for i := range hs {\n if hs[i] <= ph {\n cnt++\n if cnt > max {\n max = cnt\n }\n } else {\n cnt = 0\n }\n ph = hs[i]\n }\n fmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1567365181, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/Go/s913075272.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s913075272", "user_id": "u282164747"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n hs := make([]int, n)\n for i := range hs {\n fmt.Scan(&hs[i])\n }\n var ph, cnt, max int\n for i := range hs {\n if hs[i] <= ph {\n cnt++\n if cnt > max {\n max = cnt\n }\n } else {\n cnt = 0\n }\n ph = hs[i]\n }\n fmt.Println(max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 415, "cpu_time_ms": 707, "memory_kb": 6144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s319166878", "group_id": "codeNet:p02924", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsum := 0\n\tfor i := 0; i < n - 1; i++ {\n\t\tsum = sum + i + 1\n\t}\n\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1592069743, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02924.html", "problem_id": "p02924", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02924/input.txt", "sample_output_relpath": "derived/input_output/data/p02924/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02924/Go/s319166878.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s319166878", "user_id": "u769765274"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsum := 0\n\tfor i := 0; i < n - 1; i++ {\n\t\tsum = sum + i + 1\n\t}\n\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "sample_input": "2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02924", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 152, "cpu_time_ms": 651, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s293284840", "group_id": "codeNet:p02924", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc139/tasks/abc139_d\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallerst(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc max(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max requires at least one argument\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc min(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min requires at least one argument\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc sum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc fill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc calcMod(n int) int { return n % mod }\nfunc sigma(x int) int { return x * (x + 1) / 2 }\nfunc powInt(a, b int) int { return int(math.Pow(float64(a), float64(b))) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriter(os.Stdout)\n)\n\nfunc init() {}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc debug(a ...interface{}) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(os.Stderr, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\tn := ri()\n\tpln(sigma(n - 1))\n}\n", "language": "Go", "metadata": {"date": 1567366911, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02924.html", "problem_id": "p02924", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02924/input.txt", "sample_output_relpath": "derived/input_output/data/p02924/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02924/Go/s293284840.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s293284840", "user_id": "u554269352"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc139/tasks/abc139_d\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallerst(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc max(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max requires at least one argument\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc min(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min requires at least one argument\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc sum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc fill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc calcMod(n int) int { return n % mod }\nfunc sigma(x int) int { return x * (x + 1) / 2 }\nfunc powInt(a, b int) int { return int(math.Pow(float64(a), float64(b))) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriter(os.Stdout)\n)\n\nfunc init() {}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc debug(a ...interface{}) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(os.Stderr, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\tn := ri()\n\tpln(sigma(n - 1))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "sample_input": "2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02924", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3109, "cpu_time_ms": 16, "memory_kb": 2944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s285027672", "group_id": "codeNet:p02934", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tret := 0.0\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tret += 1 / float64(a)\n\t}\n\n\tfmt.Println(1 / ret)\n}\n", "language": "Go", "metadata": {"date": 1567192323, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02934.html", "problem_id": "p02934", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02934/input.txt", "sample_output_relpath": "derived/input_output/data/p02934/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02934/Go/s285027672.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s285027672", "user_id": "u017421706"}, "prompt_components": {"gold_output": "7.5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tret := 0.0\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tret += 1 / float64(a)\n\t}\n\n\tfmt.Println(1 / ret)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a sequence of N integers A_1, \\ldots, A_N.\n\nFind the (multiplicative) inverse of the sum of the inverses of these numbers, \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the value of \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10 30\n\nSample Output 1\n\n7.5\n\n\\frac{1}{\\frac{1}{10} + \\frac{1}{30}} = \\frac{1}{\\frac{4}{30}} = \\frac{30}{4} = 7.5.\n\nPrinting 7.50001, 7.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n200 200 200\n\nSample Output 2\n\n66.66666666666667\n\n\\frac{1}{\\frac{1}{200} + \\frac{1}{200} + \\frac{1}{200}} = \\frac{1}{\\frac{3}{200}} = \\frac{200}{3} = 66.6666....\n\nPrinting 6.66666e+1 and so on will also be accepted.\n\nSample Input 3\n\n1\n1000\n\nSample Output 3\n\n1000\n\n\\frac{1}{\\frac{1}{1000}} = 1000.\n\nPrinting +1000.0 and so on will also be accepted.", "sample_input": "2\n10 30\n"}, "reference_outputs": ["7.5\n"], "source_document_id": "p02934", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a sequence of N integers A_1, \\ldots, A_N.\n\nFind the (multiplicative) inverse of the sum of the inverses of these numbers, \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the value of \\frac{1}{\\frac{1}{A_1} + \\ldots + \\frac{1}{A_N}}.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10 30\n\nSample Output 1\n\n7.5\n\n\\frac{1}{\\frac{1}{10} + \\frac{1}{30}} = \\frac{1}{\\frac{4}{30}} = \\frac{30}{4} = 7.5.\n\nPrinting 7.50001, 7.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n200 200 200\n\nSample Output 2\n\n66.66666666666667\n\n\\frac{1}{\\frac{1}{200} + \\frac{1}{200} + \\frac{1}{200}} = \\frac{1}{\\frac{3}{200}} = \\frac{200}{3} = 66.6666....\n\nPrinting 6.66666e+1 and so on will also be accepted.\n\nSample Input 3\n\n1\n1000\n\nSample Output 3\n\n1000\n\n\\frac{1}{\\frac{1}{1000}} = 1000.\n\nPrinting +1000.0 and so on will also be accepted.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s399831776", "group_id": "codeNet:p02935", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 1000000007\n\n// 1MB\nconst ioBufferSize = 1 * 1024 * 1024\n\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tn := nextInt()\n\tv := make([]float64, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tv[i] = float64(nextInt())\n\t}\n\n\tfor len(v) > 1 {\n\t\tsort.Float64s(v)\n\t\ts := (v[0] + v[1]) / 2\n\t\tv = v[2:]\n\t\tv = append(v, s)\n\t}\n\n\tfmt.Println(v[0])\n}\n", "language": "Go", "metadata": {"date": 1591416098, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02935/input.txt", "sample_output_relpath": "derived/input_output/data/p02935/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02935/Go/s399831776.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s399831776", "user_id": "u703739962"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 1000000007\n\n// 1MB\nconst ioBufferSize = 1 * 1024 * 1024\n\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tn := nextInt()\n\tv := make([]float64, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tv[i] = float64(nextInt())\n\t}\n\n\tfor len(v) > 1 {\n\t\tsort.Float64s(v)\n\t\ts := (v[0] + v[1]) / 2\n\t\tv = v[2:]\n\t\tv = append(v, s)\n\t}\n\n\tfmt.Println(v[0])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "sample_input": "2\n3 4\n"}, "reference_outputs": ["3.5\n"], "source_document_id": "p02935", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 691, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s073680101", "group_id": "codeNet:p02935", "input_text": "package main\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar(\n\tsc = bufio.NewScanner(os.Stdin)\n\tstdin = bufio.NewReader(os.Stdin)\n\tmod = 1000000007\n\tmod9 = 1000000009\n)\n\nfunc init() {\n\trand.Seed(time.Now().UnixNano())\n\tbuf := make([]byte, 0) //ここのサイズは何でもよさそう\n\tsc.Buffer(buf, 1000000009)\n}\n\n\n//||||||||||||||||||||||||||入力|||||||||||||||||||||||||||||||||||||||\\\n//数字一文字入力\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n//文字列を一行入力\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n//空白区切りの文字列の入力\nfunc spaceLine() []string {\n\tsc.Scan()\n\treturn strings.Split(sc.Text(),\" \")\n}\n\n//数字を一行入力\nfunc intLine() []int {\n\tstr := spaceLine()\n\tbuf := make([]int,len(str))\n\tfor i,s:=range str{\n\t\tbuf[i],_ = strconv.Atoi(s)\n\t}\n\treturn buf\n}\n\n//次のスペースか改行まで読み込む\nfunc gostring() string {\n\tbyte_ls := make([]byte,0)\n\tcheck := false\n\tfor {\n\t\tb, _ := stdin.ReadByte()\n\t\tif b == 32 || (check == true && b == 10){\n\t\t\treturn string(byte_ls)\n\t\t} else if b == 13 {\n\t\t\tcheck = true\n\t\t} else {\n\t\t\tbyte_ls = append(byte_ls,b)\n\t\t}\n\t}\n}\n\n//上の関数のintバージョン\nfunc goint() int {\n\tn,_ := strconv.Atoi(gostring())\n\treturn n\n}\n\n//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n//ソートする\n//sは最初のインデックス fは最後のインデックス\nfunc Sort(ls []int,l int,r int) {\n\tif r - l <= 0{return}\n\tpipot := l + rand.Intn(r-l+1)\n\tls[r],ls[pipot] = ls[pipot],ls[r]\n\ti := l\n\tfor j:=l;j b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\n//二次元配列のソート\nfunc Sort2D(ls [][]int,l int,r int,index ...int) {\n\tif r - l <= 0{return}\n\tpipot := l + rand.Intn(r-l+1)\n\tls[r],ls[pipot] = ls[pipot],ls[r]\n\ti := l\n\tfor j:=l;j a[i]{\n\t\t\tans = a[i]\n\t\t}\n\t}\n\treturn ans\n}", "language": "Go", "metadata": {"date": 1566314786, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02935/input.txt", "sample_output_relpath": "derived/input_output/data/p02935/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02935/Go/s073680101.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s073680101", "user_id": "u924406834"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar(\n\tsc = bufio.NewScanner(os.Stdin)\n\tstdin = bufio.NewReader(os.Stdin)\n\tmod = 1000000007\n\tmod9 = 1000000009\n)\n\nfunc init() {\n\trand.Seed(time.Now().UnixNano())\n\tbuf := make([]byte, 0) //ここのサイズは何でもよさそう\n\tsc.Buffer(buf, 1000000009)\n}\n\n\n//||||||||||||||||||||||||||入力|||||||||||||||||||||||||||||||||||||||\\\n//数字一文字入力\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n//文字列を一行入力\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n//空白区切りの文字列の入力\nfunc spaceLine() []string {\n\tsc.Scan()\n\treturn strings.Split(sc.Text(),\" \")\n}\n\n//数字を一行入力\nfunc intLine() []int {\n\tstr := spaceLine()\n\tbuf := make([]int,len(str))\n\tfor i,s:=range str{\n\t\tbuf[i],_ = strconv.Atoi(s)\n\t}\n\treturn buf\n}\n\n//次のスペースか改行まで読み込む\nfunc gostring() string {\n\tbyte_ls := make([]byte,0)\n\tcheck := false\n\tfor {\n\t\tb, _ := stdin.ReadByte()\n\t\tif b == 32 || (check == true && b == 10){\n\t\t\treturn string(byte_ls)\n\t\t} else if b == 13 {\n\t\t\tcheck = true\n\t\t} else {\n\t\t\tbyte_ls = append(byte_ls,b)\n\t\t}\n\t}\n}\n\n//上の関数のintバージョン\nfunc goint() int {\n\tn,_ := strconv.Atoi(gostring())\n\treturn n\n}\n\n//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n\n//ソートする\n//sは最初のインデックス fは最後のインデックス\nfunc Sort(ls []int,l int,r int) {\n\tif r - l <= 0{return}\n\tpipot := l + rand.Intn(r-l+1)\n\tls[r],ls[pipot] = ls[pipot],ls[r]\n\ti := l\n\tfor j:=l;j b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\n//二次元配列のソート\nfunc Sort2D(ls [][]int,l int,r int,index ...int) {\n\tif r - l <= 0{return}\n\tpipot := l + rand.Intn(r-l+1)\n\tls[r],ls[pipot] = ls[pipot],ls[r]\n\ti := l\n\tfor j:=l;j a[i]{\n\t\t\tans = a[i]\n\t\t}\n\t}\n\treturn ans\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "sample_input": "2\n3 4\n"}, "reference_outputs": ["3.5\n"], "source_document_id": "p02935", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2711, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s756458060", "group_id": "codeNet:p02935", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := readInt()\n\tvalues := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tvalues[i] = float64(readInt())\n\t}\n\tfmt.Println(solve(values))\n}\n\nfunc solve(values []float64) float64 {\n\tx := values[0]\n\ty := values[1]\n\tif len(values) == 2 {\n\t\treturn pot(x, y)\n\t}\n\tfor len(values) > 1 {\n\t\t// 最小値を2つ選ぶ\n\t\tminIndex1, min1 := min(values)\n\t\tvalues = remove(values, minIndex1)\n\t\tminIndex2, min2 := min(values)\n\t\tvalues = remove(values, minIndex2)\n\t\t// 鍋に入れた結果を戻す\n\t\tnewValue := pot(min1, min2)\n\t\tvalues = append(values, newValue)\n\t}\n\treturn values[0]\n}\n\nfunc pot(x, y float64) float64 {\n\treturn (x + y) / 2\n}\n\n// スライス内の最小値を取得する\nfunc min(nums []float64) (index int, min float64) {\n\tmin = math.MaxFloat64\n\tfor i, n := range nums {\n\t\tif n < min {\n\t\t\tindex = i\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn\n}\n\n// ある要素を削除したスライスを返す\nfunc remove(nums []float64, i int) []float64 {\n\treturn append(nums[:i], nums[i+1:]...)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt() int {\n\ti, e := strconv.Atoi(read())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1566180035, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02935/input.txt", "sample_output_relpath": "derived/input_output/data/p02935/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02935/Go/s756458060.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s756458060", "user_id": "u985732221"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := readInt()\n\tvalues := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tvalues[i] = float64(readInt())\n\t}\n\tfmt.Println(solve(values))\n}\n\nfunc solve(values []float64) float64 {\n\tx := values[0]\n\ty := values[1]\n\tif len(values) == 2 {\n\t\treturn pot(x, y)\n\t}\n\tfor len(values) > 1 {\n\t\t// 最小値を2つ選ぶ\n\t\tminIndex1, min1 := min(values)\n\t\tvalues = remove(values, minIndex1)\n\t\tminIndex2, min2 := min(values)\n\t\tvalues = remove(values, minIndex2)\n\t\t// 鍋に入れた結果を戻す\n\t\tnewValue := pot(min1, min2)\n\t\tvalues = append(values, newValue)\n\t}\n\treturn values[0]\n}\n\nfunc pot(x, y float64) float64 {\n\treturn (x + y) / 2\n}\n\n// スライス内の最小値を取得する\nfunc min(nums []float64) (index int, min float64) {\n\tmin = math.MaxFloat64\n\tfor i, n := range nums {\n\t\tif n < min {\n\t\t\tindex = i\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn\n}\n\n// ある要素を削除したスライスを返す\nfunc remove(nums []float64, i int) []float64 {\n\treturn append(nums[:i], nums[i+1:]...)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt() int {\n\ti, e := strconv.Atoi(read())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "sample_input": "2\n3 4\n"}, "reference_outputs": ["3.5\n"], "source_document_id": "p02935", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1266, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s139878774", "group_id": "codeNet:p02937", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := rdr.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}\n\nfunc lowerBound(a []int, x int) int {\n n := len(a)\n ok := n\n ng := -1\n for ok-ng > 1 {\n mid := (ok + ng) / 2\n if a[mid] >= x {\n ok = mid\n } else {\n ng = mid\n }\n }\n return ok\n}\n\nfunc main() {\n var s string\n var t string\n\n s = readLine()\n t = readLine()\n\n idxs := make([][]int, 256)\n\n for i := 0; i < len(s); i++ {\n idxs[s[i]] = append(idxs[s[i]], i)\n }\n\n n := int64(len(s))\n cur := int64(0)\n ng := false\n\n for i := 0; i < len(t); i++ {\n is := idxs[t[i]]\n if is == nil || len(is) == 0 {\n ng = true\n break\n }\n base := (cur / n) * n\n\n nidx := lowerBound(is, int(cur%n))\n if nidx == len(is) {\n cur = base + int64(is[0]) + n + 1\n } else {\n cur = base + int64(is[nidx]) + 1\n }\n }\n if ng {\n fmt.Println(-1)\n } else {\n fmt.Println(cur)\n }\n}", "language": "Go", "metadata": {"date": 1567736586, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02937.html", "problem_id": "p02937", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02937/input.txt", "sample_output_relpath": "derived/input_output/data/p02937/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02937/Go/s139878774.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s139878774", "user_id": "u813098295"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := rdr.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}\n\nfunc lowerBound(a []int, x int) int {\n n := len(a)\n ok := n\n ng := -1\n for ok-ng > 1 {\n mid := (ok + ng) / 2\n if a[mid] >= x {\n ok = mid\n } else {\n ng = mid\n }\n }\n return ok\n}\n\nfunc main() {\n var s string\n var t string\n\n s = readLine()\n t = readLine()\n\n idxs := make([][]int, 256)\n\n for i := 0; i < len(s); i++ {\n idxs[s[i]] = append(idxs[s[i]], i)\n }\n\n n := int64(len(s))\n cur := int64(0)\n ng := false\n\n for i := 0; i < len(t); i++ {\n is := idxs[t[i]]\n if is == nil || len(is) == 0 {\n ng = true\n break\n }\n base := (cur / n) * n\n\n nidx := lowerBound(is, int(cur%n))\n if nidx == len(is) {\n cur = base + int64(is[0]) + n + 1\n } else {\n cur = base + int64(is[nidx]) + 1\n }\n }\n if ng {\n fmt.Println(-1)\n } else {\n fmt.Println(cur)\n }\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if there exists an integer i satisfying the following condition, and find the minimum such i if it exists.\n\nLet s' be the concatenation of 10^{100} copies of s. t is a subsequence of the string {s'}_1{s'}_2\\ldots{s'}_i (the first i characters in s').\n\nNotes\n\nA subsequence of a string a is a string obtained by deleting zero or more characters from a and concatenating the remaining characters without changing the relative order. For example, the subsequences of contest include net, c, and contest.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\n\n1 \\leq |t| \\leq 10^5\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf there exists an integer i satisfying the following condition, print the minimum such i; otherwise, print -1.\n\nSample Input 1\n\ncontest\nson\n\nSample Output 1\n\n10\n\nt = son is a subsequence of the string contestcon (the first 10 characters in s' = contestcontestcontest...), so i = 10 satisfies the condition.\n\nOn the other hand, t is not a subsequence of the string contestco (the first 9 characters in s'), so i = 9 does not satisfy the condition.\n\nSimilarly, any integer less than 9 does not satisfy the condition, either. Thus, the minimum integer i satisfying the condition is 10.\n\nSample Input 2\n\ncontest\nprogramming\n\nSample Output 2\n\n-1\n\nt = programming is not a substring of s' = contestcontestcontest.... Thus, there is no integer i satisfying the condition.\n\nSample Input 3\n\ncontest\nsentence\n\nSample Output 3\n\n33\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "contest\nson\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02937", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if there exists an integer i satisfying the following condition, and find the minimum such i if it exists.\n\nLet s' be the concatenation of 10^{100} copies of s. t is a subsequence of the string {s'}_1{s'}_2\\ldots{s'}_i (the first i characters in s').\n\nNotes\n\nA subsequence of a string a is a string obtained by deleting zero or more characters from a and concatenating the remaining characters without changing the relative order. For example, the subsequences of contest include net, c, and contest.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\n\n1 \\leq |t| \\leq 10^5\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf there exists an integer i satisfying the following condition, print the minimum such i; otherwise, print -1.\n\nSample Input 1\n\ncontest\nson\n\nSample Output 1\n\n10\n\nt = son is a subsequence of the string contestcon (the first 10 characters in s' = contestcontestcontest...), so i = 10 satisfies the condition.\n\nOn the other hand, t is not a subsequence of the string contestco (the first 9 characters in s'), so i = 9 does not satisfy the condition.\n\nSimilarly, any integer less than 9 does not satisfy the condition, either. Thus, the minimum integer i satisfying the condition is 10.\n\nSample Input 2\n\ncontest\nprogramming\n\nSample Output 2\n\n-1\n\nt = programming is not a substring of s' = contestcontestcontest.... Thus, there is no integer i satisfying the condition.\n\nSample Input 3\n\ncontest\nsentence\n\nSample Output 3\n\n33\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1714, "cpu_time_ms": 21, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s813774195", "group_id": "codeNet:p02937", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ts := getNextString(scanner)\n\tt := getNextString(scanner)\n\n\tvar indexes [26][]int\n\tvar ll [26]int\n\n\tfor i := 0; i < 26; i++ {\n\t\tindexes[i] = make([]int, 0)\n\t}\n\n\tn := len(s)\n\tfor i := 0; i < n; i++ {\n\t\tindexes[s[i]-'a'] = append(indexes[s[i]-'a'], i)\n\t}\n\tfor i := 0; i < 26; i++ {\n\t\tll[i] = len(indexes[i])\n\t}\n\n\ttn := len(t)\n\tnow := 0\n\tvar ans int64\n\tfor i := 0; i < tn; i++ {\n\t\tch := int(t[i] - 'a')\n\t\tl := 0\n\t\tr := ll[ch]\n\t\tif r == 0 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t\tfor l < r {\n\t\t\tm := (l + r) >> 1\n\t\t\tif indexes[ch][m] < now {\n\t\t\t\tl = m + 1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tr = m\n\t\t}\n\t\tif l == ll[ch] {\n\t\t\tans += int64(n - now)\n\t\t\tnow = 0\n\t\t\ti--\n\t\t\tcontinue\n\t\t}\n\t\tans += int64(indexes[ch][l] - now + 1)\n\t\tnow = indexes[ch][l] + 1\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1566179547, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02937.html", "problem_id": "p02937", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02937/input.txt", "sample_output_relpath": "derived/input_output/data/p02937/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02937/Go/s813774195.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s813774195", "user_id": "u150542210"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ts := getNextString(scanner)\n\tt := getNextString(scanner)\n\n\tvar indexes [26][]int\n\tvar ll [26]int\n\n\tfor i := 0; i < 26; i++ {\n\t\tindexes[i] = make([]int, 0)\n\t}\n\n\tn := len(s)\n\tfor i := 0; i < n; i++ {\n\t\tindexes[s[i]-'a'] = append(indexes[s[i]-'a'], i)\n\t}\n\tfor i := 0; i < 26; i++ {\n\t\tll[i] = len(indexes[i])\n\t}\n\n\ttn := len(t)\n\tnow := 0\n\tvar ans int64\n\tfor i := 0; i < tn; i++ {\n\t\tch := int(t[i] - 'a')\n\t\tl := 0\n\t\tr := ll[ch]\n\t\tif r == 0 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t\tfor l < r {\n\t\t\tm := (l + r) >> 1\n\t\t\tif indexes[ch][m] < now {\n\t\t\t\tl = m + 1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tr = m\n\t\t}\n\t\tif l == ll[ch] {\n\t\t\tans += int64(n - now)\n\t\t\tnow = 0\n\t\t\ti--\n\t\t\tcontinue\n\t\t}\n\t\tans += int64(indexes[ch][l] - now + 1)\n\t\tnow = indexes[ch][l] + 1\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\n\twriter.Flush()\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if there exists an integer i satisfying the following condition, and find the minimum such i if it exists.\n\nLet s' be the concatenation of 10^{100} copies of s. t is a subsequence of the string {s'}_1{s'}_2\\ldots{s'}_i (the first i characters in s').\n\nNotes\n\nA subsequence of a string a is a string obtained by deleting zero or more characters from a and concatenating the remaining characters without changing the relative order. For example, the subsequences of contest include net, c, and contest.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\n\n1 \\leq |t| \\leq 10^5\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf there exists an integer i satisfying the following condition, print the minimum such i; otherwise, print -1.\n\nSample Input 1\n\ncontest\nson\n\nSample Output 1\n\n10\n\nt = son is a subsequence of the string contestcon (the first 10 characters in s' = contestcontestcontest...), so i = 10 satisfies the condition.\n\nOn the other hand, t is not a subsequence of the string contestco (the first 9 characters in s'), so i = 9 does not satisfy the condition.\n\nSimilarly, any integer less than 9 does not satisfy the condition, either. Thus, the minimum integer i satisfying the condition is 10.\n\nSample Input 2\n\ncontest\nprogramming\n\nSample Output 2\n\n-1\n\nt = programming is not a substring of s' = contestcontestcontest.... Thus, there is no integer i satisfying the condition.\n\nSample Input 3\n\ncontest\nsentence\n\nSample Output 3\n\n33\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "contest\nson\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02937", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if there exists an integer i satisfying the following condition, and find the minimum such i if it exists.\n\nLet s' be the concatenation of 10^{100} copies of s. t is a subsequence of the string {s'}_1{s'}_2\\ldots{s'}_i (the first i characters in s').\n\nNotes\n\nA subsequence of a string a is a string obtained by deleting zero or more characters from a and concatenating the remaining characters without changing the relative order. For example, the subsequences of contest include net, c, and contest.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\n\n1 \\leq |t| \\leq 10^5\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf there exists an integer i satisfying the following condition, print the minimum such i; otherwise, print -1.\n\nSample Input 1\n\ncontest\nson\n\nSample Output 1\n\n10\n\nt = son is a subsequence of the string contestcon (the first 10 characters in s' = contestcontestcontest...), so i = 10 satisfies the condition.\n\nOn the other hand, t is not a subsequence of the string contestco (the first 9 characters in s'), so i = 9 does not satisfy the condition.\n\nSimilarly, any integer less than 9 does not satisfy the condition, either. Thus, the minimum integer i satisfying the condition is 10.\n\nSample Input 2\n\ncontest\nprogramming\n\nSample Output 2\n\n-1\n\nt = programming is not a substring of s' = contestcontestcontest.... Thus, there is no integer i satisfying the condition.\n\nSample Input 3\n\ncontest\nsentence\n\nSample Output 3\n\n33\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1597, "cpu_time_ms": 16, "memory_kb": 5760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s132457953", "group_id": "codeNet:p02939", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextMega()\n\tn := len(s)\n\n\tans := 1\n\tprev := string(s[0])\n\tfor i := 1; i < n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\tif prev != s[i:j] {\n\t\t\t\tprev = s[i:j]\n\t\t\t\tif j-i == 1 {\n\t\t\t\t\ti = j - 1\n\t\t\t\t} else {\n\t\t\t\t\ti = j - 1\n\t\t\t\t}\n\t\t\t\tans++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tputs(ans)\n\twt.Flush()\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\trdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc nextMega() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, _ := rdr.ReadLine()\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "language": "Go", "metadata": {"date": 1579811190, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02939.html", "problem_id": "p02939", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02939/input.txt", "sample_output_relpath": "derived/input_output/data/p02939/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02939/Go/s132457953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s132457953", "user_id": "u502813058"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextMega()\n\tn := len(s)\n\n\tans := 1\n\tprev := string(s[0])\n\tfor i := 1; i < n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\tif prev != s[i:j] {\n\t\t\t\tprev = s[i:j]\n\t\t\t\tif j-i == 1 {\n\t\t\t\t\ti = j - 1\n\t\t\t\t} else {\n\t\t\t\t\ti = j - 1\n\t\t\t\t}\n\t\t\t\tans++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tputs(ans)\n\twt.Flush()\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\trdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc nextMega() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, _ := rdr.ReadLine()\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "sample_input": "aabbaa\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02939", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1274, "cpu_time_ms": 3, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s609838620", "group_id": "codeNet:p02939", "input_text": "package main\n\nimport \"fmt\"\n\nvar s string\n\nfunc main() {\n\tfmt.Scanf(\"%s\", &s)\n\ta := make([]string, len(s))\n\tfor i := range s {\n\t\ta[i] = s[i : i+1]\n\t}\n\tfmt.Println(fix(a))\n}\n\nfunc fix(a []string) int {\n\t// fmt.Printf(\"fix %q\\n\", a)\n\tbest := 0\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tif a[i] == a[i+1] {\n\t\t\tif i-1 > 0 {\n\t\t\t\tn := fix(merge(a, i-1))\n\t\t\t\tif best < n {\n\t\t\t\t\tbest = n\n\t\t\t\t}\n\t\t\t}\n\t\t\tn := fix(merge(a, i))\n\t\t\tif best < n {\n\t\t\t\tbest = n\n\t\t\t}\n\t\t\tif i+1 < len(a)-1 {\n\t\t\t\tn := fix(merge(a, i+1))\n\t\t\t\tif best < n {\n\t\t\t\t\tbest = n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn best\n\t\t}\n\t}\n\n\treturn len(a)\n}\n\nfunc merge(a []string, i int) []string {\n\treturn append(append(append([]string{}, a[:i]...), a[i]+a[i+1]), a[i+2:]...)\n}\n", "language": "Go", "metadata": {"date": 1566094723, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02939.html", "problem_id": "p02939", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02939/input.txt", "sample_output_relpath": "derived/input_output/data/p02939/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02939/Go/s609838620.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s609838620", "user_id": "u764320774"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar s string\n\nfunc main() {\n\tfmt.Scanf(\"%s\", &s)\n\ta := make([]string, len(s))\n\tfor i := range s {\n\t\ta[i] = s[i : i+1]\n\t}\n\tfmt.Println(fix(a))\n}\n\nfunc fix(a []string) int {\n\t// fmt.Printf(\"fix %q\\n\", a)\n\tbest := 0\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tif a[i] == a[i+1] {\n\t\t\tif i-1 > 0 {\n\t\t\t\tn := fix(merge(a, i-1))\n\t\t\t\tif best < n {\n\t\t\t\t\tbest = n\n\t\t\t\t}\n\t\t\t}\n\t\t\tn := fix(merge(a, i))\n\t\t\tif best < n {\n\t\t\t\tbest = n\n\t\t\t}\n\t\t\tif i+1 < len(a)-1 {\n\t\t\t\tn := fix(merge(a, i+1))\n\t\t\t\tif best < n {\n\t\t\t\t\tbest = n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn best\n\t\t}\n\t}\n\n\treturn len(a)\n}\n\nfunc merge(a []string, i int) []string {\n\treturn append(append(append([]string{}, a[:i]...), a[i]+a[i+1]), a[i+2:]...)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "sample_input": "aabbaa\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02939", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 699, "cpu_time_ms": 2126, "memory_kb": 629888}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s847842957", "group_id": "codeNet:p02939", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\nvar ReadLine func() string\nvar ReadInt64 func() int64\nvar ReadInt func() int\nvar ReadIntSlice func(int) []int\nvar ReadInt64Slice func(int) []int64\nvar GetIntAbs func(int) int\nvar Atoi func(string) int\nvar FindMin func([] int) int\nvar FindMax func([] int) int\nvar StrReverse func(string) string\n\nfunc init() {\n\tReadString = newReadString()\n\tReadLine = readLine\n\tReadInt64 = readInt64\n\tReadInt = readInt\n\tReadIntSlice = readIntSlice\n\tFindMin = findMin\n\tFindMax = findMax\n\tStrReverse = strReverse\n\tGetIntAbs = getIntAbs\n}\n\nfunc main() {\n s := ReadString()\n sl := len(s)\n var rs int\n var prev string\n for i := 0; i < sl; i++ {\n v := string(s[i])\n if prev != v {\n rs += 1\n prev = v\n } else if i + 1 < sl {\n t := v\n for k := i + 1; k < sl; k++ {\n if k >= sl {\n break\n }\n t = fmt.Sprintf(\"%s%s\", t, string(s[k]))\n if t != prev {\n rs += 1\n prev = t\n i = k\n break\n }\n }\n\n }\n\n }\n fmt.Println(rs)\n}\n\nfunc strReverse(s string) string {\n\trunes := []rune(s)\n\tl := len(runes)\n\tfor i, j := 0, l-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 202400), 404800)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc readLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc readInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc readIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc readInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc getIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc findMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc findMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n", "language": "Go", "metadata": {"date": 1566092733, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02939.html", "problem_id": "p02939", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02939/input.txt", "sample_output_relpath": "derived/input_output/data/p02939/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02939/Go/s847842957.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s847842957", "user_id": "u657610454"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\nvar ReadLine func() string\nvar ReadInt64 func() int64\nvar ReadInt func() int\nvar ReadIntSlice func(int) []int\nvar ReadInt64Slice func(int) []int64\nvar GetIntAbs func(int) int\nvar Atoi func(string) int\nvar FindMin func([] int) int\nvar FindMax func([] int) int\nvar StrReverse func(string) string\n\nfunc init() {\n\tReadString = newReadString()\n\tReadLine = readLine\n\tReadInt64 = readInt64\n\tReadInt = readInt\n\tReadIntSlice = readIntSlice\n\tFindMin = findMin\n\tFindMax = findMax\n\tStrReverse = strReverse\n\tGetIntAbs = getIntAbs\n}\n\nfunc main() {\n s := ReadString()\n sl := len(s)\n var rs int\n var prev string\n for i := 0; i < sl; i++ {\n v := string(s[i])\n if prev != v {\n rs += 1\n prev = v\n } else if i + 1 < sl {\n t := v\n for k := i + 1; k < sl; k++ {\n if k >= sl {\n break\n }\n t = fmt.Sprintf(\"%s%s\", t, string(s[k]))\n if t != prev {\n rs += 1\n prev = t\n i = k\n break\n }\n }\n\n }\n\n }\n fmt.Println(rs)\n}\n\nfunc strReverse(s string) string {\n\trunes := []rune(s)\n\tl := len(runes)\n\tfor i, j := 0, l-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 202400), 404800)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc readLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc readInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc readIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc readInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc getIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc findMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc findMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "sample_input": "aabbaa\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02939", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2628, "cpu_time_ms": 37, "memory_kb": 4224}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s802736753", "group_id": "codeNet:p02942", "input_text": "// https://atcoder.jp/contests/agc037/tasks/agc037_d\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype BipartiteMatching struct {\n\tedges [][]int\n\tmatch []int\n\tused []bool\n}\n\nfunc (b *BipartiteMatching) init(n int) {\n\tb.edges = make([][]int, n)\n\tb.match = make([]int, n)\n\n\tfor i := range b.match {\n\t\tb.match[i] = -1\n\t}\n}\n\nfunc (b *BipartiteMatching) add(from, to int) {\n\tb.edges[from] = append(b.edges[from], to)\n\tb.edges[to] = append(b.edges[to], from)\n}\n\nfunc (b *BipartiteMatching) dfs(v int) bool {\n\tb.used[v] = true\n\n\tfor _, u := range b.edges[v] {\n\t\tw := b.match[u]\n\t\tif w == -1 || !b.used[w] && b.dfs(w) {\n\t\t\tb.match[u] = v\n\t\t\tb.match[v] = u\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc (b *BipartiteMatching) exec() int {\n\tres := 0\n\n\tfor v := 0; v < len(b.edges); v++ {\n\t\tif b.match[v] == -1 {\n\t\t\tb.used = make([]bool, len(b.edges))\n\n\t\t\tif b.dfs(v) {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn res\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tM := io.NextInt()\n\n\tmat := make([][]int, N)\n\tfor i := range mat {\n\t\tmat[i] = make([]int, M)\n\n\t\tfor j := 0; j < M; j++ {\n\t\t\tmat[i][j] = io.NextInt()\n\t\t}\n\t}\n\n\tfilledA := make([][]bool, N)\n\tfor i := range filledA {\n\t\tfilledA[i] = make([]bool, M)\n\t}\n\n\tmatA := make([][]int, N)\n\tfor i := range matA {\n\t\tmatA[i] = make([]int, M)\n\t}\n\n\tfor i := range mat {\n\t\tbp := BipartiteMatching{}\n\t\tbp.init(M * 2)\n\n\t\tfor j, val := range mat[i] {\n\t\t\trow := (val - 1) / M\n\n\t\t\tfor k := 0; k < M; k++ {\n\t\t\t\tif !filledA[row][k] {\n\t\t\t\t\tbp.add(j, k+M)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbp.exec()\n\n\t\tfor j, val := range mat[i] {\n\t\t\trow := (val - 1) / M\n\t\t\tif bp.match[j] == -1 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tk := bp.match[j] - M\n\n\t\t\tmatA[i][k] = val\n\t\t\tfilledA[row][k] = true\n\t\t}\n\t}\n\n\tfor i := range matA {\n\t\tio.PrintInts(matA[i])\n\t}\n\n\tmatB := make([][]int, N)\n\tfor i := range matB {\n\t\tmatB[i] = make([]int, M)\n\t}\n\n\t// 縦でソートして埋める\n\tfor i := 0; i < M; i++ {\n\t\ttmp := make([]int, N)\n\n\t\tfor j := 0; j < N; j++ {\n\t\t\ttmp[j] = matA[j][i]\n\t\t}\n\n\t\tsort.Ints(tmp)\n\n\t\tfor j := 0; j < N; j++ {\n\t\t\tmatB[j][i] = tmp[j]\n\t\t}\n\t}\n\n\tfor i := range matB {\n\t\tio.PrintInts(matB[i])\n\t}\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "language": "Go", "metadata": {"date": 1566102861, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02942.html", "problem_id": "p02942", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02942/input.txt", "sample_output_relpath": "derived/input_output/data/p02942/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02942/Go/s802736753.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s802736753", "user_id": "u751468134"}, "prompt_components": {"gold_output": "2 6\n4 3\n5 1\n2 1\n4 3\n5 6\n", "input_to_evaluate": "// https://atcoder.jp/contests/agc037/tasks/agc037_d\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype BipartiteMatching struct {\n\tedges [][]int\n\tmatch []int\n\tused []bool\n}\n\nfunc (b *BipartiteMatching) init(n int) {\n\tb.edges = make([][]int, n)\n\tb.match = make([]int, n)\n\n\tfor i := range b.match {\n\t\tb.match[i] = -1\n\t}\n}\n\nfunc (b *BipartiteMatching) add(from, to int) {\n\tb.edges[from] = append(b.edges[from], to)\n\tb.edges[to] = append(b.edges[to], from)\n}\n\nfunc (b *BipartiteMatching) dfs(v int) bool {\n\tb.used[v] = true\n\n\tfor _, u := range b.edges[v] {\n\t\tw := b.match[u]\n\t\tif w == -1 || !b.used[w] && b.dfs(w) {\n\t\t\tb.match[u] = v\n\t\t\tb.match[v] = u\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc (b *BipartiteMatching) exec() int {\n\tres := 0\n\n\tfor v := 0; v < len(b.edges); v++ {\n\t\tif b.match[v] == -1 {\n\t\t\tb.used = make([]bool, len(b.edges))\n\n\t\t\tif b.dfs(v) {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn res\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tM := io.NextInt()\n\n\tmat := make([][]int, N)\n\tfor i := range mat {\n\t\tmat[i] = make([]int, M)\n\n\t\tfor j := 0; j < M; j++ {\n\t\t\tmat[i][j] = io.NextInt()\n\t\t}\n\t}\n\n\tfilledA := make([][]bool, N)\n\tfor i := range filledA {\n\t\tfilledA[i] = make([]bool, M)\n\t}\n\n\tmatA := make([][]int, N)\n\tfor i := range matA {\n\t\tmatA[i] = make([]int, M)\n\t}\n\n\tfor i := range mat {\n\t\tbp := BipartiteMatching{}\n\t\tbp.init(M * 2)\n\n\t\tfor j, val := range mat[i] {\n\t\t\trow := (val - 1) / M\n\n\t\t\tfor k := 0; k < M; k++ {\n\t\t\t\tif !filledA[row][k] {\n\t\t\t\t\tbp.add(j, k+M)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbp.exec()\n\n\t\tfor j, val := range mat[i] {\n\t\t\trow := (val - 1) / M\n\t\t\tif bp.match[j] == -1 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tk := bp.match[j] - M\n\n\t\t\tmatA[i][k] = val\n\t\t\tfilledA[row][k] = true\n\t\t}\n\t}\n\n\tfor i := range matA {\n\t\tio.PrintInts(matA[i])\n\t}\n\n\tmatB := make([][]int, N)\n\tfor i := range matB {\n\t\tmatB[i] = make([]int, M)\n\t}\n\n\t// 縦でソートして埋める\n\tfor i := 0; i < M; i++ {\n\t\ttmp := make([]int, N)\n\n\t\tfor j := 0; j < N; j++ {\n\t\t\ttmp[j] = matA[j][i]\n\t\t}\n\n\t\tsort.Ints(tmp)\n\n\t\tfor j := 0; j < N; j++ {\n\t\t\tmatB[j][i] = tmp[j]\n\t\t}\n\t}\n\n\tfor i := range matB {\n\t\tio.PrintInts(matB[i])\n\t}\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "problem_context": "Score : 1100 points\n\nProblem Statement\n\nWe have a grid with N rows and M columns of squares.\nEach integer from 1 to NM is written in this grid once.\nThe number written in the square at the i-th row from the top and the j-th column from the left is A_{ij}.\n\nYou need to rearrange these numbers as follows:\n\nFirst, for each of the N rows, rearrange the numbers written in it as you like.\n\nSecond, for each of the M columns, rearrange the numbers written in it as you like.\n\nFinally, for each of the N rows, rearrange the numbers written in it as you like.\n\nAfter rearranging the numbers, you want the number written in the square at the i-th row from the top and the j-th column from the left to be M\\times (i-1)+j.\nConstruct one such way to rearrange the numbers. The constraints guarantee that it is always possible to achieve the objective.\n\nConstraints\n\n1 \\leq N,M \\leq 100\n\n1 \\leq A_{ij} \\leq NM\n\nA_{ij} are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_{11} A_{12} ... A_{1M}\n:\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint one way to rearrange the numbers in the following format:\n\nB_{11} B_{12} ... B_{1M}\n:\nB_{N1} B_{N2} ... B_{NM}\nC_{11} C_{12} ... C_{1M}\n:\nC_{N1} C_{N2} ... C_{NM}\n\nHere B_{ij} is the number written in the square at the i-th row from the top and the j-th column from the left after Step 1, and C_{ij} is the number written in that square after Step 2.\n\nSample Input 1\n\n3 2\n2 6\n4 3\n1 5\n\nSample Output 1\n\n2 6\n4 3\n5 1\n2 1\n4 3\n5 6\n\nSample Input 2\n\n3 4\n1 4 7 10\n2 5 8 11\n3 6 9 12\n\nSample Output 2\n\n1 4 7 10\n5 8 11 2\n9 12 3 6\n1 4 3 2\n5 8 7 6\n9 12 11 10", "sample_input": "3 2\n2 6\n4 3\n1 5\n"}, "reference_outputs": ["2 6\n4 3\n5 1\n2 1\n4 3\n5 6\n"], "source_document_id": "p02942", "source_text": "Score : 1100 points\n\nProblem Statement\n\nWe have a grid with N rows and M columns of squares.\nEach integer from 1 to NM is written in this grid once.\nThe number written in the square at the i-th row from the top and the j-th column from the left is A_{ij}.\n\nYou need to rearrange these numbers as follows:\n\nFirst, for each of the N rows, rearrange the numbers written in it as you like.\n\nSecond, for each of the M columns, rearrange the numbers written in it as you like.\n\nFinally, for each of the N rows, rearrange the numbers written in it as you like.\n\nAfter rearranging the numbers, you want the number written in the square at the i-th row from the top and the j-th column from the left to be M\\times (i-1)+j.\nConstruct one such way to rearrange the numbers. The constraints guarantee that it is always possible to achieve the objective.\n\nConstraints\n\n1 \\leq N,M \\leq 100\n\n1 \\leq A_{ij} \\leq NM\n\nA_{ij} are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_{11} A_{12} ... A_{1M}\n:\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint one way to rearrange the numbers in the following format:\n\nB_{11} B_{12} ... B_{1M}\n:\nB_{N1} B_{N2} ... B_{NM}\nC_{11} C_{12} ... C_{1M}\n:\nC_{N1} C_{N2} ... C_{NM}\n\nHere B_{ij} is the number written in the square at the i-th row from the top and the j-th column from the left after Step 1, and C_{ij} is the number written in that square after Step 2.\n\nSample Input 1\n\n3 2\n2 6\n4 3\n1 5\n\nSample Output 1\n\n2 6\n4 3\n5 1\n2 1\n4 3\n5 6\n\nSample Input 2\n\n3 4\n1 4 7 10\n2 5 8 11\n3 6 9 12\n\nSample Output 2\n\n1 4 7 10\n5 8 11 2\n9 12 3 6\n1 4 3 2\n5 8 7 6\n9 12 11 10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7806, "cpu_time_ms": 78, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s939157723", "group_id": "codeNet:p02945", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a+b > a-b {\n\t\tif a+b > a*b {\n\t\t\tfmt.Println(a + b)\n\t\t} else if a+b < a*b {\n\t\t\tfmt.Println(a * b)\n\t\t}\n\t} else if a+b < a-b {\n\t\tif a-b > a*b {\n\t\t\tfmt.Println(a - b)\n\t\t} else if a-b < a*b {\n\t\t\tfmt.Println(a * b)\n\t\t}\n\n\t}\n}\n", "language": "Go", "metadata": {"date": 1575995799, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02945.html", "problem_id": "p02945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02945/input.txt", "sample_output_relpath": "derived/input_output/data/p02945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02945/Go/s939157723.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s939157723", "user_id": "u346986631"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a+b > a-b {\n\t\tif a+b > a*b {\n\t\t\tfmt.Println(a + b)\n\t\t} else if a+b < a*b {\n\t\t\tfmt.Println(a * b)\n\t\t}\n\t} else if a+b < a-b {\n\t\tif a-b > a*b {\n\t\t\tfmt.Println(a - b)\n\t\t} else if a-b < a*b {\n\t\t\tfmt.Println(a * b)\n\t\t}\n\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "sample_input": "-13 3\n"}, "reference_outputs": ["-10\n"], "source_document_id": "p02945", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 299, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s948613899", "group_id": "codeNet:p02945", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\ttmp := a + b\n\n\tif tmp2 := a - b; tmp < tmp2 {\n\t\ttmp = tmp2\n\t}\n\n\tif tmp2 := a * b; tmp < tmp2 {\n\t\ttmp = tmp2\n\t}\n\n\tfmt.Println(tmp)\n}\n\n", "language": "Go", "metadata": {"date": 1565488732, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02945.html", "problem_id": "p02945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02945/input.txt", "sample_output_relpath": "derived/input_output/data/p02945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02945/Go/s948613899.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s948613899", "user_id": "u618957182"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\ttmp := a + b\n\n\tif tmp2 := a - b; tmp < tmp2 {\n\t\ttmp = tmp2\n\t}\n\n\tif tmp2 := a * b; tmp < tmp2 {\n\t\ttmp = tmp2\n\t}\n\n\tfmt.Println(tmp)\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "sample_input": "-13 3\n"}, "reference_outputs": ["-10\n"], "source_document_id": "p02945", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 224, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s927439990", "group_id": "codeNet:p02945", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\ts.Scan()\n\ta, _ := strconv.Atoi(s.Text())\n\treturn a\n}\n\nfunc main() {\n\ts.Split(bufio.ScanWords)\n\ta, b := getInt(), getInt()\n\n\tnum := []int{a + b, a - b, a * b}\n\n\tsort.Ints(num)\n\n\tn := len(num)\n\n\tfmt.Println(num[n-1])\n\n}\n", "language": "Go", "metadata": {"date": 1565485434, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02945.html", "problem_id": "p02945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02945/input.txt", "sample_output_relpath": "derived/input_output/data/p02945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02945/Go/s927439990.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s927439990", "user_id": "u262602763"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\ts.Scan()\n\ta, _ := strconv.Atoi(s.Text())\n\treturn a\n}\n\nfunc main() {\n\ts.Split(bufio.ScanWords)\n\ta, b := getInt(), getInt()\n\n\tnum := []int{a + b, a - b, a * b}\n\n\tsort.Ints(num)\n\n\tn := len(num)\n\n\tfmt.Println(num[n-1])\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "sample_input": "-13 3\n"}, "reference_outputs": ["-10\n"], "source_document_id": "p02945", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 342, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s775524515", "group_id": "codeNet:p02945", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nconst BufferSize = 1024\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar production bool\n\nfunc debugf(format string, v ...interface{}) {\n\tif !production {\n\t\tfmt.Printf(format, v...)\n\t}\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] {\n\t\t\tres = a[i]\n\t\t}\n\t}\n\treturn res\n}\n\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, 1e+6)\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tb := nextInt()\n\n\t_, _ = fmt.Fprintf(writer, \"%d\", max(a+b, a-b, a*b))\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1565485323, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02945.html", "problem_id": "p02945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02945/input.txt", "sample_output_relpath": "derived/input_output/data/p02945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02945/Go/s775524515.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s775524515", "user_id": "u880731071"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nconst BufferSize = 1024\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar production bool\n\nfunc debugf(format string, v ...interface{}) {\n\tif !production {\n\t\tfmt.Printf(format, v...)\n\t}\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] {\n\t\t\tres = a[i]\n\t\t}\n\t}\n\treturn res\n}\n\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, 1e+6)\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tb := nextInt()\n\n\t_, _ = fmt.Fprintf(writer, \"%d\", max(a+b, a-b, a*b))\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "sample_input": "-13 3\n"}, "reference_outputs": ["-10\n"], "source_document_id": "p02945", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 801, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s792008509", "group_id": "codeNet:p02946", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar K, X int\n\tfmt.Scan(&K, &X)\n\n\tans := \"\"\n\tfor i := 0; i < K-1; i++ {\n\t\tans += strconv.Itoa(X - K + 1 + i)\n\t\tans += \" \"\n\t}\n\tans += strconv.Itoa(X) + \" \"\n\tfor i := 0; i < K-1; i++ {\n\t\tans += strconv.Itoa(X + i + 1)\n\t\tans += \" \"\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1597777023, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02946.html", "problem_id": "p02946", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02946/input.txt", "sample_output_relpath": "derived/input_output/data/p02946/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02946/Go/s792008509.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s792008509", "user_id": "u825925638"}, "prompt_components": {"gold_output": "5 6 7 8 9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar K, X int\n\tfmt.Scan(&K, &X)\n\n\tans := \"\"\n\tfor i := 0; i < K-1; i++ {\n\t\tans += strconv.Itoa(X - K + 1 + i)\n\t\tans += \" \"\n\t}\n\tans += strconv.Itoa(X) + \" \"\n\tfor i := 0; i < K-1; i++ {\n\t\tans += strconv.Itoa(X + i + 1)\n\t\tans += \" \"\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "sample_input": "3 7\n"}, "reference_outputs": ["5 6 7 8 9\n"], "source_document_id": "p02946", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 311, "cpu_time_ms": 6, "memory_kb": 1952}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s261544355", "group_id": "codeNet:p02946", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// 以下の問題\n// https://atcoder.jp/contests/abc137/tasks/abc137_b\n\nfunc main() {\n\tvar K, X int\n\tfmt.Scan(&K, &X)\n\n\tfor i := X - K + 1; i <= X+K-1; i++ {\n\t\tfmt.Print(i ,\" \")\n}\n}\n", "language": "Go", "metadata": {"date": 1586120021, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02946.html", "problem_id": "p02946", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02946/input.txt", "sample_output_relpath": "derived/input_output/data/p02946/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02946/Go/s261544355.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s261544355", "user_id": "u214033538"}, "prompt_components": {"gold_output": "5 6 7 8 9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// 以下の問題\n// https://atcoder.jp/contests/abc137/tasks/abc137_b\n\nfunc main() {\n\tvar K, X int\n\tfmt.Scan(&K, &X)\n\n\tfor i := X - K + 1; i <= X+K-1; i++ {\n\t\tfmt.Print(i ,\" \")\n}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "sample_input": "3 7\n"}, "reference_outputs": ["5 6 7 8 9\n"], "source_document_id": "p02946", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s027717221", "group_id": "codeNet:p02946", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar k, x int\n\ts := wordScanner(100)\n\tscanInts(s, &k, &x)\n\n\tl := make([]string, 0)\n\tfor i := max(x-k+1, -1000000); i <= min(x+k-1, 1000000); i++ {\n\t\tl = append(l, strconv.Itoa(i))\n\t}\n\n\tfmt.Println(strings.Join(l, \" \"))\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc wordScanner(n int) *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\tb := make([]byte, n)\n\ts.Buffer(b, n)\n\treturn s\n}\n\nfunc scanInts(s *bufio.Scanner, vals ...*int) {\n\tfor i := range vals {\n\t\ts.Scan()\n\t\tn, _ := strconv.Atoi(s.Text())\n\t\t*vals[i] = n\n\t}\n}\n", "language": "Go", "metadata": {"date": 1565485919, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02946.html", "problem_id": "p02946", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02946/input.txt", "sample_output_relpath": "derived/input_output/data/p02946/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02946/Go/s027717221.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s027717221", "user_id": "u889640107"}, "prompt_components": {"gold_output": "5 6 7 8 9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar k, x int\n\ts := wordScanner(100)\n\tscanInts(s, &k, &x)\n\n\tl := make([]string, 0)\n\tfor i := max(x-k+1, -1000000); i <= min(x+k-1, 1000000); i++ {\n\t\tl = append(l, strconv.Itoa(i))\n\t}\n\n\tfmt.Println(strings.Join(l, \" \"))\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc wordScanner(n int) *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\tb := make([]byte, n)\n\ts.Buffer(b, n)\n\treturn s\n}\n\nfunc scanInts(s *bufio.Scanner, vals ...*int) {\n\tfor i := range vals {\n\t\ts.Scan()\n\t\tn, _ := strconv.Atoi(s.Text())\n\t\t*vals[i] = n\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "sample_input": "3 7\n"}, "reference_outputs": ["5 6 7 8 9\n"], "source_document_id": "p02946", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 720, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s638421796", "group_id": "codeNet:p02948", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype PairInt struct {\n\tfirst, second int\n}\n\nfunc NewPairInt(first, second int) PairInt {\n\treturn PairInt{first, second}\n}\n\ntype PairsInt []PairInt\n\nfunc (p PairsInt) Less(i, j int) bool {\n\tif p[i].first == p[j].first {\n\t\treturn p[i].second < p[j].second\n\t} else {\n\t\treturn p[i].first < p[j].first\n\t}\n}\n\nfunc (p PairsInt) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p PairsInt) Len() int {\n\treturn len(p)\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h IntHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h IntHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc solve() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor i := 0; sc.Scan(); i++ {\n\t\tfmt.Println(sc.Text())\n\t\targs := strings.Split(sc.Text(), \" \")\n\t\ta[i], _ = strconv.Atoi(args[0])\n\t\tb[i], _ = strconv.Atoi(args[1])\n\t}\n\n\tpairs := make(PairsInt, n)\n\tfor i := 0; i < n; i++ {\n\t\tpairs[i] = NewPairInt(a[i], b[i])\n\t}\n\tsort.Sort(pairs)\n\n\th := &IntHeap{}\n\theap.Init(h)\n\tsum := 0\n\tj := 0\n\tfor i := n; i > 0; i-- {\n\t\tfor j < n && pairs[j].first+i <= m+1 {\n\t\t\theap.Push(h, pairs[j].second)\n\t\t\tj++\n\t\t}\n\t\tif h.Len() != 0 {\n\t\t\tsum += heap.Pop(h).(int)\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n}\n\nfunc main() {\n\tsolve()\n}\n", "language": "Go", "metadata": {"date": 1571888030, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02948.html", "problem_id": "p02948", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02948/input.txt", "sample_output_relpath": "derived/input_output/data/p02948/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02948/Go/s638421796.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s638421796", "user_id": "u248995595"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype PairInt struct {\n\tfirst, second int\n}\n\nfunc NewPairInt(first, second int) PairInt {\n\treturn PairInt{first, second}\n}\n\ntype PairsInt []PairInt\n\nfunc (p PairsInt) Less(i, j int) bool {\n\tif p[i].first == p[j].first {\n\t\treturn p[i].second < p[j].second\n\t} else {\n\t\treturn p[i].first < p[j].first\n\t}\n}\n\nfunc (p PairsInt) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p PairsInt) Len() int {\n\treturn len(p)\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h IntHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h IntHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc solve() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor i := 0; sc.Scan(); i++ {\n\t\tfmt.Println(sc.Text())\n\t\targs := strings.Split(sc.Text(), \" \")\n\t\ta[i], _ = strconv.Atoi(args[0])\n\t\tb[i], _ = strconv.Atoi(args[1])\n\t}\n\n\tpairs := make(PairsInt, n)\n\tfor i := 0; i < n; i++ {\n\t\tpairs[i] = NewPairInt(a[i], b[i])\n\t}\n\tsort.Sort(pairs)\n\n\th := &IntHeap{}\n\theap.Init(h)\n\tsum := 0\n\tj := 0\n\tfor i := n; i > 0; i-- {\n\t\tfor j < n && pairs[j].first+i <= m+1 {\n\t\t\theap.Push(h, pairs[j].second)\n\t\t\tj++\n\t\t}\n\t\tif h.Len() != 0 {\n\t\t\tsum += heap.Pop(h).(int)\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n}\n\nfunc main() {\n\tsolve()\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "sample_input": "3 4\n4 3\n4 1\n2 2\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02948", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1545, "cpu_time_ms": 359, "memory_kb": 8832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s160810890", "group_id": "codeNet:p02948", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, \"getInt()\")\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, \"getInt(\", n, \")\")\n\t\t}\n\t}()\n\treturn n\n}\n\ntype inInfo struct {\n\tin int\n\tafter int\n}\n\ntype inInfoSorter []inInfo\n\nfunc (a inInfoSorter) Len() int { return len(a) }\nfunc (a inInfoSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a inInfoSorter) Less(i, j int) bool {\n\tswitch {\n\tcase a[i].in > a[j].in:\n\t\treturn true\n\tcase a[i].in < a[j].in:\n\t\treturn false\n\tcase a[i].after > a[j].after:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc sum(w []int) int {\n\ts := 0\n\tfor _, v := range w {\n\t\ts += v\n\t}\n\treturn s\n}\n\ntype ptr []int\n\nfunc (x ptr) top(i int) int {\n\tptrs := []int(x)\n\tvar his []int\n\tcur := i\n\tfor ; cur >= 0 && ptrs[cur] != cur; cur = ptrs[cur] {\n\t\this = append(his, cur)\n\t}\n\tfor _, v := range his {\n\t\tptrs[v] = cur - 1\n\t}\n\tif cur >= 0 {\n\t\tptrs[cur] = cur - 1\n\t}\n\treturn cur\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\tvar n, m int\n\tvar infos []inInfo\n\treader := NewScannerEx(stdin)\n\treader.ScanAndSplit()\n\tn, m = reader.nextInt(), reader.nextInt()\n\n\tfor i := 0; i < n; i++ {\n\t\treader.ScanAndSplit()\n\t\tinfos = append(infos, inInfo{after: reader.nextInt(), in: reader.nextInt()})\n\t}\n\n\tsort.Sort(inInfoSorter(infos))\n\n\tvar ans = make([]int, m)\n\n\tfor _, w := range infos {\n\t\ti := m - w.after\n\t\tfor ; i >= 0 && ans[i] > 0; i-- {\n\n\t\t}\n\t\tif i >= 0 {\n\t\t\tans[i] = w.in\n\t\t}\n\t}\n\n\tfmt.Fprintln(stdout, sum(ans))\n\n}\n\n", "language": "Go", "metadata": {"date": 1565668841, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02948.html", "problem_id": "p02948", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02948/input.txt", "sample_output_relpath": "derived/input_output/data/p02948/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02948/Go/s160810890.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s160810890", "user_id": "u463655976"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, \"getInt()\")\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, \"getInt(\", n, \")\")\n\t\t}\n\t}()\n\treturn n\n}\n\ntype inInfo struct {\n\tin int\n\tafter int\n}\n\ntype inInfoSorter []inInfo\n\nfunc (a inInfoSorter) Len() int { return len(a) }\nfunc (a inInfoSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a inInfoSorter) Less(i, j int) bool {\n\tswitch {\n\tcase a[i].in > a[j].in:\n\t\treturn true\n\tcase a[i].in < a[j].in:\n\t\treturn false\n\tcase a[i].after > a[j].after:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc sum(w []int) int {\n\ts := 0\n\tfor _, v := range w {\n\t\ts += v\n\t}\n\treturn s\n}\n\ntype ptr []int\n\nfunc (x ptr) top(i int) int {\n\tptrs := []int(x)\n\tvar his []int\n\tcur := i\n\tfor ; cur >= 0 && ptrs[cur] != cur; cur = ptrs[cur] {\n\t\this = append(his, cur)\n\t}\n\tfor _, v := range his {\n\t\tptrs[v] = cur - 1\n\t}\n\tif cur >= 0 {\n\t\tptrs[cur] = cur - 1\n\t}\n\treturn cur\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\tvar n, m int\n\tvar infos []inInfo\n\treader := NewScannerEx(stdin)\n\treader.ScanAndSplit()\n\tn, m = reader.nextInt(), reader.nextInt()\n\n\tfor i := 0; i < n; i++ {\n\t\treader.ScanAndSplit()\n\t\tinfos = append(infos, inInfo{after: reader.nextInt(), in: reader.nextInt()})\n\t}\n\n\tsort.Sort(inInfoSorter(infos))\n\n\tvar ans = make([]int, m)\n\n\tfor _, w := range infos {\n\t\ti := m - w.after\n\t\tfor ; i >= 0 && ans[i] > 0; i-- {\n\n\t\t}\n\t\tif i >= 0 {\n\t\t\tans[i] = w.in\n\t\t}\n\t}\n\n\tfmt.Fprintln(stdout, sum(ans))\n\n}\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "sample_input": "3 4\n4 3\n4 1\n2 2\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02948", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2572, "cpu_time_ms": 2108, "memory_kb": 7936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s987823183", "group_id": "codeNet:p02948", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\n\thash := make(map[int][]int)\n\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\n\t\tif a > m {\n\t\t\tcontinue\n\t\t}\n\n\t\thash[a] = append(hash[a], b)\n\t}\n\n\tresult := 0\n\tbucket := make([]int, m)\n\n\tfor day := 1; day <= m; day++ {\n\t\td := hash[day]\n\n\t\tif len(d) > 0 {\n\t\t\tbucket = append(d, bucket...)\n\t\t\tsort.Sort(sort.Reverse(sort.IntSlice(bucket)))\n\t\t\tbucket = bucket[:m]\n\t\t}\n\n\t\tif len(bucket) > 0 {\n\t\t\tresult += bucket[0]\n\t\t\tbucket = bucket[1:]\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}", "language": "Go", "metadata": {"date": 1565533348, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02948.html", "problem_id": "p02948", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02948/input.txt", "sample_output_relpath": "derived/input_output/data/p02948/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02948/Go/s987823183.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s987823183", "user_id": "u503890246"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\n\thash := make(map[int][]int)\n\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\n\t\tif a > m {\n\t\t\tcontinue\n\t\t}\n\n\t\thash[a] = append(hash[a], b)\n\t}\n\n\tresult := 0\n\tbucket := make([]int, m)\n\n\tfor day := 1; day <= m; day++ {\n\t\td := hash[day]\n\n\t\tif len(d) > 0 {\n\t\t\tbucket = append(d, bucket...)\n\t\t\tsort.Sort(sort.Reverse(sort.IntSlice(bucket)))\n\t\t\tbucket = bucket[:m]\n\t\t}\n\n\t\tif len(bucket) > 0 {\n\t\t\tresult += bucket[0]\n\t\t\tbucket = bucket[1:]\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "sample_input": "3 4\n4 3\n4 1\n2 2\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02948", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 760, "cpu_time_ms": 2108, "memory_kb": 20608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s580008311", "group_id": "codeNet:p02948", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nconst BufferSize = 1024\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar production bool\n\nfunc debugf(format string, v ...interface{}) {\n\tif !production {\n\t\tfmt.Printf(format, v...)\n\t}\n}\n\ntype bc struct {\n\tnum int\n\tvalue int\n}\n\ntype bcs []bc\n\nfunc (b bcs) Len() int { return len(b) }\nfunc (b bcs) Less(i, j int) bool {\n\tif b[i].num != b[j].num {\n\t\treturn b[i].num < b[j].num\n\t}\n\treturn b[i].value > b[j].value\n}\nfunc (b bcs) Swap(i, j int) { b[i], b[j] = b[j], b[i] }\n\n// Btree represents an AVL tree\ntype Btree struct {\n\troot *Node\n\tvalues []Val\n\tlen int\n}\n\n// Val interface to define the compare method used to insert and find values\ntype Val interface {\n\tComp(val Val) int8\n}\n\n// Node represents a node in the tree with a value, left and right children, and a height/balance of the node.\ntype Node struct {\n\tValue Val\n\tleft, right *Node\n\theight int8\n}\n\n// New returns a new btree\nfunc New() *Btree { return new(Btree).Init() }\n\n// Init initializes all values/clears the tree and returns the tree pointer\nfunc (t *Btree) Init() *Btree {\n\tt.root = nil\n\tt.values = nil\n\tt.len = 0\n\treturn t\n}\n\n// String returns a string representation of the tree values\nfunc (t *Btree) String() string {\n\treturn fmt.Sprint(t.Values())\n}\n\n// Empty returns true if the tree is empty\nfunc (t *Btree) Empty() bool {\n\treturn t.root == nil\n}\n\n// NotEmpty returns true if the tree is not empty\nfunc (t *Btree) NotEmpty() bool {\n\treturn t.root != nil\n}\n\nfunc (t *Btree) balance() int8 {\n\tif t.root != nil {\n\t\treturn balance(t.root)\n\t}\n\treturn 0\n}\n\n// Insert inserts a new value into the tree and returns the tree pointer\nfunc (t *Btree) Insert(value Val) *Btree {\n\tadded := false\n\tt.root = insert(t.root, value, &added)\n\tif added {\n\t\tt.len++\n\t}\n\tt.values = nil\n\treturn t\n}\n\nfunc insert(n *Node, value Val, added *bool) *Node {\n\tif n == nil {\n\t\t*added = true\n\t\treturn (&Node{Value: value}).Init()\n\t}\n\tc := value.Comp(n.Value)\n\tif c >= 0 {\n\t\tn.right = insert(n.right, value, added)\n\t} else if c < 0 {\n\t\tn.left = insert(n.left, value, added)\n\t} /*else {\n\t\tn.Value = value\n\t\t*added = false\n\t\treturn n\n\t}*/\n\n\tn.height = n.maxHeight() + 1\n\tc = balance(n)\n\n\tif c > 1 {\n\t\tc = value.Comp(n.left.Value)\n\t\tif c < 0 {\n\t\t\treturn n.rotateRight()\n\t\t} else if c > 0 {\n\t\t\tn.left = n.left.rotateLeft()\n\t\t\treturn n.rotateRight()\n\t\t}\n\t} else if c < -1 {\n\t\tc = value.Comp(n.right.Value)\n\t\tif c > 0 {\n\t\t\treturn n.rotateLeft()\n\t\t} else if c < 0 {\n\t\t\tn.right = n.right.rotateRight()\n\t\t\treturn n.rotateLeft()\n\t\t}\n\t}\n\treturn n\n}\n\n// InsertAll inserts all the values into the tree and returns the tree pointer\nfunc (t *Btree) InsertAll(values []Val) *Btree {\n\tfor _, v := range values {\n\t\tt.Insert(v)\n\t}\n\treturn t\n}\n\n// Contains returns true if the tree contains the specified value\nfunc (t *Btree) Contains(value Val) bool {\n\treturn t.Get(value) != nil\n}\n\n// ContainsAny returns true if the tree contains any of the values\nfunc (t *Btree) ContainsAny(values []Val) bool {\n\tfor _, v := range values {\n\t\tif t.Contains(v) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// ContainsAll returns true if the tree contains all of the values\nfunc (t *Btree) ContainsAll(values []Val) bool {\n\tfor _, v := range values {\n\t\tif !t.Contains(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Get returns the node value associated with the search value\nfunc (t *Btree) Get(value Val) Val {\n\tvar node *Node\n\tif t.root != nil {\n\t\tnode = t.root.get(value)\n\t}\n\tif node != nil {\n\t\treturn node.Value\n\t}\n\treturn nil\n}\n\n// Len return the number of nodes in the tree\nfunc (t *Btree) Len() int {\n\treturn t.len\n}\n\n// Head returns the first value in the tree\nfunc (t *Btree) Head() Val {\n\tif t.root == nil {\n\t\treturn nil\n\t}\n\tvar beginning = t.root\n\tfor beginning.left != nil {\n\t\tbeginning = beginning.left\n\t}\n\tif beginning == nil {\n\t\tfor beginning.right != nil {\n\t\t\tbeginning = beginning.right\n\t\t}\n\t}\n\tif beginning != nil {\n\t\treturn beginning.Value\n\t}\n\treturn nil\n}\n\n// Tail returns the last value in the tree\nfunc (t *Btree) Tail() Val {\n\tif t.root == nil {\n\t\treturn nil\n\t}\n\tvar beginning = t.root\n\tfor beginning.right != nil {\n\t\tbeginning = beginning.right\n\t}\n\tif beginning == nil {\n\t\tfor beginning.left != nil {\n\t\t\tbeginning = beginning.left\n\t\t}\n\t}\n\tif beginning != nil {\n\t\treturn beginning.Value\n\t}\n\treturn nil\n}\n\n// Values returns a slice of all the values in tree in order\nfunc (t *Btree) Values() []Val {\n\tif t.values == nil {\n\t\tt.values = make([]Val, t.len)\n\t\tt.Ascend(func(n *Node, i int) bool {\n\t\t\tt.values[i] = n.Value\n\t\t\treturn true\n\t\t})\n\t}\n\treturn t.values\n}\n\n// Delete deletes the node from the tree associated with the search value\nfunc (t *Btree) Delete(value Val) *Btree {\n\tdeleted := false\n\tt.root = deleteNode(t.root, value, &deleted)\n\tif deleted {\n\t\tt.len--\n\t}\n\tt.values = nil\n\treturn t\n}\n\n// DeleteAll deletes the nodes from the tree associated with the search values\nfunc (t *Btree) DeleteAll(values []Val) *Btree {\n\tfor _, v := range values {\n\t\tt.Delete(v)\n\t}\n\treturn t\n}\n\nfunc deleteNode(n *Node, value Val, deleted *bool) *Node {\n\tif n == nil {\n\t\treturn n\n\t}\n\n\tc := value.Comp(n.Value)\n\n\tif c < 0 {\n\t\tn.left = deleteNode(n.left, value, deleted)\n\t} else if c > 0 {\n\t\tn.right = deleteNode(n.right, value, deleted)\n\t} else {\n\t\tif n.left == nil {\n\t\t\tt := n.right\n\t\t\tn.Init()\n\t\t\treturn t\n\t\t} else if n.right == nil {\n\t\t\tt := n.left\n\t\t\tn.Init()\n\t\t\treturn t\n\t\t}\n\t\tt := n.right.min()\n\t\tn.Value = t.Value\n\t\tn.right = deleteNode(n.right, t.Value, deleted)\n\t\t*deleted = true\n\t}\n\n\t//re-balance\n\tif n == nil {\n\t\treturn n\n\t}\n\tn.height = n.maxHeight() + 1\n\tbal := balance(n)\n\tif bal > 1 {\n\t\tif balance(n.left) >= 0 {\n\t\t\treturn n.rotateRight()\n\t\t}\n\t\tn.left = n.left.rotateLeft()\n\t\treturn n.rotateRight()\n\t} else if bal < -1 {\n\t\tif balance(n.right) <= 0 {\n\t\t\treturn n.rotateLeft()\n\t\t}\n\t\tn.right = n.right.rotateRight()\n\t\treturn n.rotateLeft()\n\t}\n\n\treturn n\n}\n\n// Pop deletes the last node from the tree and returns its value\nfunc (t *Btree) Pop() Val {\n\tvalue := t.Tail()\n\tif value != nil {\n\t\tt.Delete(value)\n\t}\n\treturn value\n}\n\n// Pull deletes the first node from the tree and returns its value\nfunc (t *Btree) Pull() Val {\n\tvalue := t.Head()\n\tif value != nil {\n\t\tt.Delete(value)\n\t}\n\treturn value\n}\n\n// NodeIterator expresses the iterator function used for traversals\ntype NodeIterator func(n *Node, i int) bool\n\n// Ascend performs an ascending order traversal of the tree calling the iterator function on each node\n// the iterator will continue as long as the NodeIterator returns true\nfunc (t *Btree) Ascend(iterator NodeIterator) {\n\tvar i int\n\tif t.root != nil {\n\t\tt.root.iterate(iterator, &i, true)\n\t}\n}\n\n// Descend performs a descending order traversal of the tree using the iterator\n// the iterator will continue as long as the NodeIterator returns true\nfunc (t *Btree) Descend(iterator NodeIterator) {\n\tvar i int\n\tif t.root != nil {\n\t\tt.root.rIterate(iterator, &i, true)\n\t}\n}\n\n// Debug prints out useful debug information about the tree for debugging purposes\nfunc (t *Btree) Debug() {\n\tfmt.Println(\"----------------------------------------------------------------------------------------------\")\n\tif t.Empty() {\n\t\tfmt.Println(\"tree is empty\")\n\t} else {\n\t\tfmt.Println(t.Len(), \"elements\")\n\t}\n\n\tt.Ascend(func(n *Node, i int) bool {\n\t\tif t.root.Value == n.Value {\n\t\t\tfmt.Print(\"ROOT ** \")\n\t\t}\n\t\tn.Debug()\n\t\treturn true\n\t})\n\tfmt.Println(\"----------------------------------------------------------------------------------------------\")\n}\n\n// Init initializes the values of the node or clears the node and returns the node pointer\nfunc (n *Node) Init() *Node {\n\tn.height = 1\n\tn.left = nil\n\tn.right = nil\n\treturn n\n}\n\n// String returns a string representing the node\nfunc (n *Node) String() string {\n\treturn fmt.Sprint(n.Value)\n}\n\n// Debug prints out useful debug information about the tree node for debugging purposes\nfunc (n *Node) Debug() {\n\tvar children string\n\tif n.left == nil && n.right == nil {\n\t\tchildren = \"no children |\"\n\t} else if n.left != nil && n.right != nil {\n\t\tchildren = fmt.Sprint(\"left child:\", n.left.String(), \" right child:\", n.right.String())\n\t} else if n.right != nil {\n\t\tchildren = fmt.Sprint(\"right child:\", n.right.String())\n\t} else {\n\t\tchildren = fmt.Sprint(\"left child:\", n.left.String())\n\t}\n\n\tfmt.Println(n.String(), \"|\", \"height\", n.height, \"|\", \"balance\", balance(n), \"|\", children)\n}\n\nfunc height(n *Node) int8 {\n\tif n != nil {\n\t\treturn n.height\n\t}\n\treturn 0\n}\n\nfunc balance(n *Node) int8 {\n\tif n == nil {\n\t\treturn 0\n\t}\n\treturn height(n.left) - height(n.right)\n}\n\nfunc (n *Node) get(val Val) *Node {\n\tvar node *Node\n\tc := val.Comp(n.Value)\n\tif c < 0 {\n\t\tif n.left != nil {\n\t\t\tnode = n.left.get(val)\n\t\t}\n\t} else if c > 0 {\n\t\tif n.right != nil {\n\t\t\tnode = n.right.get(val)\n\t\t}\n\t} else {\n\t\tnode = n\n\t}\n\treturn node\n}\n\nfunc (n *Node) rotateRight() *Node {\n\tl := n.left\n\t// Rotation\n\tl.right, n.left = n, l.right\n\n\t// update heights\n\tn.height = n.maxHeight() + 1\n\tl.height = l.maxHeight() + 1\n\n\treturn l\n}\n\nfunc (n *Node) rotateLeft() *Node {\n\tr := n.right\n\t// Rotation\n\tr.left, n.right = n, r.left\n\n\t// update heights\n\tn.height = n.maxHeight() + 1\n\tr.height = r.maxHeight() + 1\n\n\treturn r\n}\n\nfunc (n *Node) iterate(iterator NodeIterator, i *int, cont bool) {\n\tif n != nil && cont {\n\t\tn.left.iterate(iterator, i, cont)\n\t\tcont = iterator(n, *i)\n\t\t*i++\n\t\tn.right.iterate(iterator, i, cont)\n\t}\n}\n\nfunc (n *Node) rIterate(iterator NodeIterator, i *int, cont bool) {\n\tif n != nil && cont {\n\t\tn.right.iterate(iterator, i, cont)\n\t\tcont = iterator(n, *i)\n\t\t*i++\n\t\tn.left.iterate(iterator, i, cont)\n\t}\n}\n\nfunc (n *Node) min() *Node {\n\tcurrent := n\n\tfor current.left != nil {\n\t\tcurrent = current.left\n\t}\n\treturn current\n}\n\nfunc (n *Node) maxHeight() int8 {\n\trh := height(n.right)\n\tlh := height(n.left)\n\tif rh > lh {\n\t\treturn rh\n\t}\n\treturn lh\n}\n\n// IntVal represents an integer tree val\ntype IntVal int\n\n// Comp returns 1 if i > val, -1 if i < val and 0 if i equal to val\nfunc (i IntVal) Comp(val Val) int8 {\n\tv := val.(IntVal)\n\tif i > v {\n\t\treturn 1\n\t} else if i < v {\n\t\treturn -1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, 1e+6)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\ta := make([]bc, n)\n\n\tfor i := range a {\n\t\ta[i].num = nextInt()\n\t\ta[i].value = nextInt()\n\t}\n\tsort.Sort(bcs(a))\n\t//debugf(\"%v\\n\", a)\n\tidx := 0\n\tans := 0\n\t/*\n\t\tb := make([]int, 0, n)\n\t\tfor i := 0; i < m; i++ {\n\t\t\tfor idx < n && a[idx].num <= i+1 {\n\t\t\t\tb = append(b, a[idx].value)\n\t\t\t\tidx++\n\t\t\t}\n\t\t\tsort.Sort(sort.Reverse(sort.IntSlice(b)))\n\t\t\tif len(b) > 0 {\n\t\t\t\tans += b[0]\n\t\t\t\tb[0] = 0\n\t\t\t}\n\t\t}\n\t*/\n\n\tb := new(Btree).Init()\n\n\t//debugf(\"%v\\n\", a)\n\tfor i := 0; i < m; i++ {\n\t\tfor idx < n && a[idx].num <= i+1 {\n\t\t\tb.Insert(IntVal(a[idx].value))\n\t\t\tidx++\n\t\t}\n\t\t//debugf(\"i: %d, ans: %d, %v\\n\", i, ans, b.String())\n\t\tn := b.Tail()\n\t\tif n != nil {\n\t\t\tans += int(n.(IntVal))\n\t\t\tb.Delete(n)\n\t\t}\n\t\t//debugf(\"end i: %d, ans: %d, %v\\n\", i, ans, b.String())\n\t}\n\n\t_, _ = fmt.Fprintf(writer, \"%d\", ans)\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1565491127, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02948.html", "problem_id": "p02948", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02948/input.txt", "sample_output_relpath": "derived/input_output/data/p02948/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02948/Go/s580008311.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s580008311", "user_id": "u880731071"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nconst BufferSize = 1024\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar production bool\n\nfunc debugf(format string, v ...interface{}) {\n\tif !production {\n\t\tfmt.Printf(format, v...)\n\t}\n}\n\ntype bc struct {\n\tnum int\n\tvalue int\n}\n\ntype bcs []bc\n\nfunc (b bcs) Len() int { return len(b) }\nfunc (b bcs) Less(i, j int) bool {\n\tif b[i].num != b[j].num {\n\t\treturn b[i].num < b[j].num\n\t}\n\treturn b[i].value > b[j].value\n}\nfunc (b bcs) Swap(i, j int) { b[i], b[j] = b[j], b[i] }\n\n// Btree represents an AVL tree\ntype Btree struct {\n\troot *Node\n\tvalues []Val\n\tlen int\n}\n\n// Val interface to define the compare method used to insert and find values\ntype Val interface {\n\tComp(val Val) int8\n}\n\n// Node represents a node in the tree with a value, left and right children, and a height/balance of the node.\ntype Node struct {\n\tValue Val\n\tleft, right *Node\n\theight int8\n}\n\n// New returns a new btree\nfunc New() *Btree { return new(Btree).Init() }\n\n// Init initializes all values/clears the tree and returns the tree pointer\nfunc (t *Btree) Init() *Btree {\n\tt.root = nil\n\tt.values = nil\n\tt.len = 0\n\treturn t\n}\n\n// String returns a string representation of the tree values\nfunc (t *Btree) String() string {\n\treturn fmt.Sprint(t.Values())\n}\n\n// Empty returns true if the tree is empty\nfunc (t *Btree) Empty() bool {\n\treturn t.root == nil\n}\n\n// NotEmpty returns true if the tree is not empty\nfunc (t *Btree) NotEmpty() bool {\n\treturn t.root != nil\n}\n\nfunc (t *Btree) balance() int8 {\n\tif t.root != nil {\n\t\treturn balance(t.root)\n\t}\n\treturn 0\n}\n\n// Insert inserts a new value into the tree and returns the tree pointer\nfunc (t *Btree) Insert(value Val) *Btree {\n\tadded := false\n\tt.root = insert(t.root, value, &added)\n\tif added {\n\t\tt.len++\n\t}\n\tt.values = nil\n\treturn t\n}\n\nfunc insert(n *Node, value Val, added *bool) *Node {\n\tif n == nil {\n\t\t*added = true\n\t\treturn (&Node{Value: value}).Init()\n\t}\n\tc := value.Comp(n.Value)\n\tif c >= 0 {\n\t\tn.right = insert(n.right, value, added)\n\t} else if c < 0 {\n\t\tn.left = insert(n.left, value, added)\n\t} /*else {\n\t\tn.Value = value\n\t\t*added = false\n\t\treturn n\n\t}*/\n\n\tn.height = n.maxHeight() + 1\n\tc = balance(n)\n\n\tif c > 1 {\n\t\tc = value.Comp(n.left.Value)\n\t\tif c < 0 {\n\t\t\treturn n.rotateRight()\n\t\t} else if c > 0 {\n\t\t\tn.left = n.left.rotateLeft()\n\t\t\treturn n.rotateRight()\n\t\t}\n\t} else if c < -1 {\n\t\tc = value.Comp(n.right.Value)\n\t\tif c > 0 {\n\t\t\treturn n.rotateLeft()\n\t\t} else if c < 0 {\n\t\t\tn.right = n.right.rotateRight()\n\t\t\treturn n.rotateLeft()\n\t\t}\n\t}\n\treturn n\n}\n\n// InsertAll inserts all the values into the tree and returns the tree pointer\nfunc (t *Btree) InsertAll(values []Val) *Btree {\n\tfor _, v := range values {\n\t\tt.Insert(v)\n\t}\n\treturn t\n}\n\n// Contains returns true if the tree contains the specified value\nfunc (t *Btree) Contains(value Val) bool {\n\treturn t.Get(value) != nil\n}\n\n// ContainsAny returns true if the tree contains any of the values\nfunc (t *Btree) ContainsAny(values []Val) bool {\n\tfor _, v := range values {\n\t\tif t.Contains(v) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// ContainsAll returns true if the tree contains all of the values\nfunc (t *Btree) ContainsAll(values []Val) bool {\n\tfor _, v := range values {\n\t\tif !t.Contains(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Get returns the node value associated with the search value\nfunc (t *Btree) Get(value Val) Val {\n\tvar node *Node\n\tif t.root != nil {\n\t\tnode = t.root.get(value)\n\t}\n\tif node != nil {\n\t\treturn node.Value\n\t}\n\treturn nil\n}\n\n// Len return the number of nodes in the tree\nfunc (t *Btree) Len() int {\n\treturn t.len\n}\n\n// Head returns the first value in the tree\nfunc (t *Btree) Head() Val {\n\tif t.root == nil {\n\t\treturn nil\n\t}\n\tvar beginning = t.root\n\tfor beginning.left != nil {\n\t\tbeginning = beginning.left\n\t}\n\tif beginning == nil {\n\t\tfor beginning.right != nil {\n\t\t\tbeginning = beginning.right\n\t\t}\n\t}\n\tif beginning != nil {\n\t\treturn beginning.Value\n\t}\n\treturn nil\n}\n\n// Tail returns the last value in the tree\nfunc (t *Btree) Tail() Val {\n\tif t.root == nil {\n\t\treturn nil\n\t}\n\tvar beginning = t.root\n\tfor beginning.right != nil {\n\t\tbeginning = beginning.right\n\t}\n\tif beginning == nil {\n\t\tfor beginning.left != nil {\n\t\t\tbeginning = beginning.left\n\t\t}\n\t}\n\tif beginning != nil {\n\t\treturn beginning.Value\n\t}\n\treturn nil\n}\n\n// Values returns a slice of all the values in tree in order\nfunc (t *Btree) Values() []Val {\n\tif t.values == nil {\n\t\tt.values = make([]Val, t.len)\n\t\tt.Ascend(func(n *Node, i int) bool {\n\t\t\tt.values[i] = n.Value\n\t\t\treturn true\n\t\t})\n\t}\n\treturn t.values\n}\n\n// Delete deletes the node from the tree associated with the search value\nfunc (t *Btree) Delete(value Val) *Btree {\n\tdeleted := false\n\tt.root = deleteNode(t.root, value, &deleted)\n\tif deleted {\n\t\tt.len--\n\t}\n\tt.values = nil\n\treturn t\n}\n\n// DeleteAll deletes the nodes from the tree associated with the search values\nfunc (t *Btree) DeleteAll(values []Val) *Btree {\n\tfor _, v := range values {\n\t\tt.Delete(v)\n\t}\n\treturn t\n}\n\nfunc deleteNode(n *Node, value Val, deleted *bool) *Node {\n\tif n == nil {\n\t\treturn n\n\t}\n\n\tc := value.Comp(n.Value)\n\n\tif c < 0 {\n\t\tn.left = deleteNode(n.left, value, deleted)\n\t} else if c > 0 {\n\t\tn.right = deleteNode(n.right, value, deleted)\n\t} else {\n\t\tif n.left == nil {\n\t\t\tt := n.right\n\t\t\tn.Init()\n\t\t\treturn t\n\t\t} else if n.right == nil {\n\t\t\tt := n.left\n\t\t\tn.Init()\n\t\t\treturn t\n\t\t}\n\t\tt := n.right.min()\n\t\tn.Value = t.Value\n\t\tn.right = deleteNode(n.right, t.Value, deleted)\n\t\t*deleted = true\n\t}\n\n\t//re-balance\n\tif n == nil {\n\t\treturn n\n\t}\n\tn.height = n.maxHeight() + 1\n\tbal := balance(n)\n\tif bal > 1 {\n\t\tif balance(n.left) >= 0 {\n\t\t\treturn n.rotateRight()\n\t\t}\n\t\tn.left = n.left.rotateLeft()\n\t\treturn n.rotateRight()\n\t} else if bal < -1 {\n\t\tif balance(n.right) <= 0 {\n\t\t\treturn n.rotateLeft()\n\t\t}\n\t\tn.right = n.right.rotateRight()\n\t\treturn n.rotateLeft()\n\t}\n\n\treturn n\n}\n\n// Pop deletes the last node from the tree and returns its value\nfunc (t *Btree) Pop() Val {\n\tvalue := t.Tail()\n\tif value != nil {\n\t\tt.Delete(value)\n\t}\n\treturn value\n}\n\n// Pull deletes the first node from the tree and returns its value\nfunc (t *Btree) Pull() Val {\n\tvalue := t.Head()\n\tif value != nil {\n\t\tt.Delete(value)\n\t}\n\treturn value\n}\n\n// NodeIterator expresses the iterator function used for traversals\ntype NodeIterator func(n *Node, i int) bool\n\n// Ascend performs an ascending order traversal of the tree calling the iterator function on each node\n// the iterator will continue as long as the NodeIterator returns true\nfunc (t *Btree) Ascend(iterator NodeIterator) {\n\tvar i int\n\tif t.root != nil {\n\t\tt.root.iterate(iterator, &i, true)\n\t}\n}\n\n// Descend performs a descending order traversal of the tree using the iterator\n// the iterator will continue as long as the NodeIterator returns true\nfunc (t *Btree) Descend(iterator NodeIterator) {\n\tvar i int\n\tif t.root != nil {\n\t\tt.root.rIterate(iterator, &i, true)\n\t}\n}\n\n// Debug prints out useful debug information about the tree for debugging purposes\nfunc (t *Btree) Debug() {\n\tfmt.Println(\"----------------------------------------------------------------------------------------------\")\n\tif t.Empty() {\n\t\tfmt.Println(\"tree is empty\")\n\t} else {\n\t\tfmt.Println(t.Len(), \"elements\")\n\t}\n\n\tt.Ascend(func(n *Node, i int) bool {\n\t\tif t.root.Value == n.Value {\n\t\t\tfmt.Print(\"ROOT ** \")\n\t\t}\n\t\tn.Debug()\n\t\treturn true\n\t})\n\tfmt.Println(\"----------------------------------------------------------------------------------------------\")\n}\n\n// Init initializes the values of the node or clears the node and returns the node pointer\nfunc (n *Node) Init() *Node {\n\tn.height = 1\n\tn.left = nil\n\tn.right = nil\n\treturn n\n}\n\n// String returns a string representing the node\nfunc (n *Node) String() string {\n\treturn fmt.Sprint(n.Value)\n}\n\n// Debug prints out useful debug information about the tree node for debugging purposes\nfunc (n *Node) Debug() {\n\tvar children string\n\tif n.left == nil && n.right == nil {\n\t\tchildren = \"no children |\"\n\t} else if n.left != nil && n.right != nil {\n\t\tchildren = fmt.Sprint(\"left child:\", n.left.String(), \" right child:\", n.right.String())\n\t} else if n.right != nil {\n\t\tchildren = fmt.Sprint(\"right child:\", n.right.String())\n\t} else {\n\t\tchildren = fmt.Sprint(\"left child:\", n.left.String())\n\t}\n\n\tfmt.Println(n.String(), \"|\", \"height\", n.height, \"|\", \"balance\", balance(n), \"|\", children)\n}\n\nfunc height(n *Node) int8 {\n\tif n != nil {\n\t\treturn n.height\n\t}\n\treturn 0\n}\n\nfunc balance(n *Node) int8 {\n\tif n == nil {\n\t\treturn 0\n\t}\n\treturn height(n.left) - height(n.right)\n}\n\nfunc (n *Node) get(val Val) *Node {\n\tvar node *Node\n\tc := val.Comp(n.Value)\n\tif c < 0 {\n\t\tif n.left != nil {\n\t\t\tnode = n.left.get(val)\n\t\t}\n\t} else if c > 0 {\n\t\tif n.right != nil {\n\t\t\tnode = n.right.get(val)\n\t\t}\n\t} else {\n\t\tnode = n\n\t}\n\treturn node\n}\n\nfunc (n *Node) rotateRight() *Node {\n\tl := n.left\n\t// Rotation\n\tl.right, n.left = n, l.right\n\n\t// update heights\n\tn.height = n.maxHeight() + 1\n\tl.height = l.maxHeight() + 1\n\n\treturn l\n}\n\nfunc (n *Node) rotateLeft() *Node {\n\tr := n.right\n\t// Rotation\n\tr.left, n.right = n, r.left\n\n\t// update heights\n\tn.height = n.maxHeight() + 1\n\tr.height = r.maxHeight() + 1\n\n\treturn r\n}\n\nfunc (n *Node) iterate(iterator NodeIterator, i *int, cont bool) {\n\tif n != nil && cont {\n\t\tn.left.iterate(iterator, i, cont)\n\t\tcont = iterator(n, *i)\n\t\t*i++\n\t\tn.right.iterate(iterator, i, cont)\n\t}\n}\n\nfunc (n *Node) rIterate(iterator NodeIterator, i *int, cont bool) {\n\tif n != nil && cont {\n\t\tn.right.iterate(iterator, i, cont)\n\t\tcont = iterator(n, *i)\n\t\t*i++\n\t\tn.left.iterate(iterator, i, cont)\n\t}\n}\n\nfunc (n *Node) min() *Node {\n\tcurrent := n\n\tfor current.left != nil {\n\t\tcurrent = current.left\n\t}\n\treturn current\n}\n\nfunc (n *Node) maxHeight() int8 {\n\trh := height(n.right)\n\tlh := height(n.left)\n\tif rh > lh {\n\t\treturn rh\n\t}\n\treturn lh\n}\n\n// IntVal represents an integer tree val\ntype IntVal int\n\n// Comp returns 1 if i > val, -1 if i < val and 0 if i equal to val\nfunc (i IntVal) Comp(val Val) int8 {\n\tv := val.(IntVal)\n\tif i > v {\n\t\treturn 1\n\t} else if i < v {\n\t\treturn -1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, 1e+6)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\ta := make([]bc, n)\n\n\tfor i := range a {\n\t\ta[i].num = nextInt()\n\t\ta[i].value = nextInt()\n\t}\n\tsort.Sort(bcs(a))\n\t//debugf(\"%v\\n\", a)\n\tidx := 0\n\tans := 0\n\t/*\n\t\tb := make([]int, 0, n)\n\t\tfor i := 0; i < m; i++ {\n\t\t\tfor idx < n && a[idx].num <= i+1 {\n\t\t\t\tb = append(b, a[idx].value)\n\t\t\t\tidx++\n\t\t\t}\n\t\t\tsort.Sort(sort.Reverse(sort.IntSlice(b)))\n\t\t\tif len(b) > 0 {\n\t\t\t\tans += b[0]\n\t\t\t\tb[0] = 0\n\t\t\t}\n\t\t}\n\t*/\n\n\tb := new(Btree).Init()\n\n\t//debugf(\"%v\\n\", a)\n\tfor i := 0; i < m; i++ {\n\t\tfor idx < n && a[idx].num <= i+1 {\n\t\t\tb.Insert(IntVal(a[idx].value))\n\t\t\tidx++\n\t\t}\n\t\t//debugf(\"i: %d, ans: %d, %v\\n\", i, ans, b.String())\n\t\tn := b.Tail()\n\t\tif n != nil {\n\t\t\tans += int(n.(IntVal))\n\t\t\tb.Delete(n)\n\t\t}\n\t\t//debugf(\"end i: %d, ans: %d, %v\\n\", i, ans, b.String())\n\t}\n\n\t_, _ = fmt.Fprintf(writer, \"%d\", ans)\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "sample_input": "3 4\n4 3\n4 1\n2 2\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02948", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 11202, "cpu_time_ms": 117, "memory_kb": 5120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s324537600", "group_id": "codeNet:p02951", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n\ta, b int\n\tindex int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc main() {\n\tvar A, B, C int\n\tfmt.Scanf(\"%d %d %d\\n\", &A, &B, &C)\n\tremain := A - B\n\tif remain > C {\n\t\tfmt.Println(C)\n\t} else {\n\t\tfmt.Println(remain)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1587742668, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02951/input.txt", "sample_output_relpath": "derived/input_output/data/p02951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02951/Go/s324537600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s324537600", "user_id": "u534481484"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n\ta, b int\n\tindex int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc main() {\n\tvar A, B, C int\n\tfmt.Scanf(\"%d %d %d\\n\", &A, &B, &C)\n\tremain := A - B\n\tif remain > C {\n\t\tfmt.Println(C)\n\t} else {\n\t\tfmt.Println(remain)\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "sample_input": "6 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02951", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1420, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s653825562", "group_id": "codeNet:p02952", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumInt64(a []int64) int64 {\n\tvar ret int64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcdInt64(m, n int64) int64 {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcmInt64(m, n int64) int64 {\n\treturn m / gcdInt64(m, n) * n\n}\n\n// sort ------------------------------------------------------------\n\ntype int64Array []int64\n\nfunc (s int64Array) Len() int { return len(s) }\nfunc (s int64Array) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s int64Array) Less(i, j int) bool { return s[i] < s[j] }\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nfunc main() {\n\tn := readInt()\n\tans := 0\n\tfor i := 1; i < n+1; i++ {\n\t\ts := strconv.Itoa(i)\n\t\tif len(s)%2 == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1569337391, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02952.html", "problem_id": "p02952", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02952/input.txt", "sample_output_relpath": "derived/input_output/data/p02952/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02952/Go/s653825562.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s653825562", "user_id": "u295946532"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumInt64(a []int64) int64 {\n\tvar ret int64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcdInt64(m, n int64) int64 {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcmInt64(m, n int64) int64 {\n\treturn m / gcdInt64(m, n) * n\n}\n\n// sort ------------------------------------------------------------\n\ntype int64Array []int64\n\nfunc (s int64Array) Len() int { return len(s) }\nfunc (s int64Array) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s int64Array) Less(i, j int) bool { return s[i] < s[j] }\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nfunc main() {\n\tn := readInt()\n\tans := 0\n\tfor i := 1; i < n+1; i++ {\n\t\ts := strconv.Itoa(i)\n\t\tif len(s)%2 == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "sample_input": "11\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02952", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2461, "cpu_time_ms": 8, "memory_kb": 1152}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s291798483", "group_id": "codeNet:p02952", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\tnInt, _ := strconv.Atoi(n)\n\tans := 0\n\tfor i:=1; i 0 {\n\t\tif i/100000 != 0 {\n\t\t\ti = i - 1\n\t\t} else if i/10000 != 0 {\n\t\t\tif i == 10000 {\n\t\t\t\tresult++\n\t\t\t\ti--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult += ((i/10000)-1)*10000 + (i % 10000) + 1 //just 10000\n\t\t\ti = i % 10000\n\t\t} else if i/1000 != 0 {\n\t\t\tif i == 1000 {\n\t\t\t\ti--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ti = i % 1000\n\t\t} else if i/100 != 0 {\n\t\t\tif i == 100 {\n\t\t\t\tresult++\n\t\t\t\ti--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult += ((i/100)-1)*100 + (i % 100) + 1 //just 100\n\t\t\ti = i % 100\n\t\t} else if i/10 != 0 {\n\t\t\tresult += 9\n\t\t\tbreak\n\t\t} else {\n\t\t\tresult += i\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(result)\n}", "language": "Go", "metadata": {"date": 1564970192, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02952.html", "problem_id": "p02952", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02952/input.txt", "sample_output_relpath": "derived/input_output/data/p02952/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02952/Go/s856223338.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s856223338", "user_id": "u723383064"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t// Get a number from stdio and convert it\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\tresult := 0\n\tfor i > 0 {\n\t\tif i/100000 != 0 {\n\t\t\ti = i - 1\n\t\t} else if i/10000 != 0 {\n\t\t\tif i == 10000 {\n\t\t\t\tresult++\n\t\t\t\ti--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult += ((i/10000)-1)*10000 + (i % 10000) + 1 //just 10000\n\t\t\ti = i % 10000\n\t\t} else if i/1000 != 0 {\n\t\t\tif i == 1000 {\n\t\t\t\ti--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ti = i % 1000\n\t\t} else if i/100 != 0 {\n\t\t\tif i == 100 {\n\t\t\t\tresult++\n\t\t\t\ti--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult += ((i/100)-1)*100 + (i % 100) + 1 //just 100\n\t\t\ti = i % 100\n\t\t} else if i/10 != 0 {\n\t\t\tresult += 9\n\t\t\tbreak\n\t\t} else {\n\t\t\tresult += i\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(result)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "sample_input": "11\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02952", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 831, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s156301381", "group_id": "codeNet:p02954", "input_text": "// 自分(自分含む)より右側にある直近のLと自分(自分含む)より左側にある直近のRの位置を表す配列を作る\n// 10^100は偶数なので距離の偶奇で判別\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\trunes := []rune(s)\n\tLindiciesOfRight, RindiciesOfLeft := make([]int, len(runes)), make([]int, len(runes))\n\tLindiciesOfRight[len(runes)-1] = len(runes) - 1\n\tfor i := 1; i < len(runes); i++ {\n\t\tnow := string(runes[i])\n\t\tif now == \"R\" {\n\t\t\tRindiciesOfLeft[i] = i\n\t\t} else {\n\t\t\tRindiciesOfLeft[i] = RindiciesOfLeft[i-1]\n\t\t}\n\t}\n\tfor i := len(runes) - 2; i >= 0; i-- {\n\t\tnow := string(runes[i])\n\t\tif now == \"L\" {\n\t\t\tLindiciesOfRight[i] = i\n\t\t} else {\n\t\t\tLindiciesOfRight[i] = LindiciesOfRight[i+1]\n\t\t}\n\t}\n\tans := make([]int, len(runes))\n\tfor i := 0; i < len(runes); i++ {\n\t\tnow := string(runes[i])\n\t\tif now == \"R\" {\n\t\t\tdist := LindiciesOfRight[i] - i\n\t\t\tif dist%2 == 0 {\n\t\t\t\tans[LindiciesOfRight[i]]++\n\t\t\t} else {\n\t\t\t\tans[LindiciesOfRight[i]-1]++\n\t\t\t}\n\t\t} else {\n\t\t\tdist := i - RindiciesOfLeft[i]\n\t\t\tif dist%2 == 0 {\n\t\t\t\tans[RindiciesOfLeft[i]]++\n\t\t\t} else {\n\t\t\t\tans[RindiciesOfLeft[i]+1]++\n\t\t\t}\n\t\t}\n\t}\n\tfor i, a := range ans {\n\t\tfmt.Print(a)\n\t\tif i == len(ans)-1 {\n\t\t\tfmt.Println()\n\t\t} else {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586445635, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02954.html", "problem_id": "p02954", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02954/input.txt", "sample_output_relpath": "derived/input_output/data/p02954/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02954/Go/s156301381.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s156301381", "user_id": "u445624660"}, "prompt_components": {"gold_output": "0 1 2 1 1\n", "input_to_evaluate": "// 自分(自分含む)より右側にある直近のLと自分(自分含む)より左側にある直近のRの位置を表す配列を作る\n// 10^100は偶数なので距離の偶奇で判別\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\trunes := []rune(s)\n\tLindiciesOfRight, RindiciesOfLeft := make([]int, len(runes)), make([]int, len(runes))\n\tLindiciesOfRight[len(runes)-1] = len(runes) - 1\n\tfor i := 1; i < len(runes); i++ {\n\t\tnow := string(runes[i])\n\t\tif now == \"R\" {\n\t\t\tRindiciesOfLeft[i] = i\n\t\t} else {\n\t\t\tRindiciesOfLeft[i] = RindiciesOfLeft[i-1]\n\t\t}\n\t}\n\tfor i := len(runes) - 2; i >= 0; i-- {\n\t\tnow := string(runes[i])\n\t\tif now == \"L\" {\n\t\t\tLindiciesOfRight[i] = i\n\t\t} else {\n\t\t\tLindiciesOfRight[i] = LindiciesOfRight[i+1]\n\t\t}\n\t}\n\tans := make([]int, len(runes))\n\tfor i := 0; i < len(runes); i++ {\n\t\tnow := string(runes[i])\n\t\tif now == \"R\" {\n\t\t\tdist := LindiciesOfRight[i] - i\n\t\t\tif dist%2 == 0 {\n\t\t\t\tans[LindiciesOfRight[i]]++\n\t\t\t} else {\n\t\t\t\tans[LindiciesOfRight[i]-1]++\n\t\t\t}\n\t\t} else {\n\t\t\tdist := i - RindiciesOfLeft[i]\n\t\t\tif dist%2 == 0 {\n\t\t\t\tans[RindiciesOfLeft[i]]++\n\t\t\t} else {\n\t\t\t\tans[RindiciesOfLeft[i]+1]++\n\t\t\t}\n\t\t}\n\t}\n\tfor i, a := range ans {\n\t\tfmt.Print(a)\n\t\tif i == len(ans)-1 {\n\t\t\tfmt.Println()\n\t\t} else {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "sample_input": "RRLRL\n"}, "reference_outputs": ["0 1 2 1 1\n"], "source_document_id": "p02954", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1288, "cpu_time_ms": 477, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s891646696", "group_id": "codeNet:p02954", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc reverseInts(input []int) []int {\n\tif len(input) == 0 {\n\t\treturn input\n\t}\n\treturn append(reverseInts(input[1:]), input[0])\n}\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tvar N []int = make([]int, len(S))\n\n\tfor i := 0; i < 2; i++ {\n\t\tcnt := 0\n\t\tfor j, s := range S {\n\t\t\tif string([]rune{s}) == \"R\" {\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tN[j] += cnt / 2\n\t\t\t\tN[j-1] += (cnt + 1) / 2\n\t\t\t\tcnt = 0\n\t\t\t}\n\t\t}\n\t\tN = reverseInts(N)\n\t\tS = Reverse(S)\n\t\trev := \"\"\n\t\tfor _, s := range S {\n\t\t\tif string([]rune{s}) == \"L\" {\n\t\t\t\trev += \"R\"\n\t\t\t} else {\n\t\t\t\trev += \"L\"\n\t\t\t}\n\t\t}\n\t\tS = rev\n\t}\n\n\tfor _, i := range N {\n\t\tfmt.Print(i, \" \")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1565361310, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02954.html", "problem_id": "p02954", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02954/input.txt", "sample_output_relpath": "derived/input_output/data/p02954/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02954/Go/s891646696.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s891646696", "user_id": "u058781705"}, "prompt_components": {"gold_output": "0 1 2 1 1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc reverseInts(input []int) []int {\n\tif len(input) == 0 {\n\t\treturn input\n\t}\n\treturn append(reverseInts(input[1:]), input[0])\n}\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tvar N []int = make([]int, len(S))\n\n\tfor i := 0; i < 2; i++ {\n\t\tcnt := 0\n\t\tfor j, s := range S {\n\t\t\tif string([]rune{s}) == \"R\" {\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tN[j] += cnt / 2\n\t\t\t\tN[j-1] += (cnt + 1) / 2\n\t\t\t\tcnt = 0\n\t\t\t}\n\t\t}\n\t\tN = reverseInts(N)\n\t\tS = Reverse(S)\n\t\trev := \"\"\n\t\tfor _, s := range S {\n\t\t\tif string([]rune{s}) == \"L\" {\n\t\t\t\trev += \"R\"\n\t\t\t} else {\n\t\t\t\trev += \"L\"\n\t\t\t}\n\t\t}\n\t\tS = rev\n\t}\n\n\tfor _, i := range N {\n\t\tfmt.Print(i, \" \")\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "sample_input": "RRLRL\n"}, "reference_outputs": ["0 1 2 1 1\n"], "source_document_id": "p02954", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 823, "cpu_time_ms": 2108, "memory_kb": 52480}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s427268281", "group_id": "codeNet:p02955", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn, k := iScan(), iScan()\n\ta := iSScan(n)\n\tx := sum(a)\n\td := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\td = append(d, i)\n\t\t\tif i != x/i {\n\t\t\t\td = append(d, x/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(d)))\n\tfor _, v := range d {\n\t\ty := make([]int, n)\n\t\tz := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\ty[i] = a[i] % v\n\t\t}\n\t\tsort.Ints(y)\n\t\tyy := make([]int, n)\n\t\tcopy(yy, y)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tz[i] = v - y[i]\n\t\t}\n\t\tfor i := 1; i < n; i++ {\n\t\t\ty[i] += y[i-1]\n\t\t}\n\t\tfor i := n - 2; i >= 0; i-- {\n\t\t\tz[i] += z[i+1]\n\t\t}\n\t\tc := 0\n\t\tfor i := 0; i < n-1; i++ {\n\t\t\tc += yy[i]\n\t\t\tif y[i] == z[i+1] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif c <= k {\n\t\t\tfmt.Println(v)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598159192, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02955.html", "problem_id": "p02955", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02955/input.txt", "sample_output_relpath": "derived/input_output/data/p02955/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02955/Go/s427268281.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s427268281", "user_id": "u843722521"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn, k := iScan(), iScan()\n\ta := iSScan(n)\n\tx := sum(a)\n\td := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\td = append(d, i)\n\t\t\tif i != x/i {\n\t\t\t\td = append(d, x/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(d)))\n\tfor _, v := range d {\n\t\ty := make([]int, n)\n\t\tz := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\ty[i] = a[i] % v\n\t\t}\n\t\tsort.Ints(y)\n\t\tyy := make([]int, n)\n\t\tcopy(yy, y)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tz[i] = v - y[i]\n\t\t}\n\t\tfor i := 1; i < n; i++ {\n\t\t\ty[i] += y[i-1]\n\t\t}\n\t\tfor i := n - 2; i >= 0; i-- {\n\t\t\tz[i] += z[i+1]\n\t\t}\n\t\tc := 0\n\t\tfor i := 0; i < n-1; i++ {\n\t\t\tc += yy[i]\n\t\t\tif y[i] == z[i+1] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif c <= k {\n\t\t\tfmt.Println(v)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a sequence of N integers: A_1, A_2, \\cdots, A_N.\n\nYou can perform the following operation between 0 and K times (inclusive):\n\nChoose two integers i and j such that i \\neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.\n\nCompute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz.\n\nConstraints\n\n2 \\leq N \\leq 500\n\n1 \\leq A_i \\leq 10^6\n\n0 \\leq K \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\cdots A_{N-1} A_{N}\n\nOutput\n\nPrint the maximum possible positive integer that divides every element of A after the operations.\n\nSample Input 1\n\n2 3\n8 20\n\nSample Output 1\n\n7\n\n7 will divide every element of A if, for example, we perform the following operation:\n\nChoose i = 2, j = 1. A becomes (7, 21).\n\nWe cannot reach the situation where 8 or greater integer divides every element of A.\n\nSample Input 2\n\n2 10\n3 5\n\nSample Output 2\n\n8\n\nConsider performing the following five operations:\n\nChoose i = 2, j = 1. A becomes (2, 6).\n\nChoose i = 2, j = 1. A becomes (1, 7).\n\nChoose i = 2, j = 1. A becomes (0, 8).\n\nChoose i = 2, j = 1. A becomes (-1, 9).\n\nChoose i = 1, j = 2. A becomes (0, 8).\n\nThen, 0 = 8 \\times 0 and 8 = 8 \\times 1, so 8 divides every element of A. We cannot reach the situation where 9 or greater integer divides every element of A.\n\nSample Input 3\n\n4 5\n10 1 2 22\n\nSample Output 3\n\n7\n\nSample Input 4\n\n8 7\n1 7 5 6 8 2 6 5\n\nSample Output 4\n\n5", "sample_input": "2 3\n8 20\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02955", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a sequence of N integers: A_1, A_2, \\cdots, A_N.\n\nYou can perform the following operation between 0 and K times (inclusive):\n\nChoose two integers i and j such that i \\neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.\n\nCompute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz.\n\nConstraints\n\n2 \\leq N \\leq 500\n\n1 \\leq A_i \\leq 10^6\n\n0 \\leq K \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\cdots A_{N-1} A_{N}\n\nOutput\n\nPrint the maximum possible positive integer that divides every element of A after the operations.\n\nSample Input 1\n\n2 3\n8 20\n\nSample Output 1\n\n7\n\n7 will divide every element of A if, for example, we perform the following operation:\n\nChoose i = 2, j = 1. A becomes (7, 21).\n\nWe cannot reach the situation where 8 or greater integer divides every element of A.\n\nSample Input 2\n\n2 10\n3 5\n\nSample Output 2\n\n8\n\nConsider performing the following five operations:\n\nChoose i = 2, j = 1. A becomes (2, 6).\n\nChoose i = 2, j = 1. A becomes (1, 7).\n\nChoose i = 2, j = 1. A becomes (0, 8).\n\nChoose i = 2, j = 1. A becomes (-1, 9).\n\nChoose i = 1, j = 2. A becomes (0, 8).\n\nThen, 0 = 8 \\times 0 and 8 = 8 \\times 1, so 8 divides every element of A. We cannot reach the situation where 9 or greater integer divides every element of A.\n\nSample Input 3\n\n4 5\n10 1 2 22\n\nSample Output 3\n\n7\n\nSample Input 4\n\n8 7\n1 7 5 6 8 2 6 5\n\nSample Output 4\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2000, "cpu_time_ms": 77, "memory_kb": 6340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s353480591", "group_id": "codeNet:p02955", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn, k := io.Int(), io.Int()\n\n\taa := make([]int, n)\n\n\tsum := 0\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = io.Int()\n\t\tsum += aa[i]\n\t}\n\n\tpossibe := Divisors(sum)\n\n\tSortDesc(possibe)\n\n\tans := calc(possibe, aa, k)\n\n\tfmt.Println(ans)\n\n}\n\nfunc calc(possibe []int, aa []int, k int) int {\n\t//fmt.Println(-9 % 8)\n\tans := 1\n\tfor _, p := range possibe {\n\t\tcnt := 0\n\n\t\tfor _, a := range aa {\n\t\t\tcnt += a % p\n\t\t}\n\n\t\tif cnt/2 == k {\n\t\t\tans = p\n\t\t\tbreak\n\n\t\t}\n\n\t}\n\treturn ans\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) Int() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) Float() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc Abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc Pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc Min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc Max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc SortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc SortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / GCD(a, b)\n}\n\nfunc CumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n\nfunc BisectLeft(nums []int, left, right int, target int) int {\n\tif left == right {\n\t\tif nums[left] == target {\n\t\t\treturn left\n\t\t} else if nums[left] < target {\n\t\t\treturn left + 1\n\t\t} else {\n\t\t\treturn left\n\t\t}\n\t}\n\n\tmid := (left + right) / 2\n\tif nums[mid] == target {\n\t\treturn mid\n\t}\n\n\tif nums[mid] > target {\n\t\treturn BisectLeft(nums, left, mid, target)\n\t} else if nums[mid] < target {\n\t\treturn BisectLeft(nums, mid+1, right, target)\n\t}\n\treturn 0\n}\n\nfunc Permutations(nums []int) [][]int {\n\tn := len(nums)\n\tif n == 0 {\n\t\treturn [][]int{}\n\t}\n\tans := [][]int{}\n\n\tfor _, n := range nums {\n\t\trest := remove(nums, n)\n\t\tlists := Permutations(rest)\n\t\tif len(lists) == 0 {\n\t\t\tlists = [][]int{nil}\n\t\t}\n\n\t\tfor i := 0; i < len(lists); i++ {\n\t\t\tlists[i] = append(lists[i], n)\n\t\t\tans = append(ans, lists[i])\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc remove(nums []int, target int) []int {\n\tresult := []int{}\n\tfor i := 0; i < len(nums); i++ {\n\t\tif nums[i] != target {\n\t\t\tresult = append(result, nums[i])\n\t\t}\n\t}\n\treturn result\n}\n\nfunc PowerSet(nums []int) [][]int {\n\tsize := Pow(2, len(nums))\n\tresult := make([][]int, size)\n\n\tidx := 0\n\tresult[idx] = []int{}\n\tidx++\n\n\tfor _, n := range nums {\n\t\tmax := idx\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[idx] = copyAndAppend(result[i], n)\n\t\t\tidx++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc Combination(nums []int, k int) [][]int {\n\tsize := len(nums)\n\tresult := make([][]int, CombinationCount(len(nums), k))\n\tbi := (1 << uint(k)) - 1\n\tmax := 1 << uint(size)\n\tidx := 0\n\n\tfor bi < max {\n\t\tflags := bi\n\t\ts := []int{}\n\t\tfor _, n := range nums {\n\t\t\tif flags%2 != 0 {\n\t\t\t\ts = append(s, n)\n\t\t\t}\n\t\t\tflags /= 2\n\t\t}\n\t\tresult[idx] = s\n\t\tidx++\n\t\tbi = Combination2NextIndex(bi)\n\t}\n\treturn result\n}\n\nfunc Combination2NextIndex(n int) int {\n\tsmallest := n & -n\n\tripple := n + smallest\n\tnewSmallest := ripple & -ripple\n\tones := ((newSmallest / smallest) >> 1) - 1\n\treturn ripple | ones\n}\n\nfunc CombinationCount(n, m int) int {\n\treturn Fact(n) / (Fact(n-m) * Fact(m))\n}\n\nfunc Fact(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn n * Fact(n-1)\n\t}\n}\n\nfunc Divisors(n int) []int {\n\tdivisors := map[int]bool{}\n\tfor i := 1; i < int(math.Sqrt(float64(n)))+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisors[i] = true\n\t\t\t//divisors = append(divisors, i)\n\t\t\tif i != n {\n\t\t\t\tdivisors[n/i] = true\n\t\t\t\t//divisors = append(divisors, n/i)\n\t\t\t}\n\t\t}\n\n\t}\n\tans := []int{}\n\tfor k := range divisors {\n\t\tans = append(ans, k)\n\t}\n\treturn ans\n}\n", "language": "Go", "metadata": {"date": 1564977004, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02955.html", "problem_id": "p02955", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02955/input.txt", "sample_output_relpath": "derived/input_output/data/p02955/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02955/Go/s353480591.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s353480591", "user_id": "u134387396"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn, k := io.Int(), io.Int()\n\n\taa := make([]int, n)\n\n\tsum := 0\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = io.Int()\n\t\tsum += aa[i]\n\t}\n\n\tpossibe := Divisors(sum)\n\n\tSortDesc(possibe)\n\n\tans := calc(possibe, aa, k)\n\n\tfmt.Println(ans)\n\n}\n\nfunc calc(possibe []int, aa []int, k int) int {\n\t//fmt.Println(-9 % 8)\n\tans := 1\n\tfor _, p := range possibe {\n\t\tcnt := 0\n\n\t\tfor _, a := range aa {\n\t\t\tcnt += a % p\n\t\t}\n\n\t\tif cnt/2 == k {\n\t\t\tans = p\n\t\t\tbreak\n\n\t\t}\n\n\t}\n\treturn ans\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) Int() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) Float() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc Abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc Pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc Min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc Max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc SortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc SortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / GCD(a, b)\n}\n\nfunc CumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n\nfunc BisectLeft(nums []int, left, right int, target int) int {\n\tif left == right {\n\t\tif nums[left] == target {\n\t\t\treturn left\n\t\t} else if nums[left] < target {\n\t\t\treturn left + 1\n\t\t} else {\n\t\t\treturn left\n\t\t}\n\t}\n\n\tmid := (left + right) / 2\n\tif nums[mid] == target {\n\t\treturn mid\n\t}\n\n\tif nums[mid] > target {\n\t\treturn BisectLeft(nums, left, mid, target)\n\t} else if nums[mid] < target {\n\t\treturn BisectLeft(nums, mid+1, right, target)\n\t}\n\treturn 0\n}\n\nfunc Permutations(nums []int) [][]int {\n\tn := len(nums)\n\tif n == 0 {\n\t\treturn [][]int{}\n\t}\n\tans := [][]int{}\n\n\tfor _, n := range nums {\n\t\trest := remove(nums, n)\n\t\tlists := Permutations(rest)\n\t\tif len(lists) == 0 {\n\t\t\tlists = [][]int{nil}\n\t\t}\n\n\t\tfor i := 0; i < len(lists); i++ {\n\t\t\tlists[i] = append(lists[i], n)\n\t\t\tans = append(ans, lists[i])\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc remove(nums []int, target int) []int {\n\tresult := []int{}\n\tfor i := 0; i < len(nums); i++ {\n\t\tif nums[i] != target {\n\t\t\tresult = append(result, nums[i])\n\t\t}\n\t}\n\treturn result\n}\n\nfunc PowerSet(nums []int) [][]int {\n\tsize := Pow(2, len(nums))\n\tresult := make([][]int, size)\n\n\tidx := 0\n\tresult[idx] = []int{}\n\tidx++\n\n\tfor _, n := range nums {\n\t\tmax := idx\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[idx] = copyAndAppend(result[i], n)\n\t\t\tidx++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc Combination(nums []int, k int) [][]int {\n\tsize := len(nums)\n\tresult := make([][]int, CombinationCount(len(nums), k))\n\tbi := (1 << uint(k)) - 1\n\tmax := 1 << uint(size)\n\tidx := 0\n\n\tfor bi < max {\n\t\tflags := bi\n\t\ts := []int{}\n\t\tfor _, n := range nums {\n\t\t\tif flags%2 != 0 {\n\t\t\t\ts = append(s, n)\n\t\t\t}\n\t\t\tflags /= 2\n\t\t}\n\t\tresult[idx] = s\n\t\tidx++\n\t\tbi = Combination2NextIndex(bi)\n\t}\n\treturn result\n}\n\nfunc Combination2NextIndex(n int) int {\n\tsmallest := n & -n\n\tripple := n + smallest\n\tnewSmallest := ripple & -ripple\n\tones := ((newSmallest / smallest) >> 1) - 1\n\treturn ripple | ones\n}\n\nfunc CombinationCount(n, m int) int {\n\treturn Fact(n) / (Fact(n-m) * Fact(m))\n}\n\nfunc Fact(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn n * Fact(n-1)\n\t}\n}\n\nfunc Divisors(n int) []int {\n\tdivisors := map[int]bool{}\n\tfor i := 1; i < int(math.Sqrt(float64(n)))+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisors[i] = true\n\t\t\t//divisors = append(divisors, i)\n\t\t\tif i != n {\n\t\t\t\tdivisors[n/i] = true\n\t\t\t\t//divisors = append(divisors, n/i)\n\t\t\t}\n\t\t}\n\n\t}\n\tans := []int{}\n\tfor k := range divisors {\n\t\tans = append(ans, k)\n\t}\n\treturn ans\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a sequence of N integers: A_1, A_2, \\cdots, A_N.\n\nYou can perform the following operation between 0 and K times (inclusive):\n\nChoose two integers i and j such that i \\neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.\n\nCompute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz.\n\nConstraints\n\n2 \\leq N \\leq 500\n\n1 \\leq A_i \\leq 10^6\n\n0 \\leq K \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\cdots A_{N-1} A_{N}\n\nOutput\n\nPrint the maximum possible positive integer that divides every element of A after the operations.\n\nSample Input 1\n\n2 3\n8 20\n\nSample Output 1\n\n7\n\n7 will divide every element of A if, for example, we perform the following operation:\n\nChoose i = 2, j = 1. A becomes (7, 21).\n\nWe cannot reach the situation where 8 or greater integer divides every element of A.\n\nSample Input 2\n\n2 10\n3 5\n\nSample Output 2\n\n8\n\nConsider performing the following five operations:\n\nChoose i = 2, j = 1. A becomes (2, 6).\n\nChoose i = 2, j = 1. A becomes (1, 7).\n\nChoose i = 2, j = 1. A becomes (0, 8).\n\nChoose i = 2, j = 1. A becomes (-1, 9).\n\nChoose i = 1, j = 2. A becomes (0, 8).\n\nThen, 0 = 8 \\times 0 and 8 = 8 \\times 1, so 8 divides every element of A. We cannot reach the situation where 9 or greater integer divides every element of A.\n\nSample Input 3\n\n4 5\n10 1 2 22\n\nSample Output 3\n\n7\n\nSample Input 4\n\n8 7\n1 7 5 6 8 2 6 5\n\nSample Output 4\n\n5", "sample_input": "2 3\n8 20\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02955", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a sequence of N integers: A_1, A_2, \\cdots, A_N.\n\nYou can perform the following operation between 0 and K times (inclusive):\n\nChoose two integers i and j such that i \\neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.\n\nCompute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz.\n\nConstraints\n\n2 \\leq N \\leq 500\n\n1 \\leq A_i \\leq 10^6\n\n0 \\leq K \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\cdots A_{N-1} A_{N}\n\nOutput\n\nPrint the maximum possible positive integer that divides every element of A after the operations.\n\nSample Input 1\n\n2 3\n8 20\n\nSample Output 1\n\n7\n\n7 will divide every element of A if, for example, we perform the following operation:\n\nChoose i = 2, j = 1. A becomes (7, 21).\n\nWe cannot reach the situation where 8 or greater integer divides every element of A.\n\nSample Input 2\n\n2 10\n3 5\n\nSample Output 2\n\n8\n\nConsider performing the following five operations:\n\nChoose i = 2, j = 1. A becomes (2, 6).\n\nChoose i = 2, j = 1. A becomes (1, 7).\n\nChoose i = 2, j = 1. A becomes (0, 8).\n\nChoose i = 2, j = 1. A becomes (-1, 9).\n\nChoose i = 1, j = 2. A becomes (0, 8).\n\nThen, 0 = 8 \\times 0 and 8 = 8 \\times 1, so 8 divides every element of A. We cannot reach the situation where 9 or greater integer divides every element of A.\n\nSample Input 3\n\n4 5\n10 1 2 22\n\nSample Output 3\n\n7\n\nSample Input 4\n\n8 7\n1 7 5 6 8 2 6 5\n\nSample Output 4\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5682, "cpu_time_ms": 9, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s574871276", "group_id": "codeNet:p02957", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc findK(a, b int) string {\n\tsum := a + b\n\tif sum%2 == 1 {\n\t\treturn \"IMPOSSIBLE\"\n\t}\n\treturn strconv.Itoa(sum / 2)\n}\n\nfunc main() {\n\ta, b := nextInt(), nextInt()\n\tr := findK(a, b)\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1571848045, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02957.html", "problem_id": "p02957", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02957/input.txt", "sample_output_relpath": "derived/input_output/data/p02957/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02957/Go/s574871276.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s574871276", "user_id": "u727347518"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc findK(a, b int) string {\n\tsum := a + b\n\tif sum%2 == 1 {\n\t\treturn \"IMPOSSIBLE\"\n\t}\n\treturn strconv.Itoa(sum / 2)\n}\n\nfunc main() {\n\ta, b := nextInt(), nextInt()\n\tr := findK(a, b)\n\tfmt.Println(r)\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "sample_input": "2 16\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02957", "source_text": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 490, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s328402718", "group_id": "codeNet:p02958", "input_text": "//go:generate echo \"https://atcoder.jp/contests/abc135/tasks/abc135_b\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scan = newScanner(os.Stdin)\n\nfunc solve(ps []int) bool {\n\tcps := make([]int, len(ps), len(ps))\n\tcopy(cps, ps)\n\tsort.Sort(sort.IntSlice(cps))\n\tc := 0\n\tfor i := range cps {\n\t\tif cps[i] != ps[i] {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c <= 2\n}\n\nfunc solve2(ps []int) bool {\n\tk := 0\n\tfor i, p := range ps {\n\t\tif i != p-1 {\n\t\t\tk++\n\t\t}\n\t}\n\treturn k <= 2\n}\n\nfunc main() {\n\tN := scan.Int()\n\tps := scan.Ints(N)\n\tif solve2(ps) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Float64s(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc isum(X []int) int {\n\ts := 0\n\tfor _, x := range X {\n\t\ts += x\n\t}\n\treturn s\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "language": "Go", "metadata": {"date": 1601067581, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/Go/s328402718.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s328402718", "user_id": "u890085018"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/abc135/tasks/abc135_b\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scan = newScanner(os.Stdin)\n\nfunc solve(ps []int) bool {\n\tcps := make([]int, len(ps), len(ps))\n\tcopy(cps, ps)\n\tsort.Sort(sort.IntSlice(cps))\n\tc := 0\n\tfor i := range cps {\n\t\tif cps[i] != ps[i] {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c <= 2\n}\n\nfunc solve2(ps []int) bool {\n\tk := 0\n\tfor i, p := range ps {\n\t\tif i != p-1 {\n\t\t\tk++\n\t\t}\n\t}\n\treturn k <= 2\n}\n\nfunc main() {\n\tN := scan.Int()\n\tps := scan.Ints(N)\n\tif solve2(ps) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Float64s(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc isum(X []int) int {\n\ts := 0\n\tfor _, x := range X {\n\t\ts += x\n\t}\n\treturn s\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4842, "cpu_time_ms": 7, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s829098082", "group_id": "codeNet:p02958", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\tP := sc.nextIntSlice(N)\n\tcount := 0\n\tfor i, n := range P {\n\t\tif n != i+1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count <= 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1574909555, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/Go/s829098082.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s829098082", "user_id": "u924691798"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\tP := sc.nextIntSlice(N)\n\tcount := 0\n\tfor i, n := range P {\n\t\tif n != i+1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count <= 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1245, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s237012804", "group_id": "codeNet:p02958", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc lineToInts(line string) []int {\n\tvar array []int\n\tfor _, s := range strings.Split(line, \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tarray = append(array, i)\n\t}\n\treturn array\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tp := lineToInts(readLine())\n\tcounter := 0\n\tfor i := 0; i < len(p); i++ {\n\t\tif p[i] != i + 1 {\n\t\t\tcounter++\n\t\t\tif counter > 2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif counter > 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564599112, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/Go/s237012804.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s237012804", "user_id": "u667458133"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc lineToInts(line string) []int {\n\tvar array []int\n\tfor _, s := range strings.Split(line, \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tarray = append(array, i)\n\t}\n\treturn array\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tp := lineToInts(readLine())\n\tcounter := 0\n\tfor i := 0; i < len(p); i++ {\n\t\tif p[i] != i + 1 {\n\t\t\tcounter++\n\t\t\tif counter > 2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif counter > 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 600, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s271535477", "group_id": "codeNet:p02958", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tinput := bufio.NewReader(os.Stdin)\n\n\tvar N int\n\tfmt.Fscanf(input, \"%d\\n\", &N)\n\tvar count int\n\tfor i := 0; i < N; i++ {\n\t\tvar pi int\n\t\tfmt.Fscanf(input, \"%d\", &pi)\n\t\tif pi != i+1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count > 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564284564, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/Go/s271535477.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s271535477", "user_id": "u419255487"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tinput := bufio.NewReader(os.Stdin)\n\n\tvar N int\n\tfmt.Fscanf(input, \"%d\\n\", &N)\n\tvar count int\n\tfor i := 0; i < N; i++ {\n\t\tvar pi int\n\t\tfmt.Fscanf(input, \"%d\", &pi)\n\t\tif pi != i+1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count > 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s997855470", "group_id": "codeNet:p02958", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tp := make([]int, n)\n\tfor i := range p {\n\t\tfmt.Scan(&p[i])\n\t}\n\n\tcnt := 0\n\tfor i := range p {\n\t\tv := p[i]\n\t\tif v == i+1 {\n\t\t\tcontinue\n\t\t}\n\t\tcnt++\n\t}\n\tif cnt == 0 || cnt == 2 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n", "language": "Go", "metadata": {"date": 1564278602, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/Go/s997855470.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s997855470", "user_id": "u461993794"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tp := make([]int, n)\n\tfor i := range p {\n\t\tfmt.Scan(&p[i])\n\t}\n\n\tcnt := 0\n\tfor i := range p {\n\t\tv := p[i]\n\t\tif v == i+1 {\n\t\t\tcontinue\n\t\t}\n\t\tcnt++\n\t}\n\tif cnt == 0 || cnt == 2 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 297, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s429606198", "group_id": "codeNet:p02958", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tp := make([]int, N)\n\tp_bef := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tt, _ := strconv.Atoi(read())\n\t\tp[i] = t\n\t\tp_bef[i] = t\n\t}\n\tsort.Ints(p_bef)\n\n\tfor i := 1; i < N; i++ {\n\t\tif p[i] != p_bef[i] {\n\t\t\tcnt++\n\t\t\tif 2 <= cnt {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1564277718, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/Go/s429606198.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s429606198", "user_id": "u266742706"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tp := make([]int, N)\n\tp_bef := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tt, _ := strconv.Atoi(read())\n\t\tp[i] = t\n\t\tp_bef[i] = t\n\t}\n\tsort.Ints(p_bef)\n\n\tfor i := 1; i < N; i++ {\n\t\tif p[i] != p_bef[i] {\n\t\t\tcnt++\n\t\t\tif 2 <= cnt {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2932, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s940933605", "group_id": "codeNet:p02958", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tp := make([]int, N)\n\tp_bef := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tt, _ := strconv.Atoi(read())\n\t\tp[i] = t\n\t\tp_bef[i] = t\n\t}\n\n\tvar value, key int\n\tvar flag bool\n\tfor i := 1; i < N; i++ {\n\t\tif p[i-1] > p[i] && flag == false {\n\t\t\tvalue = p[i-1]\n\t\t\tkey = i - 1\n\t\t\tflag = true\n\t\t}\n\t\tif flag == true && value < p[i] {\n\t\t\tp[i], p[key] = p[key], p[i]\n\t\t\tbreak\n\t\t}\n\t\tif i == N-1 {\n\t\t\tp[i], p[key] = p[key], p[i]\n\t\t}\n\t}\n\n\tsort.Ints(p_bef)\n\n\tfor i := 0; i < N; i++ {\n\t\tif p[i] != p_bef[i] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1564276857, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/Go/s940933605.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s940933605", "user_id": "u266742706"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tp := make([]int, N)\n\tp_bef := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tt, _ := strconv.Atoi(read())\n\t\tp[i] = t\n\t\tp_bef[i] = t\n\t}\n\n\tvar value, key int\n\tvar flag bool\n\tfor i := 1; i < N; i++ {\n\t\tif p[i-1] > p[i] && flag == false {\n\t\t\tvalue = p[i-1]\n\t\t\tkey = i - 1\n\t\t\tflag = true\n\t\t}\n\t\tif flag == true && value < p[i] {\n\t\t\tp[i], p[key] = p[key], p[i]\n\t\t\tbreak\n\t\t}\n\t\tif i == N-1 {\n\t\t\tp[i], p[key] = p[key], p[i]\n\t\t}\n\t}\n\n\tsort.Ints(p_bef)\n\n\tfor i := 0; i < N; i++ {\n\t\tif p[i] != p_bef[i] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3186, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s898963194", "group_id": "codeNet:p02959", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readi()\n\ta := make([]int64, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\ta[i] = readi64()\n\t}\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readi64()\n\t}\n\n\tvar ans int64\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] <= b[i] {\n\t\t\tans = ans + a[i]\n\t\t\ttmp := (b[i] - a[i])\n\t\t\tif a[i]+1 <= tmp {\n\t\t\t\tans = ans + a[i+1]\n\t\t\t\ta[i+1] = 0\n\t\t\t} else {\n\t\t\t\tans = ans + tmp\n\t\t\t\ta[i+1] = a[i+1] - tmp\n\t\t\t}\n\t\t} else {\n\t\t\tans = ans + b[i]\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc comb(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n\n\tCOMB_MAX = 510000\n)\n\nvar (\n\treadString func() string\n)\n\nvar (\n\tfac = [COMB_MAX]int{}\n\tfinv = [COMB_MAX]int{}\n\tinv = [COMB_MAX]int{}\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\nfunc combInit() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < COMB_MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590896937, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02959.html", "problem_id": "p02959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02959/input.txt", "sample_output_relpath": "derived/input_output/data/p02959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02959/Go/s898963194.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s898963194", "user_id": "u183912232"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readi()\n\ta := make([]int64, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\ta[i] = readi64()\n\t}\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readi64()\n\t}\n\n\tvar ans int64\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] <= b[i] {\n\t\t\tans = ans + a[i]\n\t\t\ttmp := (b[i] - a[i])\n\t\t\tif a[i]+1 <= tmp {\n\t\t\t\tans = ans + a[i+1]\n\t\t\t\ta[i+1] = 0\n\t\t\t} else {\n\t\t\t\tans = ans + tmp\n\t\t\t\ta[i+1] = a[i+1] - tmp\n\t\t\t}\n\t\t} else {\n\t\t\tans = ans + b[i]\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc comb(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n\n\tCOMB_MAX = 510000\n)\n\nvar (\n\treadString func() string\n)\n\nvar (\n\tfac = [COMB_MAX]int{}\n\tfinv = [COMB_MAX]int{}\n\tinv = [COMB_MAX]int{}\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\nfunc combInit() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < COMB_MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "sample_input": "2\n3 5 2\n4 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02959", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3143, "cpu_time_ms": 57, "memory_kb": 4608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s884124744", "group_id": "codeNet:p02959", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() uint64 {\n\tsc.Scan()\n\ti, e := strconv.ParseUint(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc intArray(n []string) []int {\n\tvar m []int\n\tfor i, _ := range n {\n\t\tv, _ := strconv.Atoi(n[i])\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc int64Array(n []string) []int64 {\n\tvar m []int64\n\tfor i, _ := range n {\n\t\tv, _ := strconv.ParseInt(n[i], 10, 64)\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc uint64Array(n []string) []uint64 {\n\tvar m []uint64\n\tfor i, _ := range n {\n\t\tv, _ := strconv.ParseUint(n[i], 10, 64)\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc intExistIn(v int, arr []int) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc stringExistIn(v string, arr []string) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc gcd(m, n uint64) uint64 {\n\tx := new(big.Int)\n\ty := new(big.Int)\n\tz := new(big.Int)\n\ta := new(big.Int).SetUint64(m)\n\tb := new(big.Int).SetUint64(n)\n\treturn z.GCD(x, y, a, b).Uint64()\n}\n\nfunc uintArrayToStr(a []uint64) string {\n\tvar S string\n\n\tfor _, v := range a {\n\t\tS += strconv.Itoa(int(v))\n\t}\n\treturn S\n}\n\nfunc remove(x []uint64, y int) []uint64 {\n\tvar newArray []uint64\n\tfor i, _ := range x {\n\t\tif i != y {\n\t\t\tnewArray = append(newArray, x[i])\n\t\t}\n\t}\n\treturn newArray\n}\n\nfunc ascendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc descendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc maxAndIndex(a []uint64) (uint64, int) {\n\tmax := uint64(0)\n\tindex := 0\n\tfor i, v := range a {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn max, index\n}\n\nfunc sum(a []uint64) uint64 {\n\tsum := uint64(0)\n\tfor _, v := range a {\n\t\tsum += v\n\t}\n\treturn sum\n}\n\nfunc defeat(count *int64, hero *int64, monster *int64) {\n\tif *hero >= *monster {\n\t\t*count, *hero, *monster = *count + *monster, *hero - *monster, int64(0)\n\t} else {\n\t\t*count, *hero, *monster = *count + *hero, int64(0), *monster - *hero\n\t}\n}\n\nfunc main() {\n\t// sc.Split(bufio.ScanWords)\n\tN := int(nextInt())\n\tmonsters := int64Array(strings.Split(nextLine(), \" \"))\n\theroes := int64Array(strings.Split(nextLine(), \" \"))\n\n\tvar count int64\n\n\tfor i := 0; i < N; i++ {\n\t\tdefeat(&count, &heroes[i], &monsters[i])\n\t\tdefeat(&count, &heroes[i], &monsters[i+1])\n\t}\n\n\tfmt.Println(count)\n}\n\n", "language": "Go", "metadata": {"date": 1573765485, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02959.html", "problem_id": "p02959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02959/input.txt", "sample_output_relpath": "derived/input_output/data/p02959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02959/Go/s884124744.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s884124744", "user_id": "u124735330"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() uint64 {\n\tsc.Scan()\n\ti, e := strconv.ParseUint(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc intArray(n []string) []int {\n\tvar m []int\n\tfor i, _ := range n {\n\t\tv, _ := strconv.Atoi(n[i])\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc int64Array(n []string) []int64 {\n\tvar m []int64\n\tfor i, _ := range n {\n\t\tv, _ := strconv.ParseInt(n[i], 10, 64)\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc uint64Array(n []string) []uint64 {\n\tvar m []uint64\n\tfor i, _ := range n {\n\t\tv, _ := strconv.ParseUint(n[i], 10, 64)\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc intExistIn(v int, arr []int) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc stringExistIn(v string, arr []string) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc gcd(m, n uint64) uint64 {\n\tx := new(big.Int)\n\ty := new(big.Int)\n\tz := new(big.Int)\n\ta := new(big.Int).SetUint64(m)\n\tb := new(big.Int).SetUint64(n)\n\treturn z.GCD(x, y, a, b).Uint64()\n}\n\nfunc uintArrayToStr(a []uint64) string {\n\tvar S string\n\n\tfor _, v := range a {\n\t\tS += strconv.Itoa(int(v))\n\t}\n\treturn S\n}\n\nfunc remove(x []uint64, y int) []uint64 {\n\tvar newArray []uint64\n\tfor i, _ := range x {\n\t\tif i != y {\n\t\t\tnewArray = append(newArray, x[i])\n\t\t}\n\t}\n\treturn newArray\n}\n\nfunc ascendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc descendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc maxAndIndex(a []uint64) (uint64, int) {\n\tmax := uint64(0)\n\tindex := 0\n\tfor i, v := range a {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn max, index\n}\n\nfunc sum(a []uint64) uint64 {\n\tsum := uint64(0)\n\tfor _, v := range a {\n\t\tsum += v\n\t}\n\treturn sum\n}\n\nfunc defeat(count *int64, hero *int64, monster *int64) {\n\tif *hero >= *monster {\n\t\t*count, *hero, *monster = *count + *monster, *hero - *monster, int64(0)\n\t} else {\n\t\t*count, *hero, *monster = *count + *hero, int64(0), *monster - *hero\n\t}\n}\n\nfunc main() {\n\t// sc.Split(bufio.ScanWords)\n\tN := int(nextInt())\n\tmonsters := int64Array(strings.Split(nextLine(), \" \"))\n\theroes := int64Array(strings.Split(nextLine(), \" \"))\n\n\tvar count int64\n\n\tfor i := 0; i < N; i++ {\n\t\tdefeat(&count, &heroes[i], &monsters[i])\n\t\tdefeat(&count, &heroes[i], &monsters[i+1])\n\t}\n\n\tfmt.Println(count)\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "sample_input": "2\n3 5 2\n4 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02959", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2754, "cpu_time_ms": 5, "memory_kb": 1408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s317168551", "group_id": "codeNet:p02959", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tvar n int\n\n\tif sc.Scan() {\n\t\tline := sc.Text()\n\t\tn, _ = strconv.Atoi(line)\n\t}\n\n\ta := make([]int, n + 1)\n\tb := make([]int, n)\n\n\tif sc.Scan() {\n\t\tline := sc.Text()\n\t\tfor i, data := range strings.Split(line, \" \") {\n\t\t\tdataInt, _ := strconv.Atoi(data)\n\t\t\ta[i] = dataInt\n\t\t}\n\t}\n\n\tif sc.Scan() {\n\t\tline := sc.Text()\n\t\tfor i, data := range strings.Split(line, \" \") {\n\t\t\tdataInt, _ := strconv.Atoi(data)\n\t\t\tb[i] = dataInt\n\t\t}\n\t}\n\n\tcnt := 0\n\tfor i := 0; i < n; i++ {\n\t\trest := a[i] - b[i]\n\t\tif rest < 0 {\n\t\t\trest *= -1\n\n\t\t\tcnt += a[i]\n\t\t\ta[i] = 0\n\n\t\t\trest2 := a[i+1] - rest\n\t\t\tif rest2 < 0 {\n\t\t\t\tcnt += a[i+1]\n\t\t\t\ta[i+1] = 0\n\t\t\t} else {\n\t\t\t\tcnt += rest\n\t\t\t\ta[i+1] = -rest2\n\t\t\t}\n\t\t} else {\n\t\t\tcnt += b[i]\n\t\t\ta[i] = -rest\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}", "language": "Go", "metadata": {"date": 1564859485, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02959.html", "problem_id": "p02959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02959/input.txt", "sample_output_relpath": "derived/input_output/data/p02959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02959/Go/s317168551.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s317168551", "user_id": "u964273035"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tvar n int\n\n\tif sc.Scan() {\n\t\tline := sc.Text()\n\t\tn, _ = strconv.Atoi(line)\n\t}\n\n\ta := make([]int, n + 1)\n\tb := make([]int, n)\n\n\tif sc.Scan() {\n\t\tline := sc.Text()\n\t\tfor i, data := range strings.Split(line, \" \") {\n\t\t\tdataInt, _ := strconv.Atoi(data)\n\t\t\ta[i] = dataInt\n\t\t}\n\t}\n\n\tif sc.Scan() {\n\t\tline := sc.Text()\n\t\tfor i, data := range strings.Split(line, \" \") {\n\t\t\tdataInt, _ := strconv.Atoi(data)\n\t\t\tb[i] = dataInt\n\t\t}\n\t}\n\n\tcnt := 0\n\tfor i := 0; i < n; i++ {\n\t\trest := a[i] - b[i]\n\t\tif rest < 0 {\n\t\t\trest *= -1\n\n\t\t\tcnt += a[i]\n\t\t\ta[i] = 0\n\n\t\t\trest2 := a[i+1] - rest\n\t\t\tif rest2 < 0 {\n\t\t\t\tcnt += a[i+1]\n\t\t\t\ta[i+1] = 0\n\t\t\t} else {\n\t\t\t\tcnt += rest\n\t\t\t\ta[i+1] = -rest2\n\t\t\t}\n\t\t} else {\n\t\t\tcnt += b[i]\n\t\t\ta[i] = -rest\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "sample_input": "2\n3 5 2\n4 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02959", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 857, "cpu_time_ms": 3, "memory_kb": 1920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s781223904", "group_id": "codeNet:p02960", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n\ta, b int\n\tindex int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc main() {\n\tvar S string\n\tfmt.Scanf(\"%s\\n\", &S)\n\tRS := []rune(S)\n\tReverse(RS)\n\n\tdp := [100010][14]int{}\n\tpow := 1\n\tfor i := 0; i < len(RS); i++ {\n\t\tr := RS[i]\n\t\tif i == 0 {\n\t\t\tif string(r) == \"?\" {\n\t\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\t\tvalue := j\n\t\t\t\t\tdp[i][value] += 1\n\t\t\t\t\tdp[i][(value*pow)%13] %= MOD\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue, _ := strconv.Atoi(string(r))\n\t\t\t\tdp[i][value*pow] += 1\n\t\t\t\tdp[i][(value*pow)%13] %= MOD\n\n\t\t\t}\n\t\t} else {\n\t\t\tif string(r) == \"?\" {\n\t\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\t\t\tvalue := j\n\t\t\t\t\t\tdp[i][(k+value*pow)%13] += dp[i-1][k]\n\t\t\t\t\t\tdp[i][(k+value*pow)%13] %= MOD\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\t\tvalue, _ := strconv.Atoi(string(r))\n\t\t\t\t\tdp[i][(k+value*pow)%13] += dp[i-1][k]\n\t\t\t\t\tdp[i][(k+value*pow)%13] %= MOD\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpow = pow * 10 % 13\n\t}\n\tfmt.Println(dp[len(RS)-1][5])\n}\n\nfunc Reverse(runes []rune) []rune {\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn runes\n}\n", "language": "Go", "metadata": {"date": 1588025277, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02960/input.txt", "sample_output_relpath": "derived/input_output/data/p02960/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02960/Go/s781223904.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s781223904", "user_id": "u534481484"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n\ta, b int\n\tindex int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc main() {\n\tvar S string\n\tfmt.Scanf(\"%s\\n\", &S)\n\tRS := []rune(S)\n\tReverse(RS)\n\n\tdp := [100010][14]int{}\n\tpow := 1\n\tfor i := 0; i < len(RS); i++ {\n\t\tr := RS[i]\n\t\tif i == 0 {\n\t\t\tif string(r) == \"?\" {\n\t\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\t\tvalue := j\n\t\t\t\t\tdp[i][value] += 1\n\t\t\t\t\tdp[i][(value*pow)%13] %= MOD\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue, _ := strconv.Atoi(string(r))\n\t\t\t\tdp[i][value*pow] += 1\n\t\t\t\tdp[i][(value*pow)%13] %= MOD\n\n\t\t\t}\n\t\t} else {\n\t\t\tif string(r) == \"?\" {\n\t\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\t\t\tvalue := j\n\t\t\t\t\t\tdp[i][(k+value*pow)%13] += dp[i-1][k]\n\t\t\t\t\t\tdp[i][(k+value*pow)%13] %= MOD\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\t\tvalue, _ := strconv.Atoi(string(r))\n\t\t\t\t\tdp[i][(k+value*pow)%13] += dp[i-1][k]\n\t\t\t\t\tdp[i][(k+value*pow)%13] %= MOD\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpow = pow * 10 % 13\n\t}\n\tfmt.Println(dp[len(RS)-1][5])\n}\n\nfunc Reverse(runes []rune) []rune {\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn runes\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "sample_input": "??2??5\n"}, "reference_outputs": ["768\n"], "source_document_id": "p02960", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2299, "cpu_time_ms": 188, "memory_kb": 16512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s075088051", "group_id": "codeNet:p02960", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumInt64(a []int64) int64 {\n\tvar ret int64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcdInt64(m, n int64) int64 {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcmInt64(m, n int64) int64 {\n\treturn m / gcdInt64(m, n) * n\n}\n\n// sort ------------------------------------------------------------\n\ntype int64Array []int64\n\nfunc (s int64Array) Len() int { return len(s) }\nfunc (s int64Array) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s int64Array) Less(i, j int) bool { return s[i] < s[j] }\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nconst mod int = 1e9 + 7\n\nfunc main() {\n\ts := readString()\n\tn := len(s)\n\n\tdp := make([][]int, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, 13)\n\t}\n\tdp[0][0] = 1\n\n\tfor i := 1; i < n+1; i++ {\n\t\tc := s[i-1 : i]\n\t\tcnum, _ := strconv.Atoi(c)\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tif c != \"?\" && j != cnum {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\tdp[i][(k*10+j)%13] = (dp[i][(k*10+j)%13] + dp[i-1][k]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[n][5])\n}\n", "language": "Go", "metadata": {"date": 1569330711, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02960/input.txt", "sample_output_relpath": "derived/input_output/data/p02960/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02960/Go/s075088051.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s075088051", "user_id": "u295946532"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumInt64(a []int64) int64 {\n\tvar ret int64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcdInt64(m, n int64) int64 {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcmInt64(m, n int64) int64 {\n\treturn m / gcdInt64(m, n) * n\n}\n\n// sort ------------------------------------------------------------\n\ntype int64Array []int64\n\nfunc (s int64Array) Len() int { return len(s) }\nfunc (s int64Array) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s int64Array) Less(i, j int) bool { return s[i] < s[j] }\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nconst mod int = 1e9 + 7\n\nfunc main() {\n\ts := readString()\n\tn := len(s)\n\n\tdp := make([][]int, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, 13)\n\t}\n\tdp[0][0] = 1\n\n\tfor i := 1; i < n+1; i++ {\n\t\tc := s[i-1 : i]\n\t\tcnum, _ := strconv.Atoi(c)\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tif c != \"?\" && j != cnum {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\tdp[i][(k*10+j)%13] = (dp[i][(k*10+j)%13] + dp[i-1][k]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[n][5])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "sample_input": "??2??5\n"}, "reference_outputs": ["768\n"], "source_document_id": "p02960", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2758, "cpu_time_ms": 158, "memory_kb": 18688}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s340737918", "group_id": "codeNet:p02960", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// input に使うやつ\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\n// string から int へ\nfunc atoi(s string) int {\n\ti, _ := strconv.Atoi(s)\n\treturn i\n}\n\n// 一つの文字を int として読み込み\nfunc readInt() int {\n\treturn atoi(readLine())\n}\n\n// 複数の文字を int のスライスとして読み込み\nfunc readInts() []int {\n\tin := readLine()\n\tins := strings.Split(in, \" \")\n\tout := make([]int, len(ins))\n\tfor i, v := range ins {\n\t\tout[i] = atoi(v)\n\t}\n\treturn out\n}\n\n// sortしたスライスを返す\nfunc sorted(a []int) []int {\n\tsort.Ints(a)\n\tb := a\n\treturn b\n}\n\n// 逆順のsort\nfunc reverse(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tb := a\n\treturn b\n}\n\nfunc main() {\n\ts := strings.Split(readLine(), \"\")\n\tn := 13\n\tdp := make([]int, n)\n\tdp[0] = 1\n\n\tmod := 1000000007\n\tmul := 1\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tnextDP := make([]int, n)\n\n\t\tif s[i] == \"?\" {\n\t\t\tfor k := 0; k < 10; k++ {\n\t\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\t\tnextDP[(k*mul+j)%n] += dp[j]\n\t\t\t\t\tnextDP[(k*mul+j)%n] %= mod\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tk, _ := strconv.Atoi(s[i])\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tnextDP[(k*mul+j)%n] += dp[j]\n\t\t\t\tnextDP[(k*mul+j)%n] %= mod\n\t\t\t}\n\t\t}\n\n\t\tmul *= 10\n\t\tmul %= n\n\t\tdp = nextDP\n\t}\n\tfmt.Println(dp[5])\n}\n", "language": "Go", "metadata": {"date": 1564288046, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02960/input.txt", "sample_output_relpath": "derived/input_output/data/p02960/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02960/Go/s340737918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s340737918", "user_id": "u468482169"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// input に使うやつ\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\n// string から int へ\nfunc atoi(s string) int {\n\ti, _ := strconv.Atoi(s)\n\treturn i\n}\n\n// 一つの文字を int として読み込み\nfunc readInt() int {\n\treturn atoi(readLine())\n}\n\n// 複数の文字を int のスライスとして読み込み\nfunc readInts() []int {\n\tin := readLine()\n\tins := strings.Split(in, \" \")\n\tout := make([]int, len(ins))\n\tfor i, v := range ins {\n\t\tout[i] = atoi(v)\n\t}\n\treturn out\n}\n\n// sortしたスライスを返す\nfunc sorted(a []int) []int {\n\tsort.Ints(a)\n\tb := a\n\treturn b\n}\n\n// 逆順のsort\nfunc reverse(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tb := a\n\treturn b\n}\n\nfunc main() {\n\ts := strings.Split(readLine(), \"\")\n\tn := 13\n\tdp := make([]int, n)\n\tdp[0] = 1\n\n\tmod := 1000000007\n\tmul := 1\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tnextDP := make([]int, n)\n\n\t\tif s[i] == \"?\" {\n\t\t\tfor k := 0; k < 10; k++ {\n\t\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\t\tnextDP[(k*mul+j)%n] += dp[j]\n\t\t\t\t\tnextDP[(k*mul+j)%n] %= mod\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tk, _ := strconv.Atoi(s[i])\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tnextDP[(k*mul+j)%n] += dp[j]\n\t\t\t\tnextDP[(k*mul+j)%n] %= mod\n\t\t\t}\n\t\t}\n\n\t\tmul *= 10\n\t\tmul %= n\n\t\tdp = nextDP\n\t}\n\tfmt.Println(dp[5])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "sample_input": "??2??5\n"}, "reference_outputs": ["768\n"], "source_document_id": "p02960", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1518, "cpu_time_ms": 463, "memory_kb": 5760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s228272967", "group_id": "codeNet:p02960", "input_text": "// https://atcoder.jp/contests/abc135/tasks/abc135_d\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc pairsToKey(n, k int) string {\n\treturn fmt.Sprintf(\"%d_%d\", n, k)\n}\n\n// 下から n (1, .., len(chars)) 桁以上で見て 13 で割って k 余らせることができる個数\nfunc rec(n, k int, chars []rune, memo [][]int) int {\n\tif n == len(chars) {\n\t\tif chars[0] == '?' {\n\t\t\tif k <= 9 {\n\t\t\t\treturn 1\n\t\t\t}\n\n\t\t\treturn 0\n\t\t}\n\n\t\tnum := int(chars[0] - '0')\n\n\t\tif num == k {\n\t\t\treturn 1\n\t\t}\n\n\t\treturn 0\n\t}\n\n\t// 10a + b ≡ k ⇔ 40a + 4b ≡ a + 4b ≡ 4k\n\t// よって 1 の位と 10 の位以上に分けて、 a ≡ 4k - 4b となる個数を再帰で求めれば良い\n\tif memo[n][k] != -1 {\n\t\treturn memo[n][k]\n\t}\n\n\tc := chars[len(chars)-n]\n\n\tres := 0\n\n\tif c == '?' {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\trest := (4*k - i*4 + 13*3) % 13\n\t\t\tres += rec(n+1, rest, chars, memo)\n\t\t}\n\t} else {\n\t\tnum := int(c - '0')\n\t\trest := (4*k - num*4 + 13*3) % 13\n\t\tres = rec(n+1, rest, chars, memo)\n\t}\n\n\tres %= MOD\n\n\tmemo[n][k] = res\n\treturn res\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tS := io.Next()\n\n\tchars := []rune(S)\n\tmemo := make([][]int, len(chars))\n\n\tfor i := range memo {\n\t\tmemo[i] = make([]int, 13)\n\n\t\tfor j := 0; j < 13; j++ {\n\t\t\tmemo[i][j] = -1\n\t\t}\n\t}\n\n\tres := rec(1, 5, chars, memo)\n\tio.Println(res)\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve2(io *Io, d *Io) {\n\tS := io.Next()\n\n\tchars := []rune(S)\n\t// dp[i][j] 先頭 i 文字目(1 <= i <= len(chs))までで余りが j になる個数\n\tdp := make([][]int, len(chars)+1)\n\n\tfor i := range dp {\n\t\tdp[i] = make([]int, 13)\n\t}\n\n\t// 一文字目を取った時の mod はその文字自体で決定されるため、 0 文字目相当のものの mod は 0 のものが 1 つあるとする必要がある\n\tdp[0][0] = 1\n\n\tfor i := 0; i < len(chars); i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tif !(chars[i] == '?' || int(chars[i]-'0') == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// i+1 桁目が j で i 桁目までの余りが k であれば i+1 桁目までの余りは 10k + j % 13\n\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\tdp[i+1][(10*k+j)%13] += dp[i][k]\n\t\t\t}\n\n\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\tdp[i+1][k] %= MOD\n\t\t\t}\n\t\t}\n\t}\n\n\tres := dp[len(chars)][5]\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve2(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n// MinCalculator is helper to get min value\ntype MinCalculator struct {\n\tcurrent int\n}\n\n// NewMinCalculator returns new MinCalculator with initial value\nfunc NewMinCalculator(initial int) *MinCalculator {\n\treturn &MinCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MinCalculator) Check(val int) {\n\tif val < mc.current {\n\t\tmc.current = val\n\t}\n}\n\n// MaxCalculator is helper to get max value\ntype MaxCalculator struct {\n\tcurrent int\n}\n\n// NewMaxCalculator returns new MaxCalculator with initial value\nfunc NewMaxCalculator(initial int) *MaxCalculator {\n\treturn &MaxCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MaxCalculator) Check(val int) {\n\tif val > mc.current {\n\t\tmc.current = val\n\t}\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "language": "Go", "metadata": {"date": 1564287115, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02960.html", "problem_id": "p02960", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02960/input.txt", "sample_output_relpath": "derived/input_output/data/p02960/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02960/Go/s228272967.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s228272967", "user_id": "u751468134"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc135/tasks/abc135_d\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc pairsToKey(n, k int) string {\n\treturn fmt.Sprintf(\"%d_%d\", n, k)\n}\n\n// 下から n (1, .., len(chars)) 桁以上で見て 13 で割って k 余らせることができる個数\nfunc rec(n, k int, chars []rune, memo [][]int) int {\n\tif n == len(chars) {\n\t\tif chars[0] == '?' {\n\t\t\tif k <= 9 {\n\t\t\t\treturn 1\n\t\t\t}\n\n\t\t\treturn 0\n\t\t}\n\n\t\tnum := int(chars[0] - '0')\n\n\t\tif num == k {\n\t\t\treturn 1\n\t\t}\n\n\t\treturn 0\n\t}\n\n\t// 10a + b ≡ k ⇔ 40a + 4b ≡ a + 4b ≡ 4k\n\t// よって 1 の位と 10 の位以上に分けて、 a ≡ 4k - 4b となる個数を再帰で求めれば良い\n\tif memo[n][k] != -1 {\n\t\treturn memo[n][k]\n\t}\n\n\tc := chars[len(chars)-n]\n\n\tres := 0\n\n\tif c == '?' {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\trest := (4*k - i*4 + 13*3) % 13\n\t\t\tres += rec(n+1, rest, chars, memo)\n\t\t}\n\t} else {\n\t\tnum := int(c - '0')\n\t\trest := (4*k - num*4 + 13*3) % 13\n\t\tres = rec(n+1, rest, chars, memo)\n\t}\n\n\tres %= MOD\n\n\tmemo[n][k] = res\n\treturn res\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tS := io.Next()\n\n\tchars := []rune(S)\n\tmemo := make([][]int, len(chars))\n\n\tfor i := range memo {\n\t\tmemo[i] = make([]int, 13)\n\n\t\tfor j := 0; j < 13; j++ {\n\t\t\tmemo[i][j] = -1\n\t\t}\n\t}\n\n\tres := rec(1, 5, chars, memo)\n\tio.Println(res)\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve2(io *Io, d *Io) {\n\tS := io.Next()\n\n\tchars := []rune(S)\n\t// dp[i][j] 先頭 i 文字目(1 <= i <= len(chs))までで余りが j になる個数\n\tdp := make([][]int, len(chars)+1)\n\n\tfor i := range dp {\n\t\tdp[i] = make([]int, 13)\n\t}\n\n\t// 一文字目を取った時の mod はその文字自体で決定されるため、 0 文字目相当のものの mod は 0 のものが 1 つあるとする必要がある\n\tdp[0][0] = 1\n\n\tfor i := 0; i < len(chars); i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tif !(chars[i] == '?' || int(chars[i]-'0') == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// i+1 桁目が j で i 桁目までの余りが k であれば i+1 桁目までの余りは 10k + j % 13\n\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\tdp[i+1][(10*k+j)%13] += dp[i][k]\n\t\t\t}\n\n\t\t\tfor k := 0; k < 13; k++ {\n\t\t\t\tdp[i+1][k] %= MOD\n\t\t\t}\n\t\t}\n\t}\n\n\tres := dp[len(chars)][5]\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve2(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n// MinCalculator is helper to get min value\ntype MinCalculator struct {\n\tcurrent int\n}\n\n// NewMinCalculator returns new MinCalculator with initial value\nfunc NewMinCalculator(initial int) *MinCalculator {\n\treturn &MinCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MinCalculator) Check(val int) {\n\tif val < mc.current {\n\t\tmc.current = val\n\t}\n}\n\n// MaxCalculator is helper to get max value\ntype MaxCalculator struct {\n\tcurrent int\n}\n\n// NewMaxCalculator returns new MaxCalculator with initial value\nfunc NewMaxCalculator(initial int) *MaxCalculator {\n\treturn &MaxCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MaxCalculator) Check(val int) {\n\tif val > mc.current {\n\t\tmc.current = val\n\t}\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "sample_input": "??2??5\n"}, "reference_outputs": ["768\n"], "source_document_id": "p02960", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S. Each character in S is either a digit (0, ..., 9) or ?.\n\nAmong the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.\n\nSince the answer can be enormous, print the count modulo 10^9+7.\n\nConstraints\n\nS is a string consisting of digits (0, ..., 9) and ?.\n\n1 \\leq |S| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9+7.\n\nSample Input 1\n\n??2??5\n\nSample Output 1\n\n768\n\nFor example, 482305, 002865, and 972665 satisfy the condition.\n\nSample Input 2\n\n?44\n\nSample Output 2\n\n1\n\nOnly 044 satisfies the condition.\n\nSample Input 3\n\n7?4\n\nSample Output 3\n\n0\n\nWe may not be able to produce an integer satisfying the condition.\n\nSample Input 4\n\n?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???\n\nSample Output 4\n\n153716888", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8414, "cpu_time_ms": 124, "memory_kb": 15104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s693492042", "group_id": "codeNet:p02963", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s int\n\tfmt.Scan(&s)\n\n\tv := 1000000000\n\tx := v - s%v\n\ty := (s + x) / v\n\tfmt.Println(0, 0, v, 1, x, y)\n}\n", "language": "Go", "metadata": {"date": 1591097991, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02963.html", "problem_id": "p02963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02963/input.txt", "sample_output_relpath": "derived/input_output/data/p02963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02963/Go/s693492042.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s693492042", "user_id": "u461993794"}, "prompt_components": {"gold_output": "1 0 2 2 0 1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s int\n\tfmt.Scan(&s)\n\n\tv := 1000000000\n\tx := v - s%v\n\ty := (s + x) / v\n\tfmt.Println(0, 0, v, 1, x, y)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "sample_input": "3\n"}, "reference_outputs": ["1 0 2 2 0 1\n"], "source_document_id": "p02963", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 150, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s961123580", "group_id": "codeNet:p02963", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\n\tvar x1 = 0\n\tvar y2 = 0\n\tfor i := 1; i < n/2; i++ {\n\t\tif n%i == 0 {\n\t\t\tx1 = i\n\t\t\ty2 = n / x1\n\t\t}\n\t}\n\tfmt.Printf(\"0 0 %v 0 0 %v\", x1, y2)\n}\n", "language": "Go", "metadata": {"date": 1563758498, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02963.html", "problem_id": "p02963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02963/input.txt", "sample_output_relpath": "derived/input_output/data/p02963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02963/Go/s961123580.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s961123580", "user_id": "u703454820"}, "prompt_components": {"gold_output": "1 0 2 2 0 1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\n\tvar x1 = 0\n\tvar y2 = 0\n\tfor i := 1; i < n/2; i++ {\n\t\tif n%i == 0 {\n\t\t\tx1 = i\n\t\t\ty2 = n / x1\n\t\t}\n\t}\n\tfmt.Printf(\"0 0 %v 0 0 %v\", x1, y2)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "sample_input": "3\n"}, "reference_outputs": ["1 0 2 2 0 1\n"], "source_document_id": "p02963", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s271565504", "group_id": "codeNet:p02964", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/agc036/tasks/agc036_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, k int\n\tA []int\n\n\tnext [70 + 5][200000 + 50]int\n\tG [200000 + 50][]int\n)\n\nfunc main() {\n\tn, k = ReadInt2()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tG[A[i]] = append(G[A[i]], i)\n\t}\n\n\tfor i := 0; i < 200000+10; i++ {\n\t\tif len(G[i]) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor j := 0; j < len(G[i]); j++ {\n\t\t\tif j+1 < len(G[i]) {\n\t\t\t\tnext[0][G[i][j]] = G[i][j+1] - G[i][j] + 1\n\t\t\t} else {\n\t\t\t\tnext[0][G[i][j]] = n + G[i][0] - G[i][j] + 1\n\t\t\t\t// next[0][G[i][j]] = INF_BIT60\n\t\t\t}\n\t\t}\n\t}\n\t// PrintfDebug(\"%v\\n\", next[0][:n])\n\n\tfor d := 0; d+1 < 65; d++ {\n\t\tfor v := 0; v < n; v++ {\n\t\t\tnid := (next[d][v] + v) % n\n\t\t\tnext[d+1][v] = next[d][v] + next[d][nid]\n\n\t\t\tif next[d+1][v] > INF_BIT60 {\n\t\t\t\tnext[d+1][v] = INF_BIT60\n\t\t\t}\n\t\t}\n\t}\n\t// for i := 0; i < 3; i++ {\n\t// \tPrintfDebug(\"[%d]: %v\\n\", i, next[i][:n])\n\t// }\n\n\tnokori := n*k - 1\n\tcid := 0\n\tfor {\n\t\tfor d := 50; d >= 0; d-- {\n\t\t\tif nokori-next[d][cid] >= 0 {\n\t\t\t\tnokori -= next[d][cid]\n\t\t\t\tcid = (next[d][cid] + cid) % n\n\t\t\t\t// break\n\t\t\t}\n\t\t}\n\n\t\tif nokori < n {\n\t\t\tbreak\n\t\t}\n\t}\n\t// PrintfDebug(\"nokori: %v, cid: %v\\n\", nokori, cid)\n\n\tB := []int{}\n\tfor i := cid; i < n; i++ {\n\t\tB = append(B, A[i])\n\t}\n\tmemo := [200000 + 50]int{}\n\tfor i := 0; i < 200000+40; i++ {\n\t\tmemo[i] = -1\n\t}\n\n\tC := [200000 + 50]int{}\n\tcur := 0\n\tfor i := 0; i < len(B); i++ {\n\t\tb := B[i]\n\n\t\tif memo[b] == -1 {\n\t\t\tC[cur] = b\n\t\t\tmemo[b] = cur\n\t\t\tcur++\n\t\t} else {\n\t\t\tcur = memo[b]\n\t\t\tmemo[b] = -1\n\t\t}\n\t}\n\tfmt.Println(PrintIntsLine(C[:cur]...))\n\n\t// ans := []int{}\n\t// for i := 0; i < len(B); i++ {\n\t// \tif memo[B[i]] == -1 {\n\t// \t\tans = append(ans, B[i])\n\t// \t\tmemo[B[i]] = len(ans) - 1\n\t// \t} else {\n\t// \t\t// ans = ans[:memo[B[i]]]\n\n\t// \t\ttmp := []int{}\n\t// \t\tfor j := 0; j < memo[B[i]]; j++ {\n\t// \t\t\ttmp = append(tmp, ans[j])\n\t// \t\t}\n\t// \t\tans = tmp\n\n\t// \t\tmemo[B[i]] = -1\n\t// \t}\n\t// }\n\t// fmt.Println(PrintIntsLine(ans...))\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1595476206, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02964.html", "problem_id": "p02964", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02964/input.txt", "sample_output_relpath": "derived/input_output/data/p02964/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02964/Go/s271565504.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s271565504", "user_id": "u103600314"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/agc036/tasks/agc036_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, k int\n\tA []int\n\n\tnext [70 + 5][200000 + 50]int\n\tG [200000 + 50][]int\n)\n\nfunc main() {\n\tn, k = ReadInt2()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tG[A[i]] = append(G[A[i]], i)\n\t}\n\n\tfor i := 0; i < 200000+10; i++ {\n\t\tif len(G[i]) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor j := 0; j < len(G[i]); j++ {\n\t\t\tif j+1 < len(G[i]) {\n\t\t\t\tnext[0][G[i][j]] = G[i][j+1] - G[i][j] + 1\n\t\t\t} else {\n\t\t\t\tnext[0][G[i][j]] = n + G[i][0] - G[i][j] + 1\n\t\t\t\t// next[0][G[i][j]] = INF_BIT60\n\t\t\t}\n\t\t}\n\t}\n\t// PrintfDebug(\"%v\\n\", next[0][:n])\n\n\tfor d := 0; d+1 < 65; d++ {\n\t\tfor v := 0; v < n; v++ {\n\t\t\tnid := (next[d][v] + v) % n\n\t\t\tnext[d+1][v] = next[d][v] + next[d][nid]\n\n\t\t\tif next[d+1][v] > INF_BIT60 {\n\t\t\t\tnext[d+1][v] = INF_BIT60\n\t\t\t}\n\t\t}\n\t}\n\t// for i := 0; i < 3; i++ {\n\t// \tPrintfDebug(\"[%d]: %v\\n\", i, next[i][:n])\n\t// }\n\n\tnokori := n*k - 1\n\tcid := 0\n\tfor {\n\t\tfor d := 50; d >= 0; d-- {\n\t\t\tif nokori-next[d][cid] >= 0 {\n\t\t\t\tnokori -= next[d][cid]\n\t\t\t\tcid = (next[d][cid] + cid) % n\n\t\t\t\t// break\n\t\t\t}\n\t\t}\n\n\t\tif nokori < n {\n\t\t\tbreak\n\t\t}\n\t}\n\t// PrintfDebug(\"nokori: %v, cid: %v\\n\", nokori, cid)\n\n\tB := []int{}\n\tfor i := cid; i < n; i++ {\n\t\tB = append(B, A[i])\n\t}\n\tmemo := [200000 + 50]int{}\n\tfor i := 0; i < 200000+40; i++ {\n\t\tmemo[i] = -1\n\t}\n\n\tC := [200000 + 50]int{}\n\tcur := 0\n\tfor i := 0; i < len(B); i++ {\n\t\tb := B[i]\n\n\t\tif memo[b] == -1 {\n\t\t\tC[cur] = b\n\t\t\tmemo[b] = cur\n\t\t\tcur++\n\t\t} else {\n\t\t\tcur = memo[b]\n\t\t\tmemo[b] = -1\n\t\t}\n\t}\n\tfmt.Println(PrintIntsLine(C[:cur]...))\n\n\t// ans := []int{}\n\t// for i := 0; i < len(B); i++ {\n\t// \tif memo[B[i]] == -1 {\n\t// \t\tans = append(ans, B[i])\n\t// \t\tmemo[B[i]] = len(ans) - 1\n\t// \t} else {\n\t// \t\t// ans = ans[:memo[B[i]]]\n\n\t// \t\ttmp := []int{}\n\t// \t\tfor j := 0; j < memo[B[i]]; j++ {\n\t// \t\t\ttmp = append(tmp, ans[j])\n\t// \t\t}\n\t// \t\tans = tmp\n\n\t// \t\tmemo[B[i]] = -1\n\t// \t}\n\t// }\n\t// fmt.Println(PrintIntsLine(ans...))\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}).\nIts elements are represented by another sequence of N integers: A=(A_0,A_1,\\cdots,A_{N-1}). For each pair i, j (0 \\leq i \\leq K-1,\\ 0 \\leq j \\leq N-1), X_{i \\times N + j}=A_j holds.\n\nSnuke has an integer sequence s, which is initially empty.\nFor each i=0,1,2,\\cdots,N \\times K-1, in this order, he will perform the following operation:\n\nIf s does not contain X_i: add X_i to the end of s.\n\nIf s does contain X_i: repeatedly delete the element at the end of s until s no longer contains X_i. Note that, in this case, we do not add X_i to the end of s.\n\nFind the elements of s after Snuke finished the operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 10^{12}\n\n1 \\leq A_i \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 \\cdots A_{N-1}\n\nOutput\n\nPrint the elements of s after Snuke finished the operations, in order from beginning to end, with spaces in between.\n\nSample Input 1\n\n3 2\n1 2 3\n\nSample Output 1\n\n2 3\n\nIn this case, X=(1,2,3,1,2,3).\nWe will perform the operations as follows:\n\ni=0: s does not contain 1, so we add 1 to the end of s, resulting in s=(1).\n\ni=1: s does not contain 2, so we add 2 to the end of s, resulting in s=(1,2).\n\ni=2: s does not contain 3, so we add 3 to the end of s, resulting in s=(1,2,3).\n\ni=3: s does contain 1, so we repeatedly delete the element at the end of s as long as s contains 1, which causes the following changes to s: (1,2,3)→(1,2)→(1)→().\n\ni=4: s does not contain 2, so we add 2 to the end of s, resulting in s=(2).\n\ni=5: s does not contain 3, so we add 3 to the end of s, resulting in s=(2,3).\n\nSample Input 2\n\n5 10\n1 2 3 2 3\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6 1000000000000\n1 1 2 2 3 3\n\nSample Output 3\n\ns may be empty in the end.\n\nSample Input 4\n\n11 97\n3 1 4 1 5 9 2 6 5 3 5\n\nSample Output 4\n\n9 2 6", "sample_input": "3 2\n1 2 3\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02964", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}).\nIts elements are represented by another sequence of N integers: A=(A_0,A_1,\\cdots,A_{N-1}). For each pair i, j (0 \\leq i \\leq K-1,\\ 0 \\leq j \\leq N-1), X_{i \\times N + j}=A_j holds.\n\nSnuke has an integer sequence s, which is initially empty.\nFor each i=0,1,2,\\cdots,N \\times K-1, in this order, he will perform the following operation:\n\nIf s does not contain X_i: add X_i to the end of s.\n\nIf s does contain X_i: repeatedly delete the element at the end of s until s no longer contains X_i. Note that, in this case, we do not add X_i to the end of s.\n\nFind the elements of s after Snuke finished the operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 10^{12}\n\n1 \\leq A_i \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 \\cdots A_{N-1}\n\nOutput\n\nPrint the elements of s after Snuke finished the operations, in order from beginning to end, with spaces in between.\n\nSample Input 1\n\n3 2\n1 2 3\n\nSample Output 1\n\n2 3\n\nIn this case, X=(1,2,3,1,2,3).\nWe will perform the operations as follows:\n\ni=0: s does not contain 1, so we add 1 to the end of s, resulting in s=(1).\n\ni=1: s does not contain 2, so we add 2 to the end of s, resulting in s=(1,2).\n\ni=2: s does not contain 3, so we add 3 to the end of s, resulting in s=(1,2,3).\n\ni=3: s does contain 1, so we repeatedly delete the element at the end of s as long as s contains 1, which causes the following changes to s: (1,2,3)→(1,2)→(1)→().\n\ni=4: s does not contain 2, so we add 2 to the end of s, resulting in s=(2).\n\ni=5: s does not contain 3, so we add 3 to the end of s, resulting in s=(2,3).\n\nSample Input 2\n\n5 10\n1 2 3 2 3\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6 1000000000000\n1 1 2 2 3 3\n\nSample Output 3\n\ns may be empty in the end.\n\nSample Input 4\n\n11 97\n3 1 4 1 5 9 2 6 5 3 5\n\nSample Output 4\n\n9 2 6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6841, "cpu_time_ms": 312, "memory_kb": 130552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s710607508", "group_id": "codeNet:p02964", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/agc036/tasks/agc036_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, k int\n\tA []int\n\n\tnext [70 + 5][200000 + 50]int\n\tG [200000 + 50][]int\n)\n\nfunc main() {\n\tn, k = ReadInt2()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tG[A[i]] = append(G[A[i]], i)\n\t}\n\n\tfor i := 0; i < 200000+10; i++ {\n\t\tif len(G[i]) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor j := 0; j < len(G[i]); j++ {\n\t\t\tif j+1 < len(G[i]) {\n\t\t\t\tnext[0][G[i][j]] = G[i][j+1] - G[i][j] + 1\n\t\t\t} else {\n\t\t\t\tnext[0][G[i][j]] = n + G[i][0] - G[i][j] + 1\n\t\t\t}\n\t\t}\n\t}\n\tPrintfDebug(\"%v\\n\", next[0][:n])\n\n\tfor d := 0; d+1 < 60; d++ {\n\t\tfor v := 0; v < n; v++ {\n\t\t\tnid := (next[d][v] + v) % n\n\t\t\t// next[d+1][v] = next[d][v] + next[d][nid] - v\n\t\t\tnext[d+1][v] = next[d][v] + next[d][nid]\n\t\t}\n\t}\n\n\tnokori := n*k - 1\n\tcid := 0\n\tfor {\n\t\tfor d := 55; d >= 0; d-- {\n\t\t\tif nokori-next[d][cid] >= 0 {\n\t\t\t\tnokori -= next[d][cid]\n\t\t\t\tcid = (next[d][cid] + cid) % n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif nokori < n {\n\t\t\tbreak\n\t\t}\n\t}\n\tPrintfDebug(\"nokori: %v, cid: %v\\n\", nokori, cid)\n\n\tB := []int{}\n\tfor i := cid; i < n; i++ {\n\t\tB = append(B, A[i])\n\t}\n\tmemo := [200000 + 50]int{}\n\tfor i := 0; i < 200000+40; i++ {\n\t\tmemo[i] = -1\n\t}\n\n\t// ans := []int{}\n\t// for i := 0; i < len(B); i++ {\n\t// \tif memo[B[i]] == -1 {\n\t// \t\tans = append(ans, B[i])\n\t// \t\tmemo[B[i]] = len(ans) - 1\n\t// \t} else {\n\t// \t\tans = ans[:memo[B[i]]]\n\t// \t\tmemo[B[i]] = -1\n\t// \t}\n\t// }\n\t// fmt.Println(PrintIntsLine(ans...))\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1595396383, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02964.html", "problem_id": "p02964", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02964/input.txt", "sample_output_relpath": "derived/input_output/data/p02964/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02964/Go/s710607508.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s710607508", "user_id": "u103600314"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/agc036/tasks/agc036_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn, k int\n\tA []int\n\n\tnext [70 + 5][200000 + 50]int\n\tG [200000 + 50][]int\n)\n\nfunc main() {\n\tn, k = ReadInt2()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tG[A[i]] = append(G[A[i]], i)\n\t}\n\n\tfor i := 0; i < 200000+10; i++ {\n\t\tif len(G[i]) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor j := 0; j < len(G[i]); j++ {\n\t\t\tif j+1 < len(G[i]) {\n\t\t\t\tnext[0][G[i][j]] = G[i][j+1] - G[i][j] + 1\n\t\t\t} else {\n\t\t\t\tnext[0][G[i][j]] = n + G[i][0] - G[i][j] + 1\n\t\t\t}\n\t\t}\n\t}\n\tPrintfDebug(\"%v\\n\", next[0][:n])\n\n\tfor d := 0; d+1 < 60; d++ {\n\t\tfor v := 0; v < n; v++ {\n\t\t\tnid := (next[d][v] + v) % n\n\t\t\t// next[d+1][v] = next[d][v] + next[d][nid] - v\n\t\t\tnext[d+1][v] = next[d][v] + next[d][nid]\n\t\t}\n\t}\n\n\tnokori := n*k - 1\n\tcid := 0\n\tfor {\n\t\tfor d := 55; d >= 0; d-- {\n\t\t\tif nokori-next[d][cid] >= 0 {\n\t\t\t\tnokori -= next[d][cid]\n\t\t\t\tcid = (next[d][cid] + cid) % n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif nokori < n {\n\t\t\tbreak\n\t\t}\n\t}\n\tPrintfDebug(\"nokori: %v, cid: %v\\n\", nokori, cid)\n\n\tB := []int{}\n\tfor i := cid; i < n; i++ {\n\t\tB = append(B, A[i])\n\t}\n\tmemo := [200000 + 50]int{}\n\tfor i := 0; i < 200000+40; i++ {\n\t\tmemo[i] = -1\n\t}\n\n\t// ans := []int{}\n\t// for i := 0; i < len(B); i++ {\n\t// \tif memo[B[i]] == -1 {\n\t// \t\tans = append(ans, B[i])\n\t// \t\tmemo[B[i]] = len(ans) - 1\n\t// \t} else {\n\t// \t\tans = ans[:memo[B[i]]]\n\t// \t\tmemo[B[i]] = -1\n\t// \t}\n\t// }\n\t// fmt.Println(PrintIntsLine(ans...))\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}).\nIts elements are represented by another sequence of N integers: A=(A_0,A_1,\\cdots,A_{N-1}). For each pair i, j (0 \\leq i \\leq K-1,\\ 0 \\leq j \\leq N-1), X_{i \\times N + j}=A_j holds.\n\nSnuke has an integer sequence s, which is initially empty.\nFor each i=0,1,2,\\cdots,N \\times K-1, in this order, he will perform the following operation:\n\nIf s does not contain X_i: add X_i to the end of s.\n\nIf s does contain X_i: repeatedly delete the element at the end of s until s no longer contains X_i. Note that, in this case, we do not add X_i to the end of s.\n\nFind the elements of s after Snuke finished the operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 10^{12}\n\n1 \\leq A_i \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 \\cdots A_{N-1}\n\nOutput\n\nPrint the elements of s after Snuke finished the operations, in order from beginning to end, with spaces in between.\n\nSample Input 1\n\n3 2\n1 2 3\n\nSample Output 1\n\n2 3\n\nIn this case, X=(1,2,3,1,2,3).\nWe will perform the operations as follows:\n\ni=0: s does not contain 1, so we add 1 to the end of s, resulting in s=(1).\n\ni=1: s does not contain 2, so we add 2 to the end of s, resulting in s=(1,2).\n\ni=2: s does not contain 3, so we add 3 to the end of s, resulting in s=(1,2,3).\n\ni=3: s does contain 1, so we repeatedly delete the element at the end of s as long as s contains 1, which causes the following changes to s: (1,2,3)→(1,2)→(1)→().\n\ni=4: s does not contain 2, so we add 2 to the end of s, resulting in s=(2).\n\ni=5: s does not contain 3, so we add 3 to the end of s, resulting in s=(2,3).\n\nSample Input 2\n\n5 10\n1 2 3 2 3\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6 1000000000000\n1 1 2 2 3 3\n\nSample Output 3\n\ns may be empty in the end.\n\nSample Input 4\n\n11 97\n3 1 4 1 5 9 2 6 5 3 5\n\nSample Output 4\n\n9 2 6", "sample_input": "3 2\n1 2 3\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02964", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}).\nIts elements are represented by another sequence of N integers: A=(A_0,A_1,\\cdots,A_{N-1}). For each pair i, j (0 \\leq i \\leq K-1,\\ 0 \\leq j \\leq N-1), X_{i \\times N + j}=A_j holds.\n\nSnuke has an integer sequence s, which is initially empty.\nFor each i=0,1,2,\\cdots,N \\times K-1, in this order, he will perform the following operation:\n\nIf s does not contain X_i: add X_i to the end of s.\n\nIf s does contain X_i: repeatedly delete the element at the end of s until s no longer contains X_i. Note that, in this case, we do not add X_i to the end of s.\n\nFind the elements of s after Snuke finished the operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 10^{12}\n\n1 \\leq A_i \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 \\cdots A_{N-1}\n\nOutput\n\nPrint the elements of s after Snuke finished the operations, in order from beginning to end, with spaces in between.\n\nSample Input 1\n\n3 2\n1 2 3\n\nSample Output 1\n\n2 3\n\nIn this case, X=(1,2,3,1,2,3).\nWe will perform the operations as follows:\n\ni=0: s does not contain 1, so we add 1 to the end of s, resulting in s=(1).\n\ni=1: s does not contain 2, so we add 2 to the end of s, resulting in s=(1,2).\n\ni=2: s does not contain 3, so we add 3 to the end of s, resulting in s=(1,2,3).\n\ni=3: s does contain 1, so we repeatedly delete the element at the end of s as long as s contains 1, which causes the following changes to s: (1,2,3)→(1,2)→(1)→().\n\ni=4: s does not contain 2, so we add 2 to the end of s, resulting in s=(2).\n\ni=5: s does not contain 3, so we add 3 to the end of s, resulting in s=(2,3).\n\nSample Input 2\n\n5 10\n1 2 3 2 3\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6 1000000000000\n1 1 2 2 3 3\n\nSample Output 3\n\ns may be empty in the end.\n\nSample Input 4\n\n11 97\n3 1 4 1 5 9 2 6 5 3 5\n\nSample Output 4\n\n9 2 6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6342, "cpu_time_ms": 259, "memory_kb": 94664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s278599867", "group_id": "codeNet:p02964", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tas := make([]int, n)\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tm := make(map[int]int)\n\tto := make([]int, n*2)\n\tfor i := 0; i < n*2; i++ {\n\t\tv := as[i%n]\n\t\tif b, ok := m[v]; ok && b > -1 {\n\t\t\tto[b] = i - b\n\t\t\tm[v] = i\n\t\t} else {\n\t\t\tm[v] = i\n\t\t}\n\t}\n\t//fmt.Println(\"to: \", to)\n\n\tvar i, j int\n\t//fmt.Println(\"i,j: \", i, j)\n\tfor i := 0; i != k-1 || j+to[j]+1 < n; {\n\t\tj += (to[j] + 1)\n\t\tif j >= n {\n\t\t\ti++\n\t\t\tj %= n\n\t\t}\n\t\t//fmt.Println(\"i,j: \", i, j)\n\t\tif j == 0 {\n\t\t\tk = k % i\n\t\t\ti = 0\n\t\t}\n\t}\n\n\tvar s []int\n\tm = make(map[int]int)\n\tfor ; i < k; i++ {\n\t\tfor ; j < n; j++ {\n\t\t\tif b, ok := m[as[j]]; ok && b > -1 {\n\t\t\t\tfor l := len(s) - 1; s[l] != as[j]; l-- {\n\t\t\t\t\tm[s[l]] = -1\n\t\t\t\t}\n\t\t\t\tm[as[j]] = -1\n\t\t\t\ts = s[0:b]\n\t\t\t} else {\n\t\t\t\ts = append(s, as[j])\n\t\t\t\tm[as[j]] = len(s) - 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := range s {\n\t\tif i == len(s)-1 {\n\t\t\tfmt.Println(s[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d \", s[i])\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563769697, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02964.html", "problem_id": "p02964", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02964/input.txt", "sample_output_relpath": "derived/input_output/data/p02964/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02964/Go/s278599867.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s278599867", "user_id": "u282164747"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tas := make([]int, n)\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tm := make(map[int]int)\n\tto := make([]int, n*2)\n\tfor i := 0; i < n*2; i++ {\n\t\tv := as[i%n]\n\t\tif b, ok := m[v]; ok && b > -1 {\n\t\t\tto[b] = i - b\n\t\t\tm[v] = i\n\t\t} else {\n\t\t\tm[v] = i\n\t\t}\n\t}\n\t//fmt.Println(\"to: \", to)\n\n\tvar i, j int\n\t//fmt.Println(\"i,j: \", i, j)\n\tfor i := 0; i != k-1 || j+to[j]+1 < n; {\n\t\tj += (to[j] + 1)\n\t\tif j >= n {\n\t\t\ti++\n\t\t\tj %= n\n\t\t}\n\t\t//fmt.Println(\"i,j: \", i, j)\n\t\tif j == 0 {\n\t\t\tk = k % i\n\t\t\ti = 0\n\t\t}\n\t}\n\n\tvar s []int\n\tm = make(map[int]int)\n\tfor ; i < k; i++ {\n\t\tfor ; j < n; j++ {\n\t\t\tif b, ok := m[as[j]]; ok && b > -1 {\n\t\t\t\tfor l := len(s) - 1; s[l] != as[j]; l-- {\n\t\t\t\t\tm[s[l]] = -1\n\t\t\t\t}\n\t\t\t\tm[as[j]] = -1\n\t\t\t\ts = s[0:b]\n\t\t\t} else {\n\t\t\t\ts = append(s, as[j])\n\t\t\t\tm[as[j]] = len(s) - 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := range s {\n\t\tif i == len(s)-1 {\n\t\t\tfmt.Println(s[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d \", s[i])\n\t\t}\n\t}\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}).\nIts elements are represented by another sequence of N integers: A=(A_0,A_1,\\cdots,A_{N-1}). For each pair i, j (0 \\leq i \\leq K-1,\\ 0 \\leq j \\leq N-1), X_{i \\times N + j}=A_j holds.\n\nSnuke has an integer sequence s, which is initially empty.\nFor each i=0,1,2,\\cdots,N \\times K-1, in this order, he will perform the following operation:\n\nIf s does not contain X_i: add X_i to the end of s.\n\nIf s does contain X_i: repeatedly delete the element at the end of s until s no longer contains X_i. Note that, in this case, we do not add X_i to the end of s.\n\nFind the elements of s after Snuke finished the operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 10^{12}\n\n1 \\leq A_i \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 \\cdots A_{N-1}\n\nOutput\n\nPrint the elements of s after Snuke finished the operations, in order from beginning to end, with spaces in between.\n\nSample Input 1\n\n3 2\n1 2 3\n\nSample Output 1\n\n2 3\n\nIn this case, X=(1,2,3,1,2,3).\nWe will perform the operations as follows:\n\ni=0: s does not contain 1, so we add 1 to the end of s, resulting in s=(1).\n\ni=1: s does not contain 2, so we add 2 to the end of s, resulting in s=(1,2).\n\ni=2: s does not contain 3, so we add 3 to the end of s, resulting in s=(1,2,3).\n\ni=3: s does contain 1, so we repeatedly delete the element at the end of s as long as s contains 1, which causes the following changes to s: (1,2,3)→(1,2)→(1)→().\n\ni=4: s does not contain 2, so we add 2 to the end of s, resulting in s=(2).\n\ni=5: s does not contain 3, so we add 3 to the end of s, resulting in s=(2,3).\n\nSample Input 2\n\n5 10\n1 2 3 2 3\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6 1000000000000\n1 1 2 2 3 3\n\nSample Output 3\n\ns may be empty in the end.\n\nSample Input 4\n\n11 97\n3 1 4 1 5 9 2 6 5 3 5\n\nSample Output 4\n\n9 2 6", "sample_input": "3 2\n1 2 3\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02964", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}).\nIts elements are represented by another sequence of N integers: A=(A_0,A_1,\\cdots,A_{N-1}). For each pair i, j (0 \\leq i \\leq K-1,\\ 0 \\leq j \\leq N-1), X_{i \\times N + j}=A_j holds.\n\nSnuke has an integer sequence s, which is initially empty.\nFor each i=0,1,2,\\cdots,N \\times K-1, in this order, he will perform the following operation:\n\nIf s does not contain X_i: add X_i to the end of s.\n\nIf s does contain X_i: repeatedly delete the element at the end of s until s no longer contains X_i. Note that, in this case, we do not add X_i to the end of s.\n\nFind the elements of s after Snuke finished the operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 10^{12}\n\n1 \\leq A_i \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 \\cdots A_{N-1}\n\nOutput\n\nPrint the elements of s after Snuke finished the operations, in order from beginning to end, with spaces in between.\n\nSample Input 1\n\n3 2\n1 2 3\n\nSample Output 1\n\n2 3\n\nIn this case, X=(1,2,3,1,2,3).\nWe will perform the operations as follows:\n\ni=0: s does not contain 1, so we add 1 to the end of s, resulting in s=(1).\n\ni=1: s does not contain 2, so we add 2 to the end of s, resulting in s=(1,2).\n\ni=2: s does not contain 3, so we add 3 to the end of s, resulting in s=(1,2,3).\n\ni=3: s does contain 1, so we repeatedly delete the element at the end of s as long as s contains 1, which causes the following changes to s: (1,2,3)→(1,2)→(1)→().\n\ni=4: s does not contain 2, so we add 2 to the end of s, resulting in s=(2).\n\ni=5: s does not contain 3, so we add 3 to the end of s, resulting in s=(2,3).\n\nSample Input 2\n\n5 10\n1 2 3 2 3\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6 1000000000000\n1 1 2 2 3 3\n\nSample Output 3\n\ns may be empty in the end.\n\nSample Input 4\n\n11 97\n3 1 4 1 5 9 2 6 5 3 5\n\nSample Output 4\n\n9 2 6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1099, "cpu_time_ms": 2108, "memory_kb": 25984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s205142853", "group_id": "codeNet:p02969", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r float64\n\tfmt.Scan(&r)\n\tfmt.Println(int(3 * math.Pow(r, 2)))\n}\n", "language": "Go", "metadata": {"date": 1581175992, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/Go/s205142853.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s205142853", "user_id": "u363118893"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r float64\n\tfmt.Scan(&r)\n\tfmt.Println(int(3 * math.Pow(r, 2)))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 124, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s900300374", "group_id": "codeNet:p02969", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype ll int64\n\n\nfunc main() {\n\n\tvar N int\n\tfmt.Scan(&N)\n\n\n\ta := make([]int, N+1)\n\tans := 0\n\tans_slice := make([]int,N+1)\n\n\n\tfor i := 0 ; i < N ;i++ {\n\t\t//1 origin\n\t\tfmt.Scan(&a[i+1])\n\t}\n\n\tans_flag := 0\n\tfor i:= N; i > 0 ; i-- {//Nから1まで\n\n\t\tk:= i\n\t\tj := 1\n\t\tans_flag = 0\n\n\t\tfor k <= N {\n\t\t\tans_flag += a[k]\n\t\t\tj++\n\t\t\tk = i * j\n\t\t}\n\n\n\t\tif ans_flag % 2 != 0 {//2で割り切れない\n\t\t\tans++\n\t\t\tans_slice[i] = 1\n\t\t}\n\n\t}\n\n\n\n\n\n\n\tfmt.Println(ans)\n\tfor i:=1;i <=N ;i++ {\n\t\tif ans_slice[i] == 1 {\n\t\t\tfmt.Print(i)\n\t\t\t//fmt.Print(\" \")\n\t\t}\n\t}\n\t//fmt.Println(\"\")\n\n}\n", "language": "Go", "metadata": {"date": 1573431372, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/Go/s900300374.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s900300374", "user_id": "u187669010"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype ll int64\n\n\nfunc main() {\n\n\tvar N int\n\tfmt.Scan(&N)\n\n\n\ta := make([]int, N+1)\n\tans := 0\n\tans_slice := make([]int,N+1)\n\n\n\tfor i := 0 ; i < N ;i++ {\n\t\t//1 origin\n\t\tfmt.Scan(&a[i+1])\n\t}\n\n\tans_flag := 0\n\tfor i:= N; i > 0 ; i-- {//Nから1まで\n\n\t\tk:= i\n\t\tj := 1\n\t\tans_flag = 0\n\n\t\tfor k <= N {\n\t\t\tans_flag += a[k]\n\t\t\tj++\n\t\t\tk = i * j\n\t\t}\n\n\n\t\tif ans_flag % 2 != 0 {//2で割り切れない\n\t\t\tans++\n\t\t\tans_slice[i] = 1\n\t\t}\n\n\t}\n\n\n\n\n\n\n\tfmt.Println(ans)\n\tfor i:=1;i <=N ;i++ {\n\t\tif ans_slice[i] == 1 {\n\t\t\tfmt.Print(i)\n\t\t\t//fmt.Print(\" \")\n\t\t}\n\t}\n\t//fmt.Println(\"\")\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 598, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s770494700", "group_id": "codeNet:p02969", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar r int\n\tfmt.Scan(&r)\n\tfmt.Println(3 * r * r)\n}\n", "language": "Go", "metadata": {"date": 1563671132, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/Go/s770494700.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s770494700", "user_id": "u008666209"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar r int\n\tfmt.Scan(&r)\n\tfmt.Println(3 * r * r)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 93, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s493378987", "group_id": "codeNet:p02969", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nconst BufferSize = 1024\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar production bool\n\nfunc debugf(format string, v ...interface{}) {\n\tif !production {\n\t\tfmt.Printf(format, v...)\n\t}\n}\n\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, 1e+6)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tans := 3 * n * n\n\n\t_, _ = fmt.Fprintf(writer, \"%d\", ans)\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1563670931, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/Go/s493378987.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s493378987", "user_id": "u880731071"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nconst BufferSize = 1024\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar production bool\n\nfunc debugf(format string, v ...interface{}) {\n\tif !production {\n\t\tfmt.Printf(format, v...)\n\t}\n}\n\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, 1e+6)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tans := 3 * n * n\n\n\t_, _ = fmt.Fprintf(writer, \"%d\", ans)\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 665, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s863011569", "group_id": "codeNet:p02970", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, d int\n\tfmt.Scan(&n, &d)\n\n\tcnt := 0\n\tfor {\n\t\tn = n - 2 * d - 1\n\t\tcnt++\n\t\tif n <= 0 {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1596682998, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02970.html", "problem_id": "p02970", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02970/input.txt", "sample_output_relpath": "derived/input_output/data/p02970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02970/Go/s863011569.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s863011569", "user_id": "u769765274"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, d int\n\tfmt.Scan(&n, &d)\n\n\tcnt := 0\n\tfor {\n\t\tn = n - 2 * d - 1\n\t\tcnt++\n\t\tif n <= 0 {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "sample_input": "6 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02970", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 173, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s425986762", "group_id": "codeNet:p02970", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Golden Apple\n\tfmt.Printf(\"Hello world\")\n}", "language": "Go", "metadata": {"date": 1581372141, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02970.html", "problem_id": "p02970", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02970/input.txt", "sample_output_relpath": "derived/input_output/data/p02970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02970/Go/s425986762.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s425986762", "user_id": "u638629468"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Golden Apple\n\tfmt.Printf(\"Hello world\")\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "sample_input": "6 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02970", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 100, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s715063717", "group_id": "codeNet:p02970", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, d int\n\tfmt.Scan(&n, &d)\n\n\tfmt.Println(math.Ceil(float64(n) / float64((2*d + 1))))\n}\n", "language": "Go", "metadata": {"date": 1575989168, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02970.html", "problem_id": "p02970", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02970/input.txt", "sample_output_relpath": "derived/input_output/data/p02970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02970/Go/s715063717.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s715063717", "user_id": "u380695762"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, d int\n\tfmt.Scan(&n, &d)\n\n\tfmt.Println(math.Ceil(float64(n) / float64((2*d + 1))))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "sample_input": "6 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02970", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 147, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s010623648", "group_id": "codeNet:p02970", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN, D := sc.nextInt(), sc.nextInt()\n\tcount := 1\n\tfor {\n\t\tif (D*2+1)*count >= N {\n\t\t\tbreak\n\t\t}\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1574913584, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02970.html", "problem_id": "p02970", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02970/input.txt", "sample_output_relpath": "derived/input_output/data/p02970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02970/Go/s010623648.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s010623648", "user_id": "u924691798"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN, D := sc.nextInt(), sc.nextInt()\n\tcount := 1\n\tfor {\n\t\tif (D*2+1)*count >= N {\n\t\t\tbreak\n\t\t}\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "sample_input": "6 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02970", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1188, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s969761339", "group_id": "codeNet:p02970", "input_text": "package main\nimport \"fmt\"\n\nfunc main() {\n\tvar n, d int\n fmt.Scan(&n)\n fmt.Scan(&d)\n fmt.Println(calc(n, d))\n}\n\nfunc calc(n, d int) int{\n cov := d * 2\n i := n - d\n ans := i / cov\n return ans\n}\n\n", "language": "Go", "metadata": {"date": 1564244590, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02970.html", "problem_id": "p02970", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02970/input.txt", "sample_output_relpath": "derived/input_output/data/p02970/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02970/Go/s969761339.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s969761339", "user_id": "u852191794"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\nfunc main() {\n\tvar n, d int\n fmt.Scan(&n)\n fmt.Scan(&d)\n fmt.Println(calc(n, d))\n}\n\nfunc calc(n, d int) int{\n cov := d * 2\n i := n - d\n ans := i / cov\n return ans\n}\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "sample_input": "6 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02970", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N apple trees in a row. People say that one of them will bear golden apples.\n\nWe want to deploy some number of inspectors so that each of these trees will be inspected.\n\nEach inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \\leq i \\leq N) will inspect the trees with numbers between i-D and i+D (inclusive).\n\nFind the minimum number of inspectors that we need to deploy to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq D \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\n\nOutput\n\nPrint the minimum number of inspectors that we need to deploy to achieve the objective.\n\nSample Input 1\n\n6 2\n\nSample Output 1\n\n2\n\nWe can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.\n\nSample Input 2\n\n14 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n20 4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 200, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s486081580", "group_id": "codeNet:p02971", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc max(i, j int) int {\n\tif i > j {\n\t\treturn i\n\t} else {\n\t\treturn j\n\t}\n}\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\ta := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tx := make([]int, n)\n\ty := make([]int, n)\n\n\tx[0] = a[0]\n\ty[n-1] = a[n-1]\n\n\tfor i := 1; i < n; i++ {\n\t\tx[i] = max(x[i-1], a[i])\n\t}\n\tfor i := n - 2; i >= 0; i-- {\n\t\ty[i] = max(y[i+1], a[i])\n\t}\n\n\tfmt.Println(y[1])\n\tfor i := 1; i < n-1; i++ {\n\t\tfmt.Println(max(x[i]-1, y[i+1]))\n\t}\n\tfmt.Println(x[n-1])\n}", "language": "Go", "metadata": {"date": 1598681511, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/Go/s486081580.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s486081580", "user_id": "u090225501"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc max(i, j int) int {\n\tif i > j {\n\t\treturn i\n\t} else {\n\t\treturn j\n\t}\n}\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\ta := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tx := make([]int, n)\n\ty := make([]int, n)\n\n\tx[0] = a[0]\n\ty[n-1] = a[n-1]\n\n\tfor i := 1; i < n; i++ {\n\t\tx[i] = max(x[i-1], a[i])\n\t}\n\tfor i := n - 2; i >= 0; i-- {\n\t\ty[i] = max(y[i+1], a[i])\n\t}\n\n\tfmt.Println(y[1])\n\tfor i := 1; i < n-1; i++ {\n\t\tfmt.Println(max(x[i]-1, y[i+1]))\n\t}\n\tfmt.Println(x[n-1])\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 788, "cpu_time_ms": 351, "memory_kb": 9740}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s396970010", "group_id": "codeNet:p02971", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t\tb[i] = a[i]\n\t}\n\tsort.Ints(b)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] == b[len(b)-1] {\n\t\t\tfmt.Fprintln(w, b[len(b)-2])\n\t\t} else {\n\t\t\tfmt.Fprintln(w, b[len(b)-1])\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590109551, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/Go/s396970010.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s396970010", "user_id": "u814575783"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t\tb[i] = a[i]\n\t}\n\tsort.Ints(b)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] == b[len(b)-1] {\n\t\t\tfmt.Fprintln(w, b[len(b)-2])\n\t\t} else {\n\t\t\tfmt.Fprintln(w, b[len(b)-1])\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1229, "cpu_time_ms": 121, "memory_kb": 7680}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s340849233", "group_id": "codeNet:p02971", "input_text": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n\tvar n, d, ind int\n \ta := make([]int, 0)\n \tfmt.Scan(&n)\n for i := 0; i < n; i++ {\n fmt.Scan(&d)\n \t\ta = append(a, d)\n \t}\n b := make([]int, 0)\n for _, v := range a {\n b = append(b, v)\n }\n sort.Sort(sort.IntSlice(b))\n size := len(b)\n max := b[size-1]\n big := b[size-2]\n for i, v := range a {\n if ind == 0 {\n switch {\n \tcase v == max :\n \t\tind = i\n }\n }\n }\n switch {\n case max == big:\n for i := 0; i < n; i++{\n fmt.Println(max)\n }\n case max != big:\n \ta[ind] = big\n for i, v := range a {\n if i == ind {\n fmt.Println(v)\n }else{\n fmt.Println(max)\n }\n }\n }\n}", "language": "Go", "metadata": {"date": 1564253645, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/Go/s340849233.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s340849233", "user_id": "u852191794"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n\tvar n, d, ind int\n \ta := make([]int, 0)\n \tfmt.Scan(&n)\n for i := 0; i < n; i++ {\n fmt.Scan(&d)\n \t\ta = append(a, d)\n \t}\n b := make([]int, 0)\n for _, v := range a {\n b = append(b, v)\n }\n sort.Sort(sort.IntSlice(b))\n size := len(b)\n max := b[size-1]\n big := b[size-2]\n for i, v := range a {\n if ind == 0 {\n switch {\n \tcase v == max :\n \t\tind = i\n }\n }\n }\n switch {\n case max == big:\n for i := 0; i < n; i++{\n fmt.Println(max)\n }\n case max != big:\n \ta[ind] = big\n for i, v := range a {\n if i == ind {\n fmt.Println(v)\n }else{\n fmt.Println(max)\n }\n }\n }\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 723, "cpu_time_ms": 1430, "memory_kb": 11008}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s982327294", "group_id": "codeNet:p02971", "input_text": "package main\nimport \"fmt\"\n \nfunc main() {\n var n, a int\n maxVal := 0\n secondVal := 0\n maxIdx := 0\n \n fmt.Scanln(&n)\n \n for i := 0; i < n; i++ {\n fmt.Scanln(&a)\n \n if(a >= maxVal) {\n secondVal = maxVal\n maxVal = a\n maxIdx = i\n } else if( a >= secondVal) {\n secondVal = a\n }\n }\n \n for i := 0; i < n; i++ {\n if(i == maxIdx) {\n fmt.Printf(\"%d\\n\", secondVal)\n } else {\n fmt.Printf(\"%d\\n\", maxVal)\n }\n }\n}", "language": "Go", "metadata": {"date": 1563673680, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/Go/s982327294.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s982327294", "user_id": "u686302771"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "package main\nimport \"fmt\"\n \nfunc main() {\n var n, a int\n maxVal := 0\n secondVal := 0\n maxIdx := 0\n \n fmt.Scanln(&n)\n \n for i := 0; i < n; i++ {\n fmt.Scanln(&a)\n \n if(a >= maxVal) {\n secondVal = maxVal\n maxVal = a\n maxIdx = i\n } else if( a >= secondVal) {\n secondVal = a\n }\n }\n \n for i := 0; i < n; i++ {\n if(i == maxIdx) {\n fmt.Printf(\"%d\\n\", secondVal)\n } else {\n fmt.Printf(\"%d\\n\", maxVal)\n }\n }\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 465, "cpu_time_ms": 1419, "memory_kb": 7684}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s794023063", "group_id": "codeNet:p02971", "input_text": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Sat Jul 20 21:12:29 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tarr := make([]int, n)\n\tm := map[int]int{}\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i])\n\t\tm[arr[i]]++\n\t}\n\n\tvar nums []int\n\tfor k := range m {\n\t\tnums = append(nums, k)\n\t}\n\tsort.Ints(nums)\n\tmax := nums[len(nums)-1]\n\tfor i := range arr {\n\t\tif arr[i] != max {\n\t\t\tfmt.Println(max)\n\t\t} else {\n\t\t\tif m[arr[i]] > 1 {\n\t\t\t\tfmt.Println(max)\n\t\t\t} else {\n\t\t\t\tfmt.Println(nums[len(nums)-2])\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563671860, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/Go/s794023063.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s794023063", "user_id": "u802614675"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Sat Jul 20 21:12:29 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tarr := make([]int, n)\n\tm := map[int]int{}\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i])\n\t\tm[arr[i]]++\n\t}\n\n\tvar nums []int\n\tfor k := range m {\n\t\tnums = append(nums, k)\n\t}\n\tsort.Ints(nums)\n\tmax := nums[len(nums)-1]\n\tfor i := range arr {\n\t\tif arr[i] != max {\n\t\t\tfmt.Println(max)\n\t\t} else {\n\t\t\tif m[arr[i]] > 1 {\n\t\t\t\tfmt.Println(max)\n\t\t\t} else {\n\t\t\t\tfmt.Println(nums[len(nums)-2])\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 581, "cpu_time_ms": 1473, "memory_kb": 18304}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s924499300", "group_id": "codeNet:p02971", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst inf = 1 << 60\nconst mod int = 1e9 + 7\n\nfunc ri() (n int) {\n\tsc.Scan()\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\n\nfunc maxAndSec(a []int) (int, int) {\n\tmax, sec := -1, -1\n\tfor _, i := range a {\n\t\tif max <= i {\n\t\t\tmax, sec = i, max\n\t\t} else if sec < i {\n\t\t\tsec = i\n\t\t}\n\t}\n\treturn max, sec\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = ri()\n\t}\n\n\t// fmt.Println(a)\n\n\tmx, sec := maxAndSec(a)\n\n\tctMx := 0\n\tfor _, aa := range a {\n\t\tif aa == mx {\n\t\t\tctMx++\n\t\t}\n\t}\n\n\t// fmt.Println(mx, ctMx)\n\n\tif ctMx > 1 {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfmt.Println(mx)\n\t\t}\n\t\treturn\n\t} else { // ctMx == 1\n\t\tfor _, aa := range a {\n\t\t\tif aa == mx {\n\t\t\t\tfmt.Println(sec)\n\t\t\t} else {\n\t\t\t\tfmt.Println(mx)\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563671811, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/Go/s924499300.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s924499300", "user_id": "u554269352"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst inf = 1 << 60\nconst mod int = 1e9 + 7\n\nfunc ri() (n int) {\n\tsc.Scan()\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\n\nfunc maxAndSec(a []int) (int, int) {\n\tmax, sec := -1, -1\n\tfor _, i := range a {\n\t\tif max <= i {\n\t\t\tmax, sec = i, max\n\t\t} else if sec < i {\n\t\t\tsec = i\n\t\t}\n\t}\n\treturn max, sec\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = ri()\n\t}\n\n\t// fmt.Println(a)\n\n\tmx, sec := maxAndSec(a)\n\n\tctMx := 0\n\tfor _, aa := range a {\n\t\tif aa == mx {\n\t\t\tctMx++\n\t\t}\n\t}\n\n\t// fmt.Println(mx, ctMx)\n\n\tif ctMx > 1 {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfmt.Println(mx)\n\t\t}\n\t\treturn\n\t} else { // ctMx == 1\n\t\tfor _, aa := range a {\n\t\t\tif aa == mx {\n\t\t\t\tfmt.Println(sec)\n\t\t\t} else {\n\t\t\t\tfmt.Println(mx)\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 873, "cpu_time_ms": 428, "memory_kb": 6144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s163824983", "group_id": "codeNet:p02972", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = false\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO functions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbufferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbufferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc debugf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc debug(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tn := readi()\n\t_, a := readInts(n)\n\tsolve(n, a)\n}\n\nfunc solve(n int, a []int) {\n\tbox := make([]int, n)\n\tfor i:= 0; i < n; i++ {\n\t\tbox[i] = -1\n\t}\n\tmulti := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tmulti[i] = []int{}\n\t\tfor j := i+1; j <= n; j += i+1 {\n\t\t\tmulti[i] = append(multi[i], j-1)\n\t\t}\n\t}\n\tanswer := []int{}\n\tfor i := n -1; i >= 0; i-- {\n\t\tif len(multi[i]) == 1 {\n\t\t\tbox[i] = a[i]\n\t\t\tif a[i] == 1 {\n\t\t\t\tanswer = append(answer, i+1)\n\t\t\t}\n\t\t} else {\n\t\t\tcounter := 0\n\t\t\tfor _, v := range multi[i] {\n\t\t\t\tif v > i {\n\t\t\t\t\tcounter += box[v]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif counter %2 == 0 {\n\t\t\t\tif a[i] == 0 {\n\t\t\t\t\tbox[i] = 0\n\t\t\t\t} else {\n\t\t\t\t\tbox[i] = 1\n\t\t\t\t\tanswer = append(answer, i+1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif a[i] == 0 {\n\t\t\t\t\tbox[i] = 1\n\t\t\t\t\tanswer = append(answer, i+1)\n\t\t\t\t} else {\n\t\t\t\t\tbox[i] = 0\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\tdebug(box)\n\tdebug(multi)\n\n\tif len(answer) == 0 {\n\t\tprintln(0)\n\t} else {\n\t\tprintln(len(answer))\n\t\tfor i:= 0; i < len(answer)-1; i++ {\n\t\t\tprintf(\"%d \", answer[i])\n\t\t}\n\t\tprintln(answer[len(answer)-1])\n\t}\n}", "language": "Go", "metadata": {"date": 1593560616, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/Go/s163824983.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s163824983", "user_id": "u238461782"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = false\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO functions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbufferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbufferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc debugf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc debug(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tn := readi()\n\t_, a := readInts(n)\n\tsolve(n, a)\n}\n\nfunc solve(n int, a []int) {\n\tbox := make([]int, n)\n\tfor i:= 0; i < n; i++ {\n\t\tbox[i] = -1\n\t}\n\tmulti := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tmulti[i] = []int{}\n\t\tfor j := i+1; j <= n; j += i+1 {\n\t\t\tmulti[i] = append(multi[i], j-1)\n\t\t}\n\t}\n\tanswer := []int{}\n\tfor i := n -1; i >= 0; i-- {\n\t\tif len(multi[i]) == 1 {\n\t\t\tbox[i] = a[i]\n\t\t\tif a[i] == 1 {\n\t\t\t\tanswer = append(answer, i+1)\n\t\t\t}\n\t\t} else {\n\t\t\tcounter := 0\n\t\t\tfor _, v := range multi[i] {\n\t\t\t\tif v > i {\n\t\t\t\t\tcounter += box[v]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif counter %2 == 0 {\n\t\t\t\tif a[i] == 0 {\n\t\t\t\t\tbox[i] = 0\n\t\t\t\t} else {\n\t\t\t\t\tbox[i] = 1\n\t\t\t\t\tanswer = append(answer, i+1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif a[i] == 0 {\n\t\t\t\t\tbox[i] = 1\n\t\t\t\t\tanswer = append(answer, i+1)\n\t\t\t\t} else {\n\t\t\t\t\tbox[i] = 0\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\tdebug(box)\n\tdebug(multi)\n\n\tif len(answer) == 0 {\n\t\tprintln(0)\n\t} else {\n\t\tprintln(len(answer))\n\t\tfor i:= 0; i < len(answer)-1; i++ {\n\t\t\tprintf(\"%d \", answer[i])\n\t\t}\n\t\tprintln(answer[len(answer)-1])\n\t}\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7655, "cpu_time_ms": 288, "memory_kb": 55700}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s768473953", "group_id": "codeNet:p02972", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n\ta, b int\n\tindex int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc FactoredPrimeNumber(num int) map[int]int {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tA[i] = a\n\t}\n\tB := make([]int, N)\n\tmax := 0\n\tfor i := N; i > 0; i-- {\n\t\ta := A[i-1]\n\t\tif a == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp := 2\n\t\tsum := 0\n\t\tfor i*p <= N {\n\t\t\ta := A[i*p-1]\n\t\t\tif a != 0 {\n\t\t\t\tsum++\n\t\t\t}\n\t\t\tp++\n\t\t}\n\t\tif sum%2 == 0 {\n\t\t\tB[i-1] = 1\n\t\t\tif i > max {\n\t\t\t\tmax = i\n\t\t\t}\n\t\t}\n\t}\n\tif max == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(max)\n\t\tfor i := 0; i < max; i++ {\n\t\t\tfmt.Print(B[i])\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n\nfunc Reverse(runes []rune) []rune {\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn runes\n}\n", "language": "Go", "metadata": {"date": 1588094445, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/Go/s768473953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s768473953", "user_id": "u534481484"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n\ta, b int\n\tindex int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc FactoredPrimeNumber(num int) map[int]int {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tA[i] = a\n\t}\n\tB := make([]int, N)\n\tmax := 0\n\tfor i := N; i > 0; i-- {\n\t\ta := A[i-1]\n\t\tif a == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp := 2\n\t\tsum := 0\n\t\tfor i*p <= N {\n\t\t\ta := A[i*p-1]\n\t\t\tif a != 0 {\n\t\t\t\tsum++\n\t\t\t}\n\t\t\tp++\n\t\t}\n\t\tif sum%2 == 0 {\n\t\t\tB[i-1] = 1\n\t\t\tif i > max {\n\t\t\t\tmax = i\n\t\t\t}\n\t\t}\n\t}\n\tif max == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(max)\n\t\tfor i := 0; i < max; i++ {\n\t\t\tfmt.Print(B[i])\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n\nfunc Reverse(runes []rune) []rune {\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn runes\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2322, "cpu_time_ms": 1227, "memory_kb": 7168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s386378953", "group_id": "codeNet:p02972", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc main() {\n\tvar n, m int\n\tvar a, b, c []int\n\tsc.Split(bufio.ScanWords)\n\tn = nextInt()\n\tfor i := 0; i < n; i++ {\n\t\th := nextInt()\n\t\ta = append(a, h)\n\t}\n\tb = make([]int, n+1)\n\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tvar sum int\n\t\tfor j := 2; (i+1)*j < len(a); {\n\t\t\tif b[(i+1)*j] == 1 {\n\t\t\t\tsum++\n\t\t\t}\n\t\t\tj++\n\t\t}\n\t\tswitch a[i] {\n\t\tcase 0:\n\t\t\tif sum%2 == 1 {\n\t\t\t\tb[i+1] = 1\n\t\t\t\tc = append([]int{i + 1}, c...)\n\t\t\t\tm++\n\t\t\t}\n\t\tcase 1:\n\t\t\tif sum%2 == 0 {\n\t\t\t\tb[i+1] = 1\n\t\t\t\tc = append([]int{i + 1}, c...)\n\t\t\t\tm++\n\t\t\t}\n\t\t}\n\n\t}\n\tfmt.Println(m)\n\tfor i, h := range c {\n\t\tif i == len(c)-1 {\n\t\t\tfmt.Printf(\"%v\\n\", h)\n\t\t} else {\n\t\t\tfmt.Printf(\"%v \", h)\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1564070477, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/Go/s386378953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s386378953", "user_id": "u233303958"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc main() {\n\tvar n, m int\n\tvar a, b, c []int\n\tsc.Split(bufio.ScanWords)\n\tn = nextInt()\n\tfor i := 0; i < n; i++ {\n\t\th := nextInt()\n\t\ta = append(a, h)\n\t}\n\tb = make([]int, n+1)\n\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tvar sum int\n\t\tfor j := 2; (i+1)*j < len(a); {\n\t\t\tif b[(i+1)*j] == 1 {\n\t\t\t\tsum++\n\t\t\t}\n\t\t\tj++\n\t\t}\n\t\tswitch a[i] {\n\t\tcase 0:\n\t\t\tif sum%2 == 1 {\n\t\t\t\tb[i+1] = 1\n\t\t\t\tc = append([]int{i + 1}, c...)\n\t\t\t\tm++\n\t\t\t}\n\t\tcase 1:\n\t\t\tif sum%2 == 0 {\n\t\t\t\tb[i+1] = 1\n\t\t\t\tc = append([]int{i + 1}, c...)\n\t\t\t\tm++\n\t\t\t}\n\t\t}\n\n\t}\n\tfmt.Println(m)\n\tfor i, h := range c {\n\t\tif i == len(c)-1 {\n\t\t\tfmt.Printf(\"%v\\n\", h)\n\t\t} else {\n\t\t\tfmt.Printf(\"%v \", h)\n\t\t}\n\t}\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 823, "cpu_time_ms": 2109, "memory_kb": 24576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s786008797", "group_id": "codeNet:p02973", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Color struct {\n\tMaxNumber int\n\tColor int\n}\n\nfunc calc(arr []int, times int) {\n\tcolorArr := make([]Color,0)\n\tlastColor := new(Color)\n\tfor i := 0; i < len(arr); i ++ {\n\t\tisCheck := true\n\t\tif i > 0 && arr[i] > arr[i-1] {\n\t\t\tlastColor.MaxNumber = arr[i]\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 0; j < len(colorArr); j++ {\n\t\t\tif colorArr[j].MaxNumber < arr[i]{\n\t\t\t\tcolorArr[j].MaxNumber = arr[i]\n\t\t\t\tisCheck = false\n\t\t\t\t*lastColor = colorArr[j]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif isCheck {\n\t\t\tcolorS := new(Color)\n\t\t\tcolorS.MaxNumber = arr[i]\n\t\t\tcolorArr = append(colorArr, *colorS)\n\t\t\t*lastColor = *colorS\n\t\t}\n\t}\n\tfmt.Println(len(colorArr))\n}\n\nfunc main() {\n\tarr := make([]int,0)\n\treader := bufio.NewReaderSize(os.Stdin, 1024*1024)\n\ttimes, _:= strconv.Atoi(readLine(reader))\n\tfor i:= 0; i< times; i++ {\n\t\ttmp, _ := strconv.Atoi(readLine(reader))\n\t\tarr = append(arr, tmp)\n\t}\n\tcalc(arr, times)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n", "language": "Go", "metadata": {"date": 1563677122, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02973.html", "problem_id": "p02973", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02973/input.txt", "sample_output_relpath": "derived/input_output/data/p02973/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02973/Go/s786008797.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s786008797", "user_id": "u162455118"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Color struct {\n\tMaxNumber int\n\tColor int\n}\n\nfunc calc(arr []int, times int) {\n\tcolorArr := make([]Color,0)\n\tlastColor := new(Color)\n\tfor i := 0; i < len(arr); i ++ {\n\t\tisCheck := true\n\t\tif i > 0 && arr[i] > arr[i-1] {\n\t\t\tlastColor.MaxNumber = arr[i]\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 0; j < len(colorArr); j++ {\n\t\t\tif colorArr[j].MaxNumber < arr[i]{\n\t\t\t\tcolorArr[j].MaxNumber = arr[i]\n\t\t\t\tisCheck = false\n\t\t\t\t*lastColor = colorArr[j]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif isCheck {\n\t\t\tcolorS := new(Color)\n\t\t\tcolorS.MaxNumber = arr[i]\n\t\t\tcolorArr = append(colorArr, *colorS)\n\t\t\t*lastColor = *colorS\n\t\t}\n\t}\n\tfmt.Println(len(colorArr))\n}\n\nfunc main() {\n\tarr := make([]int,0)\n\treader := bufio.NewReaderSize(os.Stdin, 1024*1024)\n\ttimes, _:= strconv.Atoi(readLine(reader))\n\tfor i:= 0; i< times; i++ {\n\t\ttmp, _ := strconv.Atoi(readLine(reader))\n\t\tarr = append(arr, tmp)\n\t}\n\tcalc(arr, times)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence with N integers: A = \\{ A_1, A_2, \\cdots, A_N \\}.\nFor each of these N integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:\n\nIf A_i and A_j (i < j) are painted with the same color, A_i < A_j.\n\nFind the minimum number of colors required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of colors required to satisfy the condition.\n\nSample Input 1\n\n5\n2\n1\n4\n5\n3\n\nSample Output 1\n\n2\n\nWe can satisfy the condition with two colors by, for example, painting 2 and 3 red and painting 1, 4, and 5 blue.\n\nSample Input 2\n\n4\n0\n0\n0\n0\n\nSample Output 2\n\n4\n\nWe have to paint all the integers with distinct colors.", "sample_input": "5\n2\n1\n4\n5\n3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02973", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence with N integers: A = \\{ A_1, A_2, \\cdots, A_N \\}.\nFor each of these N integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:\n\nIf A_i and A_j (i < j) are painted with the same color, A_i < A_j.\n\nFind the minimum number of colors required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of colors required to satisfy the condition.\n\nSample Input 1\n\n5\n2\n1\n4\n5\n3\n\nSample Output 1\n\n2\n\nWe can satisfy the condition with two colors by, for example, painting 2 and 3 red and painting 1, 4, and 5 blue.\n\nSample Input 2\n\n4\n0\n0\n0\n0\n\nSample Output 2\n\n4\n\nWe have to paint all the integers with distinct colors.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1113, "cpu_time_ms": 2108, "memory_kb": 9796}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s441072893", "group_id": "codeNet:p02973", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code ---*/\n\tN := nextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\tc := make([]int, N)\n\tci := 1\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif c[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tc[i] = ci\n\t\tx := A[i]\n\t\tfor j := i - 1; j >= 0; j-- {\n\t\t\tif A[j] < x {\n\t\t\t\tc[j] = ci\n\t\t\t\tx = c[j]\n\t\t\t}\n\t\t}\n\t\tci++\n\t}\n\tfmt.Fprint(out, c)\n\t// 5 2 1 4 5 3\n}\n\nfunc solve(N int, a []int, used []int, s2, x1, x2, depth int) bool {\n\t// fmt.Fprint(out, used, depth, x1, x2, \"\\n\")\n\tif depth == N {\n\t\t// fmt.Fprint(out, \"atta\\n\")\n\t\treturn x1^x2^a[0] == 0 && x2^a[0]^s2 == 0\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif used[i] > 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif depth >= 2 && x1^x2^a[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tused[i] = 1\n\t\tif depth == 1 {\n\t\t\ts2 = a[i]\n\t\t}\n\t\tif solve(N, a, used, s2, x2, a[i], depth+1) {\n\t\t\treturn true\n\t\t}\n\t\tused[i] = 0\n\t}\n\treturn false\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// Genericsがないので筋肉で...\n// interfaceでの取扱がようわからんし\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// mapからkeysとvaluesを返す感じのやつ\n// なんかしらんけどmap[interface{}]interface{}しか受け付けない。なんのためのinterface{}やねん\n// なので呼ぶときのmapはmap[int]stringとかじゃダメ\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1563676914, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02973.html", "problem_id": "p02973", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02973/input.txt", "sample_output_relpath": "derived/input_output/data/p02973/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02973/Go/s441072893.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s441072893", "user_id": "u445515168"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code ---*/\n\tN := nextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\tc := make([]int, N)\n\tci := 1\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif c[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tc[i] = ci\n\t\tx := A[i]\n\t\tfor j := i - 1; j >= 0; j-- {\n\t\t\tif A[j] < x {\n\t\t\t\tc[j] = ci\n\t\t\t\tx = c[j]\n\t\t\t}\n\t\t}\n\t\tci++\n\t}\n\tfmt.Fprint(out, c)\n\t// 5 2 1 4 5 3\n}\n\nfunc solve(N int, a []int, used []int, s2, x1, x2, depth int) bool {\n\t// fmt.Fprint(out, used, depth, x1, x2, \"\\n\")\n\tif depth == N {\n\t\t// fmt.Fprint(out, \"atta\\n\")\n\t\treturn x1^x2^a[0] == 0 && x2^a[0]^s2 == 0\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif used[i] > 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif depth >= 2 && x1^x2^a[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tused[i] = 1\n\t\tif depth == 1 {\n\t\t\ts2 = a[i]\n\t\t}\n\t\tif solve(N, a, used, s2, x2, a[i], depth+1) {\n\t\t\treturn true\n\t\t}\n\t\tused[i] = 0\n\t}\n\treturn false\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// Genericsがないので筋肉で...\n// interfaceでの取扱がようわからんし\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// mapからkeysとvaluesを返す感じのやつ\n// なんかしらんけどmap[interface{}]interface{}しか受け付けない。なんのためのinterface{}やねん\n// なので呼ぶときのmapはmap[int]stringとかじゃダメ\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n\treturn\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence with N integers: A = \\{ A_1, A_2, \\cdots, A_N \\}.\nFor each of these N integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:\n\nIf A_i and A_j (i < j) are painted with the same color, A_i < A_j.\n\nFind the minimum number of colors required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of colors required to satisfy the condition.\n\nSample Input 1\n\n5\n2\n1\n4\n5\n3\n\nSample Output 1\n\n2\n\nWe can satisfy the condition with two colors by, for example, painting 2 and 3 red and painting 1, 4, and 5 blue.\n\nSample Input 2\n\n4\n0\n0\n0\n0\n\nSample Output 2\n\n4\n\nWe have to paint all the integers with distinct colors.", "sample_input": "5\n2\n1\n4\n5\n3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02973", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a sequence with N integers: A = \\{ A_1, A_2, \\cdots, A_N \\}.\nFor each of these N integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:\n\nIf A_i and A_j (i < j) are painted with the same color, A_i < A_j.\n\nFind the minimum number of colors required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of colors required to satisfy the condition.\n\nSample Input 1\n\n5\n2\n1\n4\n5\n3\n\nSample Output 1\n\n2\n\nWe can satisfy the condition with two colors by, for example, painting 2 and 3 red and painting 1, 4, and 5 blue.\n\nSample Input 2\n\n4\n0\n0\n0\n0\n\nSample Output 2\n\n4\n\nWe have to paint all the integers with distinct colors.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2799, "cpu_time_ms": 2108, "memory_kb": 3456}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s046105558", "group_id": "codeNet:p02974", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tk := scanInt()\n\n\tdp := [60][60][10000]int{}\n\tdp[0][0][0] = 1\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < i+1; j++ {\n\t\t\tfor x := 0; x < k+1; x++ {\n\t\t\t\tif j > 0 {\n\t\t\t\t\tdp[i+1][j-1][x+(j-1)*2] += dp[i][j][x]*j*j%MOD\n\t\t\t\t\tdp[i+1][j-1][x+(j-1)*2] %= MOD\n\t\t\t\t}\n\t\t\t\tdp[i+1][j][x+j*2] += dp[i][j][x] + dp[i][j][x]*j*2%MOD\n\t\t\t\tdp[i+1][j][x+j*2] %= MOD\n\t\t\t\tdp[i+1][j+1][x+(j+1)*2] += dp[i][j][x]\n\t\t\t\tdp[i+1][j+1][x+(j+1)*2] %= MOD\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, dp[n][0][k])\n}\n\n// MOD constant\nconst MOD = 1000000007\n", "language": "Go", "metadata": {"date": 1587524283, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02974.html", "problem_id": "p02974", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02974/input.txt", "sample_output_relpath": "derived/input_output/data/p02974/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02974/Go/s046105558.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s046105558", "user_id": "u548992197"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tk := scanInt()\n\n\tdp := [60][60][10000]int{}\n\tdp[0][0][0] = 1\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < i+1; j++ {\n\t\t\tfor x := 0; x < k+1; x++ {\n\t\t\t\tif j > 0 {\n\t\t\t\t\tdp[i+1][j-1][x+(j-1)*2] += dp[i][j][x]*j*j%MOD\n\t\t\t\t\tdp[i+1][j-1][x+(j-1)*2] %= MOD\n\t\t\t\t}\n\t\t\t\tdp[i+1][j][x+j*2] += dp[i][j][x] + dp[i][j][x]*j*2%MOD\n\t\t\t\tdp[i+1][j][x+j*2] %= MOD\n\t\t\t\tdp[i+1][j+1][x+(j+1)*2] += dp[i][j][x]\n\t\t\t\tdp[i+1][j+1][x+(j+1)*2] %= MOD\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, dp[n][0][k])\n}\n\n// MOD constant\nconst MOD = 1000000007\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nLet us define the oddness of a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n} as \\sum_{i = 1}^n |i - p_i|.\n\nFind the number of permutations of {1,\\ 2,\\ ...,\\ n} of oddness k, modulo 10^9+7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq n \\leq 50\n\n0 \\leq k \\leq n^2\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn k\n\nOutput\n\nPrint the number of permutations of {1,\\ 2,\\ ...,\\ n} of oddness k, modulo 10^9+7.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are six permutations of {1,\\ 2,\\ 3}. Among them, two have oddness of 2: {2,\\ 1,\\ 3} and {1,\\ 3,\\ 2}.\n\nSample Input 2\n\n39 14\n\nSample Output 2\n\n74764168", "sample_input": "3 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02974", "source_text": "Score : 600 points\n\nProblem Statement\n\nLet us define the oddness of a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n} as \\sum_{i = 1}^n |i - p_i|.\n\nFind the number of permutations of {1,\\ 2,\\ ...,\\ n} of oddness k, modulo 10^9+7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq n \\leq 50\n\n0 \\leq k \\leq n^2\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn k\n\nOutput\n\nPrint the number of permutations of {1,\\ 2,\\ ...,\\ n} of oddness k, modulo 10^9+7.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are six permutations of {1,\\ 2,\\ 3}. Among them, two have oddness of 2: {2,\\ 1,\\ 3} and {1,\\ 3,\\ 2}.\n\nSample Input 2\n\n39 14\n\nSample Output 2\n\n74764168", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1562, "cpu_time_ms": 214, "memory_kb": 290944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s901463788", "group_id": "codeNet:p02975", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc atoi(s string) int {\n\ti, _ := strconv.Atoi(s)\n\treturn i\n}\n\nfunc readInt() int {\n\treturn atoi(readLine())\n}\n\nfunc readInts() []int {\n\tin := readLine()\n\tins := strings.Split(in, \" \")\n\tout := make([]int, len(ins))\n\tfor i, v := range ins {\n\t\tout[i] = atoi(v)\n\t}\n\treturn out\n}\n\nfunc judge(a []int) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i == 0 {\n\t\t\tif a[0] != a[len(a)-1]^a[1] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else if i == len(a)-1 {\n\t\t\tif a[len(a)-1] != a[i-1]^a[0] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tif a[i] != a[i-1]^a[i+1] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tn := readInt()\n\ta := readInts()\n\n\tvar count int\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count == n {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tif n%3 != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tx := a[0]\n\ty := a[1]\n\tz := x ^ y\n\tvar xc, yc, zc int\n\tfor j := 0; j < n; j++ {\n\t\tif x == a[j] {\n\t\t\txc++\n\t\t}\n\t\tif y == a[j] {\n\t\t\tyc++\n\t\t}\n\t\tif z == a[j] {\n\t\t\tzc++\n\t\t}\n\t}\n\n\tif xc == yc && yc == zc && zc == xc {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563166726, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02975.html", "problem_id": "p02975", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02975/input.txt", "sample_output_relpath": "derived/input_output/data/p02975/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02975/Go/s901463788.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s901463788", "user_id": "u468482169"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc atoi(s string) int {\n\ti, _ := strconv.Atoi(s)\n\treturn i\n}\n\nfunc readInt() int {\n\treturn atoi(readLine())\n}\n\nfunc readInts() []int {\n\tin := readLine()\n\tins := strings.Split(in, \" \")\n\tout := make([]int, len(ins))\n\tfor i, v := range ins {\n\t\tout[i] = atoi(v)\n\t}\n\treturn out\n}\n\nfunc judge(a []int) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i == 0 {\n\t\t\tif a[0] != a[len(a)-1]^a[1] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else if i == len(a)-1 {\n\t\t\tif a[len(a)-1] != a[i-1]^a[0] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tif a[i] != a[i-1]^a[i+1] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tn := readInt()\n\ta := readInts()\n\n\tvar count int\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count == n {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tif n%3 != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tx := a[0]\n\ty := a[1]\n\tz := x ^ y\n\tvar xc, yc, zc int\n\tfor j := 0; j < n; j++ {\n\t\tif x == a[j] {\n\t\t\txc++\n\t\t}\n\t\tif y == a[j] {\n\t\t\tyc++\n\t\t}\n\t\tif z == a[j] {\n\t\t\tzc++\n\t\t}\n\t}\n\n\tif xc == yc && yc == zc && zc == xc {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02975", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1380, "cpu_time_ms": 25, "memory_kb": 5760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s930317127", "group_id": "codeNet:p02975", "input_text": "package main\n\nimport \"fmt\"\n\nfunc check(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*3 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc check2(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*2 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\n\tcounter := make(map[int]int)\n\tfor _, x := range xs {\n\t\tcounter[x]++\n\t}\n\n\tif len(counter) == 3 {\n\t\tif n%3 != 0 || !check(counter, n) {\n\t\t\tfmt.Println(\"No\")\n\t\t} else {\n\t\t\tvs := make([]int, 0)\n\t\t\tfor k := range counter {\n\t\t\t\tvs = append(vs, k)\n\t\t\t}\n\t\t\tif vs[0]^vs[1] == vs[2] {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t}\n\t} else if len(counter) == 2 {\n\t\tvs := make([]int, 0)\n\t\tfor k := range counter {\n\t\t\tvs = append(vs, k)\n\t\t}\n\t\tif vs[0] == 0 || vs[1] == 0 {\n\t\t\tnzero := 0\n\t\t\tif vs[0] == 0 {\n\t\t\t\tnzero = vs[1]\n\t\t\t} else {\n\t\t\t\tnzero = vs[0]\n\t\t\t}\n\t\t\tif (counter[nzero] >= counter[0] && counter[nzero] <= 2*counter[0]) || counter[0] >= counter[nzero] {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else if len(counter) == 1 {\n\t\tif counter[0] > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563156597, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02975.html", "problem_id": "p02975", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02975/input.txt", "sample_output_relpath": "derived/input_output/data/p02975/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02975/Go/s930317127.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s930317127", "user_id": "u113872560"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc check(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*3 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc check2(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*2 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\n\tcounter := make(map[int]int)\n\tfor _, x := range xs {\n\t\tcounter[x]++\n\t}\n\n\tif len(counter) == 3 {\n\t\tif n%3 != 0 || !check(counter, n) {\n\t\t\tfmt.Println(\"No\")\n\t\t} else {\n\t\t\tvs := make([]int, 0)\n\t\t\tfor k := range counter {\n\t\t\t\tvs = append(vs, k)\n\t\t\t}\n\t\t\tif vs[0]^vs[1] == vs[2] {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t}\n\t} else if len(counter) == 2 {\n\t\tvs := make([]int, 0)\n\t\tfor k := range counter {\n\t\t\tvs = append(vs, k)\n\t\t}\n\t\tif vs[0] == 0 || vs[1] == 0 {\n\t\t\tnzero := 0\n\t\t\tif vs[0] == 0 {\n\t\t\t\tnzero = vs[1]\n\t\t\t} else {\n\t\t\t\tnzero = vs[0]\n\t\t\t}\n\t\t\tif (counter[nzero] >= counter[0] && counter[nzero] <= 2*counter[0]) || counter[0] >= counter[nzero] {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else if len(counter) == 1 {\n\t\tif counter[0] > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02975", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1297, "cpu_time_ms": 735, "memory_kb": 7296}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s414932887", "group_id": "codeNet:p02975", "input_text": "package main\n\nimport \"fmt\"\n\nfunc check(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*3 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc check2(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*2 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\n\tcounter := make(map[int]int)\n\tfor _, x := range xs {\n\t\tcounter[x]++\n\t}\n\n\tif len(counter) == 3 {\n\t\tif n%3 != 0 || !check(counter, n) {\n\t\t\tfmt.Println(\"No\")\n\t\t} else {\n\t\t\tvs := make([]int, 0)\n\t\t\tfor k := range counter {\n\t\t\t\tvs = append(vs, k)\n\t\t\t}\n\t\t\tif vs[0]^vs[1] == vs[2] {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t}\n\t} else if len(counter) == 2 {\n\t\tvs := make([]int, 0)\n\t\tfor k := range counter {\n\t\t\tvs = append(vs, k)\n\t\t}\n\t\tif vs[0] == 0 || vs[1] == 0 {\n\t\t\tnzero := 0\n\t\t\tif vs[0] == 0 {\n\t\t\t\tnzero = vs[1]\n\t\t\t} else {\n\t\t\t\tnzero = vs[0]\n\t\t\t}\n\t\t\tif (counter[nzero] >= counter[0] && counter[nzero] <= 2*counter[0]) || (counter[0] >= counter[nzero] && counter[0] <= 2*counter[nzero]) {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else if len(counter) == 1 {\n\t\tif counter[0] > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563156369, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02975.html", "problem_id": "p02975", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02975/input.txt", "sample_output_relpath": "derived/input_output/data/p02975/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02975/Go/s414932887.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s414932887", "user_id": "u113872560"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc check(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*3 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc check2(cntr map[int]int, n int) bool {\n\tfor _, v := range cntr {\n\t\tif v*2 != n {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\n\tcounter := make(map[int]int)\n\tfor _, x := range xs {\n\t\tcounter[x]++\n\t}\n\n\tif len(counter) == 3 {\n\t\tif n%3 != 0 || !check(counter, n) {\n\t\t\tfmt.Println(\"No\")\n\t\t} else {\n\t\t\tvs := make([]int, 0)\n\t\t\tfor k := range counter {\n\t\t\t\tvs = append(vs, k)\n\t\t\t}\n\t\t\tif vs[0]^vs[1] == vs[2] {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t}\n\t} else if len(counter) == 2 {\n\t\tvs := make([]int, 0)\n\t\tfor k := range counter {\n\t\t\tvs = append(vs, k)\n\t\t}\n\t\tif vs[0] == 0 || vs[1] == 0 {\n\t\t\tnzero := 0\n\t\t\tif vs[0] == 0 {\n\t\t\t\tnzero = vs[1]\n\t\t\t} else {\n\t\t\t\tnzero = vs[0]\n\t\t\t}\n\t\t\tif (counter[nzero] >= counter[0] && counter[nzero] <= 2*counter[0]) || (counter[0] >= counter[nzero] && counter[0] <= 2*counter[nzero]) {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else if len(counter) == 1 {\n\t\tif counter[0] > 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02975", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1333, "cpu_time_ms": 680, "memory_kb": 7040}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s564867052", "group_id": "codeNet:p02976", "input_text": "package main\n \nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A *[]int) {\n S := make([]string, len((*A)))\n for i, a := range (*A) {\n S[i] = strconv.Itoa(a)\n }\n fmt.Fprintln(writer, strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\ntype Node struct {\n Index int\n Edge []int\n Degree int\n Undefined int\n Dist int\n}\nfunc main() {\n NM := NextIntVec()\n N, M := NM[0], NM[1]\n G := make([]Node, N)\n for i := range G {\n G[i] = Node{i, []int{}, 0, -1, -1}\n }\n E := make([][]int, M)\n for i := range E {\n AB := NextIntVec()\n A, B := AB[0] - 1, AB[1] - 1\n E[i] = []int{A, B}\n G[A].Edge = append(G[A].Edge, i)\n G[B].Edge = append(G[B].Edge, i)\n }\n G[0].Dist = 0\n Q := make([]int, N)\n pos := 1\n for i, _ := range Q {\n s := Q[i]\n for _, e := range G[s].Edge {\n if G[s].Undefined == e { continue }\n t := E[e][0]\n if t == s { t = E[e][1] }\n if G[t].Dist < 0 {\n Q[pos] = t\n pos++\n G[t].Undefined = e\n G[t].Dist = G[s].Dist + 1\n } else if E[e][0] == s {\n G[s].Degree++\n }\n }\n }\n for i := N - 1; 0 < i; i-- {\n s := Q[i]\n u := G[s].Undefined\n t := E[u][0]\n if t == s { t = E[u][1] }\n if G[s].Degree % 2 > 0 {\n E[u] = []int{s, t}\n } else {\n E[u] = []int{t, s}\n G[t].Degree++\n }\n }\n if M % 2 > 0 {\n Write(-1)\n } else {\n for i, e := range E {\n E[i] = []int{e[0] + 1, e[1] + 1}\n WriteIntVec(&E[i])\n }\n }\n Output()\n}", "language": "Go", "metadata": {"date": 1571801733, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02976.html", "problem_id": "p02976", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02976/input.txt", "sample_output_relpath": "derived/input_output/data/p02976/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02976/Go/s564867052.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s564867052", "user_id": "u415905784"}, "prompt_components": {"gold_output": "1 2\n1 4\n3 2\n3 4\n", "input_to_evaluate": "package main\n \nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A *[]int) {\n S := make([]string, len((*A)))\n for i, a := range (*A) {\n S[i] = strconv.Itoa(a)\n }\n fmt.Fprintln(writer, strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\ntype Node struct {\n Index int\n Edge []int\n Degree int\n Undefined int\n Dist int\n}\nfunc main() {\n NM := NextIntVec()\n N, M := NM[0], NM[1]\n G := make([]Node, N)\n for i := range G {\n G[i] = Node{i, []int{}, 0, -1, -1}\n }\n E := make([][]int, M)\n for i := range E {\n AB := NextIntVec()\n A, B := AB[0] - 1, AB[1] - 1\n E[i] = []int{A, B}\n G[A].Edge = append(G[A].Edge, i)\n G[B].Edge = append(G[B].Edge, i)\n }\n G[0].Dist = 0\n Q := make([]int, N)\n pos := 1\n for i, _ := range Q {\n s := Q[i]\n for _, e := range G[s].Edge {\n if G[s].Undefined == e { continue }\n t := E[e][0]\n if t == s { t = E[e][1] }\n if G[t].Dist < 0 {\n Q[pos] = t\n pos++\n G[t].Undefined = e\n G[t].Dist = G[s].Dist + 1\n } else if E[e][0] == s {\n G[s].Degree++\n }\n }\n }\n for i := N - 1; 0 < i; i-- {\n s := Q[i]\n u := G[s].Undefined\n t := E[u][0]\n if t == s { t = E[u][1] }\n if G[s].Degree % 2 > 0 {\n E[u] = []int{s, t}\n } else {\n E[u] = []int{t, s}\n G[t].Degree++\n }\n }\n if M % 2 > 0 {\n Write(-1)\n } else {\n for i, e := range E {\n E[i] = []int{e[0] + 1, e[1] + 1}\n WriteIntVec(&E[i])\n }\n }\n Output()\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nYou are given a simple connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the i-th edge connects Vertex A_i and Vertex B_i.\nTakahashi will assign one of the two possible directions to each of the edges in the graph to make a directed graph.\nDetermine if it is possible to make a directed graph with an even number of edges going out from every vertex. If the answer is yes, construct one such graph.\n\nNotes\n\nAn undirected graph is said to be simple when it contains no self-loops or multiple edges.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\nN-1 \\leq M \\leq 10^5\n\n1 \\leq A_i,B_i \\leq N (1\\leq i\\leq M)\n\nThe given graph is simple and connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf it is impossible to assign directions\b to satisfy the requirement, print -1.\nOtherwise, print an assignment of directions that satisfies the requirement, in the following format:\n\nC_1 D_1\n:\nC_M D_M\n\nHere each pair (C_i, D_i) means that there is an edge directed from Vertex C_i to Vertex D_i. The edges may be printed in any order.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 1\n\nSample Output 1\n\n1 2\n1 4\n3 2\n3 4\n\nAfter this assignment of directions, Vertex 1 and 3 will each have two outgoing edges, and Vertex 2 and 4 will each have zero outgoing edges.\n\nSample Input 2\n\n5 5\n1 2\n2 3\n3 4\n2 5\n4 5\n\nSample Output 2\n\n-1", "sample_input": "4 4\n1 2\n2 3\n3 4\n4 1\n"}, "reference_outputs": ["1 2\n1 4\n3 2\n3 4\n"], "source_document_id": "p02976", "source_text": "Score : 700 points\n\nProblem Statement\n\nYou are given a simple connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the i-th edge connects Vertex A_i and Vertex B_i.\nTakahashi will assign one of the two possible directions to each of the edges in the graph to make a directed graph.\nDetermine if it is possible to make a directed graph with an even number of edges going out from every vertex. If the answer is yes, construct one such graph.\n\nNotes\n\nAn undirected graph is said to be simple when it contains no self-loops or multiple edges.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\nN-1 \\leq M \\leq 10^5\n\n1 \\leq A_i,B_i \\leq N (1\\leq i\\leq M)\n\nThe given graph is simple and connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_M B_M\n\nOutput\n\nIf it is impossible to assign directions\b to satisfy the requirement, print -1.\nOtherwise, print an assignment of directions that satisfies the requirement, in the following format:\n\nC_1 D_1\n:\nC_M D_M\n\nHere each pair (C_i, D_i) means that there is an edge directed from Vertex C_i to Vertex D_i. The edges may be printed in any order.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 1\n\nSample Output 1\n\n1 2\n1 4\n3 2\n3 4\n\nAfter this assignment of directions, Vertex 1 and 3 will each have two outgoing edges, and Vertex 2 and 4 will each have zero outgoing edges.\n\nSample Input 2\n\n5 5\n1 2\n2 3\n3 4\n2 5\n4 5\n\nSample Output 2\n\n-1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2158, "cpu_time_ms": 216, "memory_kb": 25852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s822070015", "group_id": "codeNet:p02981", "input_text": "//go:generate echo \"https://atcoder.jp/contests/abc133/tasks/abc133_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scan = newScanner(os.Stdin)\n\nfunc solve() {\n}\n\nfunc main() {\n\tN, A, B := scan.Int(), scan.Int(), scan.Int()\n\tfmt.Println(imin(N*A, B))\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Float64s(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc isum(X []int) int {\n\ts := 0\n\tfor _, x := range X {\n\t\ts += x\n\t}\n\treturn s\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "language": "Go", "metadata": {"date": 1601067452, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02981.html", "problem_id": "p02981", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02981/input.txt", "sample_output_relpath": "derived/input_output/data/p02981/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02981/Go/s822070015.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s822070015", "user_id": "u890085018"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/abc133/tasks/abc133_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scan = newScanner(os.Stdin)\n\nfunc solve() {\n}\n\nfunc main() {\n\tN, A, B := scan.Int(), scan.Int(), scan.Int()\n\tfmt.Println(imin(N*A, B))\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Float64s(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc isum(X []int) int {\n\ts := 0\n\tfor _, x := range X {\n\t\ts += x\n\t}\n\treturn s\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "sample_input": "4 2 9\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02981", "source_text": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4512, "cpu_time_ms": 4, "memory_kb": 1788}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s431539720", "group_id": "codeNet:p02981", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n, &a, &b)\n\n\ttrain := a * n\n\ttaxi := b\n\n\tif train > taxi {\n\t\tfmt.Println(taxi)\n\t} else {\n\t\tfmt.Println(train)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1576040430, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02981.html", "problem_id": "p02981", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02981/input.txt", "sample_output_relpath": "derived/input_output/data/p02981/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02981/Go/s431539720.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s431539720", "user_id": "u380695762"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n, &a, &b)\n\n\ttrain := a * n\n\ttaxi := b\n\n\tif train > taxi {\n\t\tfmt.Println(taxi)\n\t} else {\n\t\tfmt.Println(train)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "sample_input": "4 2 9\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02981", "source_text": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s732281635", "group_id": "codeNet:p02981", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N, A, B float64\n\tfmt.Scan(&N, &A, &B)\n\tfmt.Println(math.Min(A*N, B*N))\n}\n", "language": "Go", "metadata": {"date": 1563158562, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02981.html", "problem_id": "p02981", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02981/input.txt", "sample_output_relpath": "derived/input_output/data/p02981/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02981/Go/s732281635.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s732281635", "user_id": "u764750862"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N, A, B float64\n\tfmt.Scan(&N, &A, &B)\n\tfmt.Println(math.Min(A*N, B*N))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "sample_input": "4 2 9\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02981", "source_text": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 133, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s705335282", "group_id": "codeNet:p02982", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N, D, X, r int\n\tfmt.Scan(&N, &D)\n\tvar x [][]int\n\tfor i := 0; i < N; i++ {\n\t\tw := make([]int, D)\n\t\tfor j := 0; j < D; j++ {\n\t\t\tfmt.Scan(&X)\n\t\t\tw[j] = X\n\t\t}\n\t\tx = append(x, w)\n\t}\n\tfor i := 0; i < N-1; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tp := 0\n\t\t\tfor k := 0; k < D; k++ {\n\t\t\t\tq := x[i][k] - x[j][k]\n\t\t\t\tp += q * q\n\t\t\t}\n\t\t\tn := math.Sqrt(float64(p))\n\t\t\tif n == float64(int64(n)) {\n\t\t\t\tr++\n\t\t\t}\n\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "language": "Go", "metadata": {"date": 1567423155, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02982.html", "problem_id": "p02982", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02982/input.txt", "sample_output_relpath": "derived/input_output/data/p02982/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02982/Go/s705335282.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s705335282", "user_id": "u298152049"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N, D, X, r int\n\tfmt.Scan(&N, &D)\n\tvar x [][]int\n\tfor i := 0; i < N; i++ {\n\t\tw := make([]int, D)\n\t\tfor j := 0; j < D; j++ {\n\t\t\tfmt.Scan(&X)\n\t\t\tw[j] = X\n\t\t}\n\t\tx = append(x, w)\n\t}\n\tfor i := 0; i < N-1; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tp := 0\n\t\t\tfor k := 0; k < D; k++ {\n\t\t\t\tq := x[i][k] - x[j][k]\n\t\t\t\tp += q * q\n\t\t\t}\n\t\t\tn := math.Sqrt(float64(p))\n\t\t\tif n == float64(int64(n)) {\n\t\t\t\tr++\n\t\t\t}\n\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N points in a D-dimensional space.\n\nThe coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).\n\nThe distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \\sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}.\n\nHow many pairs (i, j) (i < j) are there such that the distance between the i-th point and the j-th point is an integer?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10\n\n1 \\leq D \\leq 10\n\n-20 \\leq X_{ij} \\leq 20\n\nNo two given points have the same coordinates. That is, if i \\neq j, there exists k such that X_{ik} \\neq X_{jk}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_{11} X_{12} ... X_{1D}\nX_{21} X_{22} ... X_{2D}\n\\vdots\nX_{N1} X_{N2} ... X_{ND}\n\nOutput\n\nPrint the number of pairs (i, j) (i < j) such that the distance between the i-th point and the j-th point is an integer.\n\nSample Input 1\n\n3 2\n1 2\n5 5\n-2 8\n\nSample Output 1\n\n1\n\nThe number of pairs with an integer distance is one, as follows:\n\nThe distance between the first point and the second point is \\sqrt{|1-5|^2 + |2-5|^2} = 5, which is an integer.\n\nThe distance between the second point and the third point is \\sqrt{|5-(-2)|^2 + |5-8|^2} = \\sqrt{58}, which is not an integer.\n\nThe distance between the third point and the first point is \\sqrt{|-2-1|^2+|8-2|^2} = 3\\sqrt{5}, which is not an integer.\n\nSample Input 2\n\n3 4\n-3 7 8 2\n-12 1 10 2\n-2 8 9 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 1\n1\n2\n3\n4\n5\n\nSample Output 3\n\n10", "sample_input": "3 2\n1 2\n5 5\n-2 8\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02982", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N points in a D-dimensional space.\n\nThe coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).\n\nThe distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \\sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}.\n\nHow many pairs (i, j) (i < j) are there such that the distance between the i-th point and the j-th point is an integer?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10\n\n1 \\leq D \\leq 10\n\n-20 \\leq X_{ij} \\leq 20\n\nNo two given points have the same coordinates. That is, if i \\neq j, there exists k such that X_{ik} \\neq X_{jk}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN D\nX_{11} X_{12} ... X_{1D}\nX_{21} X_{22} ... X_{2D}\n\\vdots\nX_{N1} X_{N2} ... X_{ND}\n\nOutput\n\nPrint the number of pairs (i, j) (i < j) such that the distance between the i-th point and the j-th point is an integer.\n\nSample Input 1\n\n3 2\n1 2\n5 5\n-2 8\n\nSample Output 1\n\n1\n\nThe number of pairs with an integer distance is one, as follows:\n\nThe distance between the first point and the second point is \\sqrt{|1-5|^2 + |2-5|^2} = 5, which is an integer.\n\nThe distance between the second point and the third point is \\sqrt{|5-(-2)|^2 + |5-8|^2} = \\sqrt{58}, which is not an integer.\n\nThe distance between the third point and the first point is \\sqrt{|-2-1|^2+|8-2|^2} = 3\\sqrt{5}, which is not an integer.\n\nSample Input 2\n\n3 4\n-3 7 8 2\n-12 1 10 2\n-2 8 9 3\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 1\n1\n2\n3\n4\n5\n\nSample Output 3\n\n10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 480, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s833768290", "group_id": "codeNet:p02984", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t}\n\tb := 0\n\tfor i := 0; i < N; i++ {\n\t\tif i%2 == 0 {\n\t\t\tb += a[i]\n\t\t} else {\n\t\t\tb -= a[i]\n\t\t}\n\t}\n\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tfmt.Fprint(w, b, \" \")\n\tfor i := 0; i < N-1; i++ {\n\t\tb = a[i] - b/2\n\t\tb *= 2\n\t\tfmt.Fprint(w, b, \" \")\n\t}\n\tfmt.Fprintln(w)\n}\n", "language": "Go", "metadata": {"date": 1590630037, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02984.html", "problem_id": "p02984", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02984/input.txt", "sample_output_relpath": "derived/input_output/data/p02984/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02984/Go/s833768290.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s833768290", "user_id": "u814575783"}, "prompt_components": {"gold_output": "4 0 4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t}\n\tb := 0\n\tfor i := 0; i < N; i++ {\n\t\tif i%2 == 0 {\n\t\t\tb += a[i]\n\t\t} else {\n\t\t\tb -= a[i]\n\t\t}\n\t}\n\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tfmt.Fprint(w, b, \" \")\n\tfor i := 0; i < N-1; i++ {\n\t\tb = a[i] - b/2\n\t\tb *= 2\n\t\tfmt.Fprint(w, b, \" \")\n\t}\n\tfmt.Fprintln(w)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N mountains in a circle, called Mountain 1, Mountain 2, ..., Mountain N in clockwise order. N is an odd number.\n\nBetween these mountains, there are N dams, called Dam 1, Dam 2, ..., Dam N. Dam i (1 \\leq i \\leq N) is located between Mountain i and i+1 (Mountain N+1 is Mountain 1).\n\nWhen Mountain i (1 \\leq i \\leq N) receives 2x liters of rain, Dam i-1 and Dam i each accumulates x liters of water (Dam 0 is Dam N).\n\nOne day, each of the mountains received a non-negative even number of liters of rain.\n\nAs a result, Dam i (1 \\leq i \\leq N) accumulated a total of A_i liters of water.\n\nFind the amount of rain each of the mountains received. We can prove that the solution is unique under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^5-1\n\nN is an odd number.\n\n0 \\leq A_i \\leq 10^9\n\nThe situation represented by input can occur when each of the mountains receives a non-negative even number of liters of rain.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N integers representing the number of liters of rain Mountain 1, Mountain 2, ..., Mountain N received, in this order.\n\nSample Input 1\n\n3\n2 2 4\n\nSample Output 1\n\n4 0 4\n\nIf we assume Mountain 1, 2, and 3 received 4, 0, and 4 liters of rain, respectively, it is consistent with this input, as follows:\n\nDam 1 should have accumulated \\frac{4}{2} + \\frac{0}{2} = 2 liters of water.\n\nDam 2 should have accumulated \\frac{0}{2} + \\frac{4}{2} = 2 liters of water.\n\nDam 3 should have accumulated \\frac{4}{2} + \\frac{4}{2} = 4 liters of water.\n\nSample Input 2\n\n5\n3 8 7 5 5\n\nSample Output 2\n\n2 4 12 2 8\n\nSample Input 3\n\n3\n1000000000 1000000000 0\n\nSample Output 3\n\n0 2000000000 0", "sample_input": "3\n2 2 4\n"}, "reference_outputs": ["4 0 4\n"], "source_document_id": "p02984", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N mountains in a circle, called Mountain 1, Mountain 2, ..., Mountain N in clockwise order. N is an odd number.\n\nBetween these mountains, there are N dams, called Dam 1, Dam 2, ..., Dam N. Dam i (1 \\leq i \\leq N) is located between Mountain i and i+1 (Mountain N+1 is Mountain 1).\n\nWhen Mountain i (1 \\leq i \\leq N) receives 2x liters of rain, Dam i-1 and Dam i each accumulates x liters of water (Dam 0 is Dam N).\n\nOne day, each of the mountains received a non-negative even number of liters of rain.\n\nAs a result, Dam i (1 \\leq i \\leq N) accumulated a total of A_i liters of water.\n\nFind the amount of rain each of the mountains received. We can prove that the solution is unique under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^5-1\n\nN is an odd number.\n\n0 \\leq A_i \\leq 10^9\n\nThe situation represented by input can occur when each of the mountains receives a non-negative even number of liters of rain.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N integers representing the number of liters of rain Mountain 1, Mountain 2, ..., Mountain N received, in this order.\n\nSample Input 1\n\n3\n2 2 4\n\nSample Output 1\n\n4 0 4\n\nIf we assume Mountain 1, 2, and 3 received 4, 0, and 4 liters of rain, respectively, it is consistent with this input, as follows:\n\nDam 1 should have accumulated \\frac{4}{2} + \\frac{0}{2} = 2 liters of water.\n\nDam 2 should have accumulated \\frac{0}{2} + \\frac{4}{2} = 2 liters of water.\n\nDam 3 should have accumulated \\frac{4}{2} + \\frac{4}{2} = 4 liters of water.\n\nSample Input 2\n\n5\n3 8 7 5 5\n\nSample Output 2\n\n2 4 12 2 8\n\nSample Input 3\n\n3\n1000000000 1000000000 0\n\nSample Output 3\n\n0 2000000000 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1261, "cpu_time_ms": 61, "memory_kb": 5760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s149678116", "group_id": "codeNet:p02984", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\tlis := make([]int, 0, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tlis = append(lis, nextInt())\n\t}\n\n\tvar x2 int\n\tfor i, item := range lis {\n\t\tif i%2 == 0 {\n\t\t\tx2 += item\n\t\t} else {\n\t\t\tx2 -= item\n\t\t}\n\t}\n\n\tans := make([]int, len(lis), len(lis))\n\n\tans[0] = x2 / 2\n\tfor i := 1; i < n; i++ {\n\t\tans[i] = lis[i-1] - ans[i-1]\n\t}\n\n\tfor _, item := range ans {\n\t\tfmt.Printf(\"%#v \", item*2)\n\t}\n\tfmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1562819041, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02984.html", "problem_id": "p02984", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02984/input.txt", "sample_output_relpath": "derived/input_output/data/p02984/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02984/Go/s149678116.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s149678116", "user_id": "u317845566"}, "prompt_components": {"gold_output": "4 0 4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\tlis := make([]int, 0, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tlis = append(lis, nextInt())\n\t}\n\n\tvar x2 int\n\tfor i, item := range lis {\n\t\tif i%2 == 0 {\n\t\t\tx2 += item\n\t\t} else {\n\t\t\tx2 -= item\n\t\t}\n\t}\n\n\tans := make([]int, len(lis), len(lis))\n\n\tans[0] = x2 / 2\n\tfor i := 1; i < n; i++ {\n\t\tans[i] = lis[i-1] - ans[i-1]\n\t}\n\n\tfor _, item := range ans {\n\t\tfmt.Printf(\"%#v \", item*2)\n\t}\n\tfmt.Println()\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N mountains in a circle, called Mountain 1, Mountain 2, ..., Mountain N in clockwise order. N is an odd number.\n\nBetween these mountains, there are N dams, called Dam 1, Dam 2, ..., Dam N. Dam i (1 \\leq i \\leq N) is located between Mountain i and i+1 (Mountain N+1 is Mountain 1).\n\nWhen Mountain i (1 \\leq i \\leq N) receives 2x liters of rain, Dam i-1 and Dam i each accumulates x liters of water (Dam 0 is Dam N).\n\nOne day, each of the mountains received a non-negative even number of liters of rain.\n\nAs a result, Dam i (1 \\leq i \\leq N) accumulated a total of A_i liters of water.\n\nFind the amount of rain each of the mountains received. We can prove that the solution is unique under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^5-1\n\nN is an odd number.\n\n0 \\leq A_i \\leq 10^9\n\nThe situation represented by input can occur when each of the mountains receives a non-negative even number of liters of rain.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N integers representing the number of liters of rain Mountain 1, Mountain 2, ..., Mountain N received, in this order.\n\nSample Input 1\n\n3\n2 2 4\n\nSample Output 1\n\n4 0 4\n\nIf we assume Mountain 1, 2, and 3 received 4, 0, and 4 liters of rain, respectively, it is consistent with this input, as follows:\n\nDam 1 should have accumulated \\frac{4}{2} + \\frac{0}{2} = 2 liters of water.\n\nDam 2 should have accumulated \\frac{0}{2} + \\frac{4}{2} = 2 liters of water.\n\nDam 3 should have accumulated \\frac{4}{2} + \\frac{4}{2} = 4 liters of water.\n\nSample Input 2\n\n5\n3 8 7 5 5\n\nSample Output 2\n\n2 4 12 2 8\n\nSample Input 3\n\n3\n1000000000 1000000000 0\n\nSample Output 3\n\n0 2000000000 0", "sample_input": "3\n2 2 4\n"}, "reference_outputs": ["4 0 4\n"], "source_document_id": "p02984", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N mountains in a circle, called Mountain 1, Mountain 2, ..., Mountain N in clockwise order. N is an odd number.\n\nBetween these mountains, there are N dams, called Dam 1, Dam 2, ..., Dam N. Dam i (1 \\leq i \\leq N) is located between Mountain i and i+1 (Mountain N+1 is Mountain 1).\n\nWhen Mountain i (1 \\leq i \\leq N) receives 2x liters of rain, Dam i-1 and Dam i each accumulates x liters of water (Dam 0 is Dam N).\n\nOne day, each of the mountains received a non-negative even number of liters of rain.\n\nAs a result, Dam i (1 \\leq i \\leq N) accumulated a total of A_i liters of water.\n\nFind the amount of rain each of the mountains received. We can prove that the solution is unique under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^5-1\n\nN is an odd number.\n\n0 \\leq A_i \\leq 10^9\n\nThe situation represented by input can occur when each of the mountains receives a non-negative even number of liters of rain.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N integers representing the number of liters of rain Mountain 1, Mountain 2, ..., Mountain N received, in this order.\n\nSample Input 1\n\n3\n2 2 4\n\nSample Output 1\n\n4 0 4\n\nIf we assume Mountain 1, 2, and 3 received 4, 0, and 4 liters of rain, respectively, it is consistent with this input, as follows:\n\nDam 1 should have accumulated \\frac{4}{2} + \\frac{0}{2} = 2 liters of water.\n\nDam 2 should have accumulated \\frac{0}{2} + \\frac{4}{2} = 2 liters of water.\n\nDam 3 should have accumulated \\frac{4}{2} + \\frac{4}{2} = 4 liters of water.\n\nSample Input 2\n\n5\n3 8 7 5 5\n\nSample Output 2\n\n2 4 12 2 8\n\nSample Input 3\n\n3\n1000000000 1000000000 0\n\nSample Output 3\n\n0 2000000000 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 738, "cpu_time_ms": 256, "memory_kb": 5760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s402342435", "group_id": "codeNet:p02984", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := make([]int, n)\n\ts := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\ts += a[i]\n\t}\n\n\tx := make([]int, n)\n\tfor i := 1; i < n; i += 2 {\n\t\ts -= 2 * a[i]\n\t}\n\tx[0] = s\n\n\tfor i := 0; i < n-1; i++ {\n\t\tx[i+1] = 2*a[i] - x[i]\n\t}\n\n\tfmt.Println(x)\n\n}\n", "language": "Go", "metadata": {"date": 1562607602, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02984.html", "problem_id": "p02984", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02984/input.txt", "sample_output_relpath": "derived/input_output/data/p02984/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02984/Go/s402342435.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s402342435", "user_id": "u710190793"}, "prompt_components": {"gold_output": "4 0 4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := make([]int, n)\n\ts := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\ts += a[i]\n\t}\n\n\tx := make([]int, n)\n\tfor i := 1; i < n; i += 2 {\n\t\ts -= 2 * a[i]\n\t}\n\tx[0] = s\n\n\tfor i := 0; i < n-1; i++ {\n\t\tx[i+1] = 2*a[i] - x[i]\n\t}\n\n\tfmt.Println(x)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N mountains in a circle, called Mountain 1, Mountain 2, ..., Mountain N in clockwise order. N is an odd number.\n\nBetween these mountains, there are N dams, called Dam 1, Dam 2, ..., Dam N. Dam i (1 \\leq i \\leq N) is located between Mountain i and i+1 (Mountain N+1 is Mountain 1).\n\nWhen Mountain i (1 \\leq i \\leq N) receives 2x liters of rain, Dam i-1 and Dam i each accumulates x liters of water (Dam 0 is Dam N).\n\nOne day, each of the mountains received a non-negative even number of liters of rain.\n\nAs a result, Dam i (1 \\leq i \\leq N) accumulated a total of A_i liters of water.\n\nFind the amount of rain each of the mountains received. We can prove that the solution is unique under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^5-1\n\nN is an odd number.\n\n0 \\leq A_i \\leq 10^9\n\nThe situation represented by input can occur when each of the mountains receives a non-negative even number of liters of rain.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N integers representing the number of liters of rain Mountain 1, Mountain 2, ..., Mountain N received, in this order.\n\nSample Input 1\n\n3\n2 2 4\n\nSample Output 1\n\n4 0 4\n\nIf we assume Mountain 1, 2, and 3 received 4, 0, and 4 liters of rain, respectively, it is consistent with this input, as follows:\n\nDam 1 should have accumulated \\frac{4}{2} + \\frac{0}{2} = 2 liters of water.\n\nDam 2 should have accumulated \\frac{0}{2} + \\frac{4}{2} = 2 liters of water.\n\nDam 3 should have accumulated \\frac{4}{2} + \\frac{4}{2} = 4 liters of water.\n\nSample Input 2\n\n5\n3 8 7 5 5\n\nSample Output 2\n\n2 4 12 2 8\n\nSample Input 3\n\n3\n1000000000 1000000000 0\n\nSample Output 3\n\n0 2000000000 0", "sample_input": "3\n2 2 4\n"}, "reference_outputs": ["4 0 4\n"], "source_document_id": "p02984", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N mountains in a circle, called Mountain 1, Mountain 2, ..., Mountain N in clockwise order. N is an odd number.\n\nBetween these mountains, there are N dams, called Dam 1, Dam 2, ..., Dam N. Dam i (1 \\leq i \\leq N) is located between Mountain i and i+1 (Mountain N+1 is Mountain 1).\n\nWhen Mountain i (1 \\leq i \\leq N) receives 2x liters of rain, Dam i-1 and Dam i each accumulates x liters of water (Dam 0 is Dam N).\n\nOne day, each of the mountains received a non-negative even number of liters of rain.\n\nAs a result, Dam i (1 \\leq i \\leq N) accumulated a total of A_i liters of water.\n\nFind the amount of rain each of the mountains received. We can prove that the solution is unique under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^5-1\n\nN is an odd number.\n\n0 \\leq A_i \\leq 10^9\n\nThe situation represented by input can occur when each of the mountains receives a non-negative even number of liters of rain.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N integers representing the number of liters of rain Mountain 1, Mountain 2, ..., Mountain N received, in this order.\n\nSample Input 1\n\n3\n2 2 4\n\nSample Output 1\n\n4 0 4\n\nIf we assume Mountain 1, 2, and 3 received 4, 0, and 4 liters of rain, respectively, it is consistent with this input, as follows:\n\nDam 1 should have accumulated \\frac{4}{2} + \\frac{0}{2} = 2 liters of water.\n\nDam 2 should have accumulated \\frac{0}{2} + \\frac{4}{2} = 2 liters of water.\n\nDam 3 should have accumulated \\frac{4}{2} + \\frac{4}{2} = 4 liters of water.\n\nSample Input 2\n\n5\n3 8 7 5 5\n\nSample Output 2\n\n2 4 12 2 8\n\nSample Input 3\n\n3\n1000000000 1000000000 0\n\nSample Output 3\n\n0 2000000000 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 563, "cpu_time_ms": 54, "memory_kb": 8192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s496757886", "group_id": "codeNet:p02986", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, q int\n\tfmt.Scan(&n)\n\tfmt.Scan(&q)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tnodes := make([][][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tnodes[i] = [][]int{}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tscanner.Scan()\n\t\ta, _ := strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\tb, _ := strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\tc, _ := strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\td, _ := strconv.Atoi(scanner.Text())\n\t\ta--\n\t\tb--\n\t\tc--\n\t\tnodes[a] = append(nodes[a], []int{b, c, d})\n\t\tnodes[b] = append(nodes[b], []int{a, c, d})\n\t}\n\n\tlog2n := 17\n\tparents := make([][]int, n)\n\tdepths := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tparents[i] = make([]int, log2n+1)\n\t}\n\n\tqueues := [][]int{\n\t\t{0, 0, 0},\n\t}\n\tfor len(queues) > 0 {\n\t\tnode := queues[0][0]\n\t\tparent := queues[0][1]\n\t\tdepth := queues[0][2]\n\n\t\tparents[node][0] = parent\n\t\tdepths[node] = depth\n\n\t\tfor i := 0; i < len(nodes[node]); i++ {\n\t\t\tif nodes[node][i][0] == parent {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tqueues = append(queues, []int{nodes[node][i][0], node, depth + 1})\n\t\t}\n\n\t\tqueues = queues[1:]\n\t}\n\n\tfor i := 1; i <= log2n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tparents[j][i] = parents[parents[j][i-1]][i-1]\n\t\t}\n\t}\n\n\tx := make([]int, q)\n\ty := make([]int, q)\n\tu := make([]int, q)\n\tv := make([]int, q)\n\tlca := make([]int, q)\n\tneed := make([]map[int]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\tneed[i] = make(map[int]bool)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\tx[i], _ = strconv.Atoi(scanner.Text())\n\t\tx[i]--\n\t\tscanner.Scan()\n\t\ty[i], _ = strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\tu[i], _ = strconv.Atoi(scanner.Text())\n\t\tu[i]--\n\t\tscanner.Scan()\n\t\tv[i], _ = strconv.Atoi(scanner.Text())\n\t\tv[i]--\n\n\t\tuu := u[i]\n\t\tvv := v[i]\n\t\txx := x[i]\n\t\tif depths[uu] > depths[vv] {\n\t\t\tuu, vv = vv, uu\n\t\t}\n\n\t\ta := uu\n\t\tb := vv\n\t\tdiff := depths[vv] - depths[uu]\n\t\tfor j := uint(0); j <= uint(log2n); j++ {\n\t\t\tif (diff>>j)&1 == 1 {\n\t\t\t\tb = parents[b][j]\n\t\t\t}\n\t\t}\n\t\tfor j := log2n; j >= 0; j-- {\n\t\t\tif parents[a][j] != parents[b][j] {\n\t\t\t\ta = parents[a][j]\n\t\t\t\tb = parents[b][j]\n\t\t\t}\n\t\t}\n\t\tlca[i] = parents[a][0]\n\n\t\tneed[uu][xx] = true\n\t\tneed[vv][xx] = true\n\t\tneed[lca[i]][xx] = true\n \t}\n\n\tprefixSum := make([]int64, n)\n\ttotalColorCount := make([]int, n-1)\n\ttotalColorDist := make([]int64, n-1)\n\tprefixColorCount := make([][]int, n)\n\tprefixColorDist := make([][]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tprefixColorCount[i] = make([]int, n-1)\n\t\tprefixColorDist[i] = make([]int64, n-1)\n\t}\n\n\tvar dfs func(node int, parent int)\n\tdfs = func(node int, parent int) {\n\t\tfor c := range need[node] {\n\t\t\tprefixColorCount[node][c] = totalColorCount[c]\n\t\t\tprefixColorDist[node][c] = totalColorDist[c]\n\t\t}\n\n\t\tfor i := 0; i < len(nodes[node]); i++ {\n\t\t\tchild := nodes[node][i][0]\n\t\t\tif child == parent {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tc := nodes[node][i][1]\n\t\t\td := nodes[node][i][2]\n\n\t\t\tprefixSum[child] = prefixSum[node] + int64(d)\n\n\t\t\ttotalColorCount[c]++\n\t\t\ttotalColorDist[c] += int64(d)\n\t\t\tdfs(child, node)\n\t\t\ttotalColorCount[c]--\n\t\t\ttotalColorDist[c] -= int64(d)\n\t\t}\n\t}\n\tdfs(0, 0)\n\n\t/*\n\tqueues = [][]int{{0, 0, 0, -1, 0}}\n\tfor len(queues) > 0 {\n\t\top := queues[0][0]\n\t\tnode := queues[0][1]\n\t\tparent := queues[0][2]\n\t\tcolor := queues[0][3]\n\t\tdist := queues[0][4]\n\n\t\tqueues = queues[1:]\n\n\t\tif op == 0 {\n\t\t\tif color != -1 {\n\t\t\t\ttotalColorCount[color]++\n\t\t\t\ttotalColorDist[color] += int64(dist)\n\t\t\t}\n\n\t\t\tfor c := range need[node] {\n\t\t\t\tprefixColorCount[node][c] = totalColorCount[c]\n\t\t\t\tprefixColorDist[node][c] = totalColorDist[c]\n\t\t\t}\n\n\t\t\tfor i := 0; i < len(nodes[node]); i++ {\n\t\t\t\tchild := nodes[node][i][0]\n\t\t\t\tif child == parent {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tc := nodes[node][i][1]\n\t\t\t\td := nodes[node][i][2]\n\n\t\t\t\tprefixSum[child] = prefixSum[node] + int64(d)\n\n\t\t\t\tqueues = append([][]int{{0, child, node, c, d}, {1, child, node, c, d}}, queues...)\n\t\t\t}\n\t\t} else {\n\t\t\ttotalColorCount[color]--\n\t\t\ttotalColorDist[color] -= int64(dist)\n\t\t}\n\t}\n\t */\n\n\tfor i := 0; i < q; i++ {\n\t\tuu := u[i]\n\t\tvv := v[i]\n\t\txx := x[i]\n\t\tyy := y[i]\n\t\tll := lca[i]\n\n\t\tdu := prefixSum[uu] - prefixColorDist[uu][xx] + int64(prefixColorCount[uu][xx]*yy)\n\t\tdv := prefixSum[vv] - prefixColorDist[vv][xx] + int64(prefixColorCount[vv][xx]*yy)\n\t\tdlca := prefixSum[ll] - prefixColorDist[ll][xx] + int64(prefixColorCount[ll][xx]*yy)\n\t\td := du + dv - 2*dlca\n\t\tfmt.Println(d)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563070046, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02986.html", "problem_id": "p02986", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02986/input.txt", "sample_output_relpath": "derived/input_output/data/p02986/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02986/Go/s496757886.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s496757886", "user_id": "u836866227"}, "prompt_components": {"gold_output": "130\n200\n60\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, q int\n\tfmt.Scan(&n)\n\tfmt.Scan(&q)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tnodes := make([][][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tnodes[i] = [][]int{}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tscanner.Scan()\n\t\ta, _ := strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\tb, _ := strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\tc, _ := strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\td, _ := strconv.Atoi(scanner.Text())\n\t\ta--\n\t\tb--\n\t\tc--\n\t\tnodes[a] = append(nodes[a], []int{b, c, d})\n\t\tnodes[b] = append(nodes[b], []int{a, c, d})\n\t}\n\n\tlog2n := 17\n\tparents := make([][]int, n)\n\tdepths := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tparents[i] = make([]int, log2n+1)\n\t}\n\n\tqueues := [][]int{\n\t\t{0, 0, 0},\n\t}\n\tfor len(queues) > 0 {\n\t\tnode := queues[0][0]\n\t\tparent := queues[0][1]\n\t\tdepth := queues[0][2]\n\n\t\tparents[node][0] = parent\n\t\tdepths[node] = depth\n\n\t\tfor i := 0; i < len(nodes[node]); i++ {\n\t\t\tif nodes[node][i][0] == parent {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tqueues = append(queues, []int{nodes[node][i][0], node, depth + 1})\n\t\t}\n\n\t\tqueues = queues[1:]\n\t}\n\n\tfor i := 1; i <= log2n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tparents[j][i] = parents[parents[j][i-1]][i-1]\n\t\t}\n\t}\n\n\tx := make([]int, q)\n\ty := make([]int, q)\n\tu := make([]int, q)\n\tv := make([]int, q)\n\tlca := make([]int, q)\n\tneed := make([]map[int]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\tneed[i] = make(map[int]bool)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\tx[i], _ = strconv.Atoi(scanner.Text())\n\t\tx[i]--\n\t\tscanner.Scan()\n\t\ty[i], _ = strconv.Atoi(scanner.Text())\n\t\tscanner.Scan()\n\t\tu[i], _ = strconv.Atoi(scanner.Text())\n\t\tu[i]--\n\t\tscanner.Scan()\n\t\tv[i], _ = strconv.Atoi(scanner.Text())\n\t\tv[i]--\n\n\t\tuu := u[i]\n\t\tvv := v[i]\n\t\txx := x[i]\n\t\tif depths[uu] > depths[vv] {\n\t\t\tuu, vv = vv, uu\n\t\t}\n\n\t\ta := uu\n\t\tb := vv\n\t\tdiff := depths[vv] - depths[uu]\n\t\tfor j := uint(0); j <= uint(log2n); j++ {\n\t\t\tif (diff>>j)&1 == 1 {\n\t\t\t\tb = parents[b][j]\n\t\t\t}\n\t\t}\n\t\tfor j := log2n; j >= 0; j-- {\n\t\t\tif parents[a][j] != parents[b][j] {\n\t\t\t\ta = parents[a][j]\n\t\t\t\tb = parents[b][j]\n\t\t\t}\n\t\t}\n\t\tlca[i] = parents[a][0]\n\n\t\tneed[uu][xx] = true\n\t\tneed[vv][xx] = true\n\t\tneed[lca[i]][xx] = true\n \t}\n\n\tprefixSum := make([]int64, n)\n\ttotalColorCount := make([]int, n-1)\n\ttotalColorDist := make([]int64, n-1)\n\tprefixColorCount := make([][]int, n)\n\tprefixColorDist := make([][]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tprefixColorCount[i] = make([]int, n-1)\n\t\tprefixColorDist[i] = make([]int64, n-1)\n\t}\n\n\tvar dfs func(node int, parent int)\n\tdfs = func(node int, parent int) {\n\t\tfor c := range need[node] {\n\t\t\tprefixColorCount[node][c] = totalColorCount[c]\n\t\t\tprefixColorDist[node][c] = totalColorDist[c]\n\t\t}\n\n\t\tfor i := 0; i < len(nodes[node]); i++ {\n\t\t\tchild := nodes[node][i][0]\n\t\t\tif child == parent {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tc := nodes[node][i][1]\n\t\t\td := nodes[node][i][2]\n\n\t\t\tprefixSum[child] = prefixSum[node] + int64(d)\n\n\t\t\ttotalColorCount[c]++\n\t\t\ttotalColorDist[c] += int64(d)\n\t\t\tdfs(child, node)\n\t\t\ttotalColorCount[c]--\n\t\t\ttotalColorDist[c] -= int64(d)\n\t\t}\n\t}\n\tdfs(0, 0)\n\n\t/*\n\tqueues = [][]int{{0, 0, 0, -1, 0}}\n\tfor len(queues) > 0 {\n\t\top := queues[0][0]\n\t\tnode := queues[0][1]\n\t\tparent := queues[0][2]\n\t\tcolor := queues[0][3]\n\t\tdist := queues[0][4]\n\n\t\tqueues = queues[1:]\n\n\t\tif op == 0 {\n\t\t\tif color != -1 {\n\t\t\t\ttotalColorCount[color]++\n\t\t\t\ttotalColorDist[color] += int64(dist)\n\t\t\t}\n\n\t\t\tfor c := range need[node] {\n\t\t\t\tprefixColorCount[node][c] = totalColorCount[c]\n\t\t\t\tprefixColorDist[node][c] = totalColorDist[c]\n\t\t\t}\n\n\t\t\tfor i := 0; i < len(nodes[node]); i++ {\n\t\t\t\tchild := nodes[node][i][0]\n\t\t\t\tif child == parent {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tc := nodes[node][i][1]\n\t\t\t\td := nodes[node][i][2]\n\n\t\t\t\tprefixSum[child] = prefixSum[node] + int64(d)\n\n\t\t\t\tqueues = append([][]int{{0, child, node, c, d}, {1, child, node, c, d}}, queues...)\n\t\t\t}\n\t\t} else {\n\t\t\ttotalColorCount[color]--\n\t\t\ttotalColorDist[color] -= int64(dist)\n\t\t}\n\t}\n\t */\n\n\tfor i := 0; i < q; i++ {\n\t\tuu := u[i]\n\t\tvv := v[i]\n\t\txx := x[i]\n\t\tyy := y[i]\n\t\tll := lca[i]\n\n\t\tdu := prefixSum[uu] - prefixColorDist[uu][xx] + int64(prefixColorCount[uu][xx]*yy)\n\t\tdv := prefixSum[vv] - prefixColorDist[vv][xx] + int64(prefixColorCount[vv][xx]*yy)\n\t\tdlca := prefixSum[ll] - prefixColorDist[ll][xx] + int64(prefixColorCount[ll][xx]*yy)\n\t\td := du + dv - 2*dlca\n\t\tfmt.Println(d)\n\t}\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a tree with N vertices numbered 1 to N.\nThe i-th edge in this tree connects Vertex a_i and Vertex b_i, and the color and length of that edge are c_i and d_i, respectively.\nHere the color of each edge is represented by an integer between 1 and N-1 (inclusive). The same integer corresponds to the same color, and different integers correspond to different colors.\n\nAnswer the following Q queries:\n\nQuery j (1 \\leq j \\leq Q): assuming that the length of every edge whose color is x_j is changed to y_j, find the distance between Vertex u_j and Vertex v_j. (The changes of the lengths of edges do not affect the subsequent queries.)\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq a_i, b_i \\leq N\n\n1 \\leq c_i \\leq N-1\n\n1 \\leq d_i \\leq 10^4\n\n1 \\leq x_j \\leq N-1\n\n1 \\leq y_j \\leq 10^4\n\n1 \\leq u_j < v_j \\leq N\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1 c_1 d_1\n:\na_{N-1} b_{N-1} c_{N-1} d_{N-1}\nx_1 y_1 u_1 v_1\n:\nx_Q y_Q u_Q v_Q\n\nOutput\n\nPrint Q lines. The j-th line (1 \\leq j \\leq Q) should contain the answer to Query j.\n\nSample Input 1\n\n5 3\n1 2 1 10\n1 3 2 20\n2 4 4 30\n5 2 1 40\n1 100 1 4\n1 100 1 5\n3 1000 3 4\n\nSample Output 1\n\n130\n200\n60\n\nThe graph in this input is as follows:\n\nHere the edges of Color 1 are shown as solid red lines, the edge of Color 2 is shown as a bold green line, and the edge of Color 4 is shown as a blue dashed line.\n\nQuery 1: Assuming that the length of every edge whose color is 1 is changed to 100, the distance between Vertex 1 and Vertex 4 is 100 + 30 = 130.\n\nQuery 2: Assuming that the length of every edge whose color is 1 is changed to 100, the distance between Vertex 1 and Vertex 5 is 100 + 100 = 200.\n\nQuery 3: Assuming that the length of every edge whose color is 3 is changed to 1000 (there is no such edge), the distance between Vertex 3 and Vertex 4 is 20 + 10 + 30 = 60. Note that the edges of Color 1 now have their original lengths.", "sample_input": "5 3\n1 2 1 10\n1 3 2 20\n2 4 4 30\n5 2 1 40\n1 100 1 4\n1 100 1 5\n3 1000 3 4\n"}, "reference_outputs": ["130\n200\n60\n"], "source_document_id": "p02986", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a tree with N vertices numbered 1 to N.\nThe i-th edge in this tree connects Vertex a_i and Vertex b_i, and the color and length of that edge are c_i and d_i, respectively.\nHere the color of each edge is represented by an integer between 1 and N-1 (inclusive). The same integer corresponds to the same color, and different integers correspond to different colors.\n\nAnswer the following Q queries:\n\nQuery j (1 \\leq j \\leq Q): assuming that the length of every edge whose color is x_j is changed to y_j, find the distance between Vertex u_j and Vertex v_j. (The changes of the lengths of edges do not affect the subsequent queries.)\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq a_i, b_i \\leq N\n\n1 \\leq c_i \\leq N-1\n\n1 \\leq d_i \\leq 10^4\n\n1 \\leq x_j \\leq N-1\n\n1 \\leq y_j \\leq 10^4\n\n1 \\leq u_j < v_j \\leq N\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1 c_1 d_1\n:\na_{N-1} b_{N-1} c_{N-1} d_{N-1}\nx_1 y_1 u_1 v_1\n:\nx_Q y_Q u_Q v_Q\n\nOutput\n\nPrint Q lines. The j-th line (1 \\leq j \\leq Q) should contain the answer to Query j.\n\nSample Input 1\n\n5 3\n1 2 1 10\n1 3 2 20\n2 4 4 30\n5 2 1 40\n1 100 1 4\n1 100 1 5\n3 1000 3 4\n\nSample Output 1\n\n130\n200\n60\n\nThe graph in this input is as follows:\n\nHere the edges of Color 1 are shown as solid red lines, the edge of Color 2 is shown as a bold green line, and the edge of Color 4 is shown as a blue dashed line.\n\nQuery 1: Assuming that the length of every edge whose color is 1 is changed to 100, the distance between Vertex 1 and Vertex 4 is 100 + 30 = 130.\n\nQuery 2: Assuming that the length of every edge whose color is 1 is changed to 100, the distance between Vertex 1 and Vertex 5 is 100 + 100 = 200.\n\nQuery 3: Assuming that the length of every edge whose color is 3 is changed to 1000 (there is no such edge), the distance between Vertex 3 and Vertex 4 is 20 + 10 + 30 = 60. Note that the edges of Color 1 now have their original lengths.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4357, "cpu_time_ms": 3945, "memory_kb": 6656}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s439764093", "group_id": "codeNet:p02987", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tsliceS := strings.Split(s, \"\")\n\tm := make(map[string]int)\n\tfor _, val := range sliceS {\n\t\tm[val]++\n\t}\n\n\tflag := 0\n\tif len(m) == 2 {\n\t\tfor _, val := range m {\n\t\t\tif val != 2 {\n\t\t\t\tflag = 1\n\t\t\t}\n\t\t}\n\n\t\tif flag == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1574619549, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02987/input.txt", "sample_output_relpath": "derived/input_output/data/p02987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02987/Go/s439764093.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s439764093", "user_id": "u763195113"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tsliceS := strings.Split(s, \"\")\n\tm := make(map[string]int)\n\tfor _, val := range sliceS {\n\t\tm[val]++\n\t}\n\n\tflag := 0\n\tif len(m) == 2 {\n\t\tfor _, val := range m {\n\t\t\tif val != 2 {\n\t\t\t\tflag = 1\n\t\t\t}\n\t\t}\n\n\t\tif flag == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 364, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s188958563", "group_id": "codeNet:p02987", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tm := make(map[uint8]int)\n\tfor j:=0;j<4;j++ {\n\t\tif _, ok := m[s[j]]; ok {\n\t\t\tm[s[j]]++\n\t\t} else {\n\t\t\tm[s[j]] = 1\n\t\t}\n\t}\n\tfor _, v := range m {\n\t\tif v != 2 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}", "language": "Go", "metadata": {"date": 1561857487, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02987/input.txt", "sample_output_relpath": "derived/input_output/data/p02987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02987/Go/s188958563.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s188958563", "user_id": "u360765331"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tm := make(map[uint8]int)\n\tfor j:=0;j<4;j++ {\n\t\tif _, ok := m[s[j]]; ok {\n\t\t\tm[s[j]]++\n\t\t} else {\n\t\t\tm[s[j]] = 1\n\t\t}\n\t}\n\tfor _, v := range m {\n\t\tif v != 2 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 288, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s137387374", "group_id": "codeNet:p02988", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\tp := make([]int,n)\n\tfor i,_ := range p {\n\t\tfmt.Scan(&p[i])\n\t}\n\t\n\tcnt := 0\n\tfor i := 1; i < len(p)-1; i++ {\n\t\ttarget := []int{p[i-1],p[i],p[i+1]}\n\t\tsort.Ints(target)\n\t\tif p[i] == target[1] {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}", "language": "Go", "metadata": {"date": 1579629419, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02988.html", "problem_id": "p02988", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02988/input.txt", "sample_output_relpath": "derived/input_output/data/p02988/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02988/Go/s137387374.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s137387374", "user_id": "u689167014"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\tp := make([]int,n)\n\tfor i,_ := range p {\n\t\tfmt.Scan(&p[i])\n\t}\n\t\n\tcnt := 0\n\tfor i := 1; i < len(p)-1; i++ {\n\t\ttarget := []int{p[i-1],p[i],p[i+1]}\n\t\tsort.Ints(target)\n\t\tif p[i] == target[1] {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "sample_input": "5\n1 3 5 4 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02988", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 308, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s051499023", "group_id": "codeNet:p02988", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tP := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &P[i])\n\t}\n\n\tans := 0\n\tfor i := 1; i < n-1; i++ {\n\t\tif P[i] > P[i-1] && P[i] < P[i+1] {\n\t\t\tans++\n\t\t} else if P[i] < P[i-1] && P[i] > P[i+1] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1576536748, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02988.html", "problem_id": "p02988", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02988/input.txt", "sample_output_relpath": "derived/input_output/data/p02988/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02988/Go/s051499023.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s051499023", "user_id": "u304913019"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tP := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &P[i])\n\t}\n\n\tans := 0\n\tfor i := 1; i < n-1; i++ {\n\t\tif P[i] > P[i-1] && P[i] < P[i+1] {\n\t\t\tans++\n\t\t} else if P[i] < P[i-1] && P[i] > P[i+1] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "sample_input": "5\n1 3 5 4 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02988", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\np_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq n \\leq 20\n\np is a permutation of {1,\\ 2,\\ ...,\\ n}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\np_1 p_2 ... p_n\n\nOutput\n\nPrint the number of elements p_i (1 < i < n) that satisfy the condition.\n\nSample Input 1\n\n5\n1 3 5 4 2\n\nSample Output 1\n\n2\n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5. Also, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 = 2. These two elements satisfy the condition.\n\nSample Input 2\n\n9\n9 6 3 2 5 8 7 4 1\n\nSample Output 2\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 317, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s665834394", "group_id": "codeNet:p02989", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%2 != 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tds := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&ds[i])\n\t}\n\tsort.Sort(sort.IntSlice(ds))\n\tif ds[n/2] == ds[n/2-1] {\n\t\tfmt.Println(0)\n\t\treturn\n\t} else {\n\t\tfmt.Println(ds[n/2] - ds[n/2-1])\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1573080365, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02989.html", "problem_id": "p02989", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02989/input.txt", "sample_output_relpath": "derived/input_output/data/p02989/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02989/Go/s665834394.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s665834394", "user_id": "u394040864"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%2 != 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tds := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&ds[i])\n\t}\n\tsort.Sort(sort.IntSlice(ds))\n\tif ds[n/2] == ds[n/2-1] {\n\t\tfmt.Println(0)\n\t\treturn\n\t} else {\n\t\tfmt.Println(ds[n/2] - ds[n/2-1])\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi made N problems for competitive programming.\nThe problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).\n\nHe is dividing the problems into two categories by choosing an integer K, as follows:\n\nA problem with difficulty K or higher will be for ARCs.\n\nA problem with difficulty lower than K will be for ABCs.\n\nHow many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?\n\nProblem Statement\n\n2 \\leq N \\leq 10^5\n\nN is an even number.\n\n1 \\leq d_i \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the number of choices of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 1\n\n6\n9 1 4 4 6 7\n\nSample Output 1\n\n2\n\nIf we choose K=5 or 6, Problem 1, 5, and 6 will be for ARCs, Problem 2, 3, and 4 will be for ABCs, and the objective is achieved.\nThus, the answer is 2.\n\nSample Input 2\n\n8\n9 1 14 5 5 4 4 14\n\nSample Output 2\n\n0\n\nThere may be no choice of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 3\n\n14\n99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1\n\nSample Output 3\n\n42685", "sample_input": "6\n9 1 4 4 6 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02989", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi made N problems for competitive programming.\nThe problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).\n\nHe is dividing the problems into two categories by choosing an integer K, as follows:\n\nA problem with difficulty K or higher will be for ARCs.\n\nA problem with difficulty lower than K will be for ABCs.\n\nHow many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?\n\nProblem Statement\n\n2 \\leq N \\leq 10^5\n\nN is an even number.\n\n1 \\leq d_i \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the number of choices of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 1\n\n6\n9 1 4 4 6 7\n\nSample Output 1\n\n2\n\nIf we choose K=5 or 6, Problem 1, 5, and 6 will be for ARCs, Problem 2, 3, and 4 will be for ABCs, and the objective is achieved.\nThus, the answer is 2.\n\nSample Input 2\n\n8\n9 1 14 5 5 4 4 14\n\nSample Output 2\n\n0\n\nThere may be no choice of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 3\n\n14\n99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1\n\nSample Output 3\n\n42685", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 328, "cpu_time_ms": 454, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s564569192", "group_id": "codeNet:p02989", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tinputs := scanNums(N)\n\n\tsort.Sort(sort.IntSlice(inputs))\n\t// fmt.Println(inputs)\n\ta := inputs[N/2-1]\n\tb := inputs[N/2]\n\t// fmt.Println(a, b)\n\n\tif b == a {\n\t\tfmt.Println(0)\n\t} else {\n\n\t\tfmt.Println(b - a)\n\t}\n\n}\n\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc spritString(input string) (res []string) {\n\tfor i := 0; i < utf8.RuneCountInString(input); i++ {\n\t\tres = append(res, input[i:i+1])\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1567736485, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02989.html", "problem_id": "p02989", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02989/input.txt", "sample_output_relpath": "derived/input_output/data/p02989/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02989/Go/s564569192.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s564569192", "user_id": "u950580836"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tinputs := scanNums(N)\n\n\tsort.Sort(sort.IntSlice(inputs))\n\t// fmt.Println(inputs)\n\ta := inputs[N/2-1]\n\tb := inputs[N/2]\n\t// fmt.Println(a, b)\n\n\tif b == a {\n\t\tfmt.Println(0)\n\t} else {\n\n\t\tfmt.Println(b - a)\n\t}\n\n}\n\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc spritString(input string) (res []string) {\n\tfor i := 0; i < utf8.RuneCountInString(input); i++ {\n\t\tres = append(res, input[i:i+1])\n\t}\n\treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi made N problems for competitive programming.\nThe problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).\n\nHe is dividing the problems into two categories by choosing an integer K, as follows:\n\nA problem with difficulty K or higher will be for ARCs.\n\nA problem with difficulty lower than K will be for ABCs.\n\nHow many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?\n\nProblem Statement\n\n2 \\leq N \\leq 10^5\n\nN is an even number.\n\n1 \\leq d_i \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the number of choices of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 1\n\n6\n9 1 4 4 6 7\n\nSample Output 1\n\n2\n\nIf we choose K=5 or 6, Problem 1, 5, and 6 will be for ARCs, Problem 2, 3, and 4 will be for ABCs, and the objective is achieved.\nThus, the answer is 2.\n\nSample Input 2\n\n8\n9 1 14 5 5 4 4 14\n\nSample Output 2\n\n0\n\nThere may be no choice of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 3\n\n14\n99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1\n\nSample Output 3\n\n42685", "sample_input": "6\n9 1 4 4 6 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02989", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi made N problems for competitive programming.\nThe problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).\n\nHe is dividing the problems into two categories by choosing an integer K, as follows:\n\nA problem with difficulty K or higher will be for ARCs.\n\nA problem with difficulty lower than K will be for ABCs.\n\nHow many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?\n\nProblem Statement\n\n2 \\leq N \\leq 10^5\n\nN is an even number.\n\n1 \\leq d_i \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1 d_2 ... d_N\n\nOutput\n\nPrint the number of choices of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 1\n\n6\n9 1 4 4 6 7\n\nSample Output 1\n\n2\n\nIf we choose K=5 or 6, Problem 1, 5, and 6 will be for ARCs, Problem 2, 3, and 4 will be for ABCs, and the objective is achieved.\nThus, the answer is 2.\n\nSample Input 2\n\n8\n9 1 14 5 5 4 4 14\n\nSample Output 2\n\n0\n\nThere may be no choice of the integer K that make the number of problems for ARCs and the number of problems for ABCs the same.\n\nSample Input 3\n\n14\n99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1\n\nSample Output 3\n\n42685", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 757, "cpu_time_ms": 468, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s806864956", "group_id": "codeNet:p02989", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var n, i, j, temp int\n fmt.Scan(&n)\n a:=make([]int, n)\n for i=0;ii;j--{\n if a[j]i;j--{\n if a[j] y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer flush()\n\n\tN := readInt()\n\tK := readInt()\n\n\tn := max(K, N-K+1)\n\tc := make([][]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tc[i] = make([]int, n+1)\n\t}\n\tc[0][0] = 1\n\tfor i := 0; i < n+1; i++ {\n\t\tc[i][0] = 1\n\t\tfor j := 1; j < i+1; j++ {\n\t\t\tc[i][j] = (c[i-1][j-1] + c[i-1][j]) % m\n\t\t}\n\t}\n\n\tfor i := 1; i <= K; i++ {\n\t\tprintln(c[K-1][i-1] * c[N-K+1][i] % m)\n\t}\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n\nvar stdoutWriter = bufio.NewWriter(os.Stdout)\n\nfunc flush() {\n\tstdoutWriter.Flush()\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdoutWriter, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\n}\n", "language": "Go", "metadata": {"date": 1592750055, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02990.html", "problem_id": "p02990", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02990/input.txt", "sample_output_relpath": "derived/input_output/data/p02990/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02990/Go/s988820350.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s988820350", "user_id": "u347640436"}, "prompt_components": {"gold_output": "3\n6\n1\n", "input_to_evaluate": "// パスカルの三角形\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tm = 1000000007\n)\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer flush()\n\n\tN := readInt()\n\tK := readInt()\n\n\tn := max(K, N-K+1)\n\tc := make([][]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tc[i] = make([]int, n+1)\n\t}\n\tc[0][0] = 1\n\tfor i := 0; i < n+1; i++ {\n\t\tc[i][0] = 1\n\t\tfor j := 1; j < i+1; j++ {\n\t\t\tc[i][j] = (c[i-1][j-1] + c[i-1][j]) % m\n\t\t}\n\t}\n\n\tfor i := 1; i <= K; i++ {\n\t\tprintln(c[K-1][i-1] * c[N-K+1][i] % m)\n\t}\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n\nvar stdoutWriter = bufio.NewWriter(os.Stdout)\n\nfunc flush() {\n\tstdoutWriter.Flush()\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdoutWriter, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are K blue balls and N-K red balls. The balls of the same color cannot be distinguished. Snuke and Takahashi are playing with these balls.\n\nFirst, Snuke will arrange the N balls in a row from left to right.\n\nThen, Takahashi will collect only the K blue balls. In one move, he can collect any number of consecutive blue balls. He will collect all the blue balls in the fewest moves possible.\n\nHow many ways are there for Snuke to arrange the N balls in a row so that Takahashi will need exactly i moves to collect all the blue balls? Compute this number modulo 10^9+7 for each i such that 1 \\leq i \\leq K.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint K lines. The i-th line (1 \\leq i \\leq K) should contain the number of ways to arrange the N balls so that Takahashi will need exactly i moves to collect all the blue balls, modulo 10^9+7.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n3\n6\n1\n\nThere are three ways to arrange the balls so that Takahashi will need exactly one move: (B, B, B, R, R), (R, B, B, B, R), and (R, R, B, B, B). (R and B stands for red and blue, respectively).\n\nThere are six ways to arrange the balls so that Takahashi will need exactly two moves: (B, B, R, B, R), (B, B, R, R, B), (R, B, B, R, B), (R, B, R, B, B), (B, R, B, B, R), and (B, R, R, B, B).\n\nThere is one way to arrange the balls so that Takahashi will need exactly three moves: (B, R, B, R, B).\n\nSample Input 2\n\n2000 3\n\nSample Output 2\n\n1998\n3990006\n327341989\n\nBe sure to print the numbers of arrangements modulo 10^9+7.", "sample_input": "5 3\n"}, "reference_outputs": ["3\n6\n1\n"], "source_document_id": "p02990", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are K blue balls and N-K red balls. The balls of the same color cannot be distinguished. Snuke and Takahashi are playing with these balls.\n\nFirst, Snuke will arrange the N balls in a row from left to right.\n\nThen, Takahashi will collect only the K blue balls. In one move, he can collect any number of consecutive blue balls. He will collect all the blue balls in the fewest moves possible.\n\nHow many ways are there for Snuke to arrange the N balls in a row so that Takahashi will need exactly i moves to collect all the blue balls? Compute this number modulo 10^9+7 for each i such that 1 \\leq i \\leq K.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint K lines. The i-th line (1 \\leq i \\leq K) should contain the number of ways to arrange the N balls so that Takahashi will need exactly i moves to collect all the blue balls, modulo 10^9+7.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n3\n6\n1\n\nThere are three ways to arrange the balls so that Takahashi will need exactly one move: (B, B, B, R, R), (R, B, B, B, R), and (R, R, B, B, B). (R and B stands for red and blue, respectively).\n\nThere are six ways to arrange the balls so that Takahashi will need exactly two moves: (B, B, R, B, R), (B, B, R, R, B), (R, B, B, R, B), (R, B, R, B, B), (B, R, B, B, R), and (B, R, R, B, B).\n\nThere is one way to arrange the balls so that Takahashi will need exactly three moves: (B, R, B, R, B).\n\nSample Input 2\n\n2000 3\n\nSample Output 2\n\n1998\n3990006\n327341989\n\nBe sure to print the numbers of arrangements modulo 10^9+7.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1275, "cpu_time_ms": 36, "memory_kb": 23080}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s714885388", "group_id": "codeNet:p02994", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, l int\n\tfmt.Scan(&n, &l)\n\n\tans := 0\n\tmin := 1000\n\tfor i := 1 ; i <= n ;i++ {\n\t\tans += l + i - 1\n\t\tif min > abs(l + i - 1 ) {\n\t\t\tmin = abs(l + i - 1 )\n\t\t}\n\t}\n\tfmt.Println(ans - min)\n}\nfunc abs(n int) int {\n\ty := n >> 63\n\treturn (n ^ y) - y\n}\n", "language": "Go", "metadata": {"date": 1598588211, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02994.html", "problem_id": "p02994", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02994/input.txt", "sample_output_relpath": "derived/input_output/data/p02994/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02994/Go/s714885388.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s714885388", "user_id": "u769765274"}, "prompt_components": {"gold_output": "18\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, l int\n\tfmt.Scan(&n, &l)\n\n\tans := 0\n\tmin := 1000\n\tfor i := 1 ; i <= n ;i++ {\n\t\tans += l + i - 1\n\t\tif min > abs(l + i - 1 ) {\n\t\t\tmin = abs(l + i - 1 )\n\t\t}\n\t}\n\tfmt.Println(ans - min)\n}\nfunc abs(n int) int {\n\ty := n >> 63\n\treturn (n ^ y) - y\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "sample_input": "5 2\n"}, "reference_outputs": ["18\n"], "source_document_id": "p02994", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 293, "cpu_time_ms": 3, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s056427036", "group_id": "codeNet:p02994", "input_text": "package main\nimport \"fmt\"\nfunc main(){\n var n, l int\n fmt.Scan(&n, &l)\n sum := l * n + n * (n - 1) / 2\n if l <= 0 && (n + l - 1) >= 0 {\n fmt.Println(sum)\n }else if l > 0 {\n fmt.Println(sum - l)\n }else{\n fmt.Println(sum - (n + l - 1))\n }\n}\n", "language": "Go", "metadata": {"date": 1561837335, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02994.html", "problem_id": "p02994", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02994/input.txt", "sample_output_relpath": "derived/input_output/data/p02994/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02994/Go/s056427036.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s056427036", "user_id": "u547085427"}, "prompt_components": {"gold_output": "18\n", "input_to_evaluate": "package main\nimport \"fmt\"\nfunc main(){\n var n, l int\n fmt.Scan(&n, &l)\n sum := l * n + n * (n - 1) / 2\n if l <= 0 && (n + l - 1) >= 0 {\n fmt.Println(sum)\n }else if l > 0 {\n fmt.Println(sum - l)\n }else{\n fmt.Println(sum - (n + l - 1))\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "sample_input": "5 2\n"}, "reference_outputs": ["18\n"], "source_document_id": "p02994", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can be negative.\n\nYou can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.\n\nYou planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.\n\nYou want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.\n\nWe can prove that this value is uniquely determined.\n\nConstraints\n\n2 \\leq N \\leq 200\n\n-100 \\leq L \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\n\nOutput\n\nFind the flavor of the apple pie made of the remaining N-1 apples when you optimally choose the apple to eat.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n18\n\nThe flavors of Apple 1, 2, 3, 4, and 5 are 2, 3, 4, 5, and 6, respectively. The optimal choice is to eat Apple 1, so the answer is 3+4+5+6=18.\n\nSample Input 2\n\n3 -1\n\nSample Output 2\n\n0\n\nThe flavors of Apple 1, 2, and 3 are -1, 0, and 1, respectively. The optimal choice is to eat Apple 2, so the answer is (-1)+1=0.\n\nSample Input 3\n\n30 -50\n\nSample Output 3\n\n-1044", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 281, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s875776202", "group_id": "codeNet:p02996", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype Job struct {\n\tA int\n\tB int\n}\n\ntype Jobs []Job\n\nfunc (j Jobs) Len() int {\n\treturn len(j)\n}\n\nfunc (j Jobs) Swap(x, y int) {\n\tj[x], j[y] = j[y], j[x]\n}\n\nfunc (j Jobs) Less(x, y int) bool {\n\treturn j[x].B < j[y].B\n}\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n)\n\n\tvar jobs Jobs = []Job{}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a, &b)\n\t\tjobs = append(jobs, Job{a, b})\n\t}\n\n\tsort.Sort(jobs)\n\n\ttime := 0\n\tfor i := 0; i < n; i++ {\n\t\ttime += jobs[i].A\n\t\tif time > jobs[i].B {\n\t\t\tfmt.Println(\"No\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}", "language": "Go", "metadata": {"date": 1561234769, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02996.html", "problem_id": "p02996", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02996/input.txt", "sample_output_relpath": "derived/input_output/data/p02996/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02996/Go/s875776202.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s875776202", "user_id": "u197230780"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype Job struct {\n\tA int\n\tB int\n}\n\ntype Jobs []Job\n\nfunc (j Jobs) Len() int {\n\treturn len(j)\n}\n\nfunc (j Jobs) Swap(x, y int) {\n\tj[x], j[y] = j[y], j[x]\n}\n\nfunc (j Jobs) Less(x, y int) bool {\n\treturn j[x].B < j[y].B\n}\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n)\n\n\tvar jobs Jobs = []Job{}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a, &b)\n\t\tjobs = append(jobs, Job{a, b})\n\t}\n\n\tsort.Sort(jobs)\n\n\ttime := 0\n\tfor i := 0; i < n; i++ {\n\t\ttime += jobs[i].A\n\t\tif time > jobs[i].B {\n\t\t\tfmt.Println(\"No\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nKizahashi, who was appointed as the administrator of ABC at National Problem Workshop in the Kingdom of AtCoder, got too excited and took on too many jobs.\n\nLet the current time be time 0. Kizahashi has N jobs numbered 1 to N.\n\nIt takes A_i units of time for Kizahashi to complete Job i. The deadline for Job i is time B_i, and he must complete the job before or at this time.\n\nKizahashi cannot work on two or more jobs simultaneously, but when he completes a job, he can start working on another immediately.\n\nCan Kizahashi complete all the jobs in time? If he can, print Yes; if he cannot, print No.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq 10^9 (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n.\n.\n.\nA_N B_N\n\nOutput\n\nIf Kizahashi can complete all the jobs in time, print Yes; if he cannot, print No.\n\nSample Input 1\n\n5\n2 4\n1 9\n1 8\n4 9\n3 12\n\nSample Output 1\n\nYes\n\nHe can complete all the jobs in time by, for example, doing them in the following order:\n\nDo Job 2 from time 0 to 1.\n\nDo Job 1 from time 1 to 3.\n\nDo Job 4 from time 3 to 7.\n\nDo Job 3 from time 7 to 8.\n\nDo Job 5 from time 8 to 11.\n\nNote that it is fine to complete Job 3 exactly at the deadline, time 8.\n\nSample Input 2\n\n3\n334 1000\n334 1000\n334 1000\n\nSample Output 2\n\nNo\n\nHe cannot complete all the jobs in time, no matter what order he does them in.\n\nSample Input 3\n\n30\n384 8895\n1725 9791\n170 1024\n4 11105\n2 6\n578 1815\n702 3352\n143 5141\n1420 6980\n24 1602\n849 999\n76 7586\n85 5570\n444 4991\n719 11090\n470 10708\n1137 4547\n455 9003\n110 9901\n15 8578\n368 3692\n104 1286\n3 4\n366 12143\n7 6649\n610 2374\n152 7324\n4 7042\n292 11386\n334 5720\n\nSample Output 3\n\nYes", "sample_input": "5\n2 4\n1 9\n1 8\n4 9\n3 12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02996", "source_text": "Score: 400 points\n\nProblem Statement\n\nKizahashi, who was appointed as the administrator of ABC at National Problem Workshop in the Kingdom of AtCoder, got too excited and took on too many jobs.\n\nLet the current time be time 0. Kizahashi has N jobs numbered 1 to N.\n\nIt takes A_i units of time for Kizahashi to complete Job i. The deadline for Job i is time B_i, and he must complete the job before or at this time.\n\nKizahashi cannot work on two or more jobs simultaneously, but when he completes a job, he can start working on another immediately.\n\nCan Kizahashi complete all the jobs in time? If he can, print Yes; if he cannot, print No.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq 10^9 (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n.\n.\n.\nA_N B_N\n\nOutput\n\nIf Kizahashi can complete all the jobs in time, print Yes; if he cannot, print No.\n\nSample Input 1\n\n5\n2 4\n1 9\n1 8\n4 9\n3 12\n\nSample Output 1\n\nYes\n\nHe can complete all the jobs in time by, for example, doing them in the following order:\n\nDo Job 2 from time 0 to 1.\n\nDo Job 1 from time 1 to 3.\n\nDo Job 4 from time 3 to 7.\n\nDo Job 3 from time 7 to 8.\n\nDo Job 5 from time 8 to 11.\n\nNote that it is fine to complete Job 3 exactly at the deadline, time 8.\n\nSample Input 2\n\n3\n334 1000\n334 1000\n334 1000\n\nSample Output 2\n\nNo\n\nHe cannot complete all the jobs in time, no matter what order he does them in.\n\nSample Input 3\n\n30\n384 8895\n1725 9791\n170 1024\n4 11105\n2 6\n578 1815\n702 3352\n143 5141\n1420 6980\n24 1602\n849 999\n76 7586\n85 5570\n444 4991\n719 11090\n470 10708\n1137 4547\n455 9003\n110 9901\n15 8578\n368 3692\n104 1286\n3 4\n366 12143\n7 6649\n610 2374\n152 7324\n4 7042\n292 11386\n334 5720\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 580, "cpu_time_ms": 2019, "memory_kb": 14976}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s632768238", "group_id": "codeNet:p02997", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, K := getInt(), getInt()\n\n\tmaxk := (N - 1) * (N - 2) / 2\n\tmaxm := N * (N - 1) / 2\n\n\tif maxk < K {\n\t\tout(-1)\n\t\treturn\n\t}\n\n\tm := maxm - K\n\tfmt.Println(m)\n\tcnt := 0\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := i + 1; j <= N; j++ {\n\t\t\tif cnt < K && j != N {\n\t\t\t\tcnt++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Println(i, j)\n\t\t}\n\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1593200396, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02997.html", "problem_id": "p02997", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02997/input.txt", "sample_output_relpath": "derived/input_output/data/p02997/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02997/Go/s632768238.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s632768238", "user_id": "u814575783"}, "prompt_components": {"gold_output": "5\n4 3\n1 2\n3 1\n4 5\n2 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, K := getInt(), getInt()\n\n\tmaxk := (N - 1) * (N - 2) / 2\n\tmaxm := N * (N - 1) / 2\n\n\tif maxk < K {\n\t\tout(-1)\n\t\treturn\n\t}\n\n\tm := maxm - K\n\tfmt.Println(m)\n\tcnt := 0\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := i + 1; j <= N; j++ {\n\t\t\tif cnt < K && j != N {\n\t\t\t\tcnt++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Println(i, j)\n\t\t}\n\n\t}\n\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nDoes there exist an undirected graph with N vertices satisfying the following conditions?\n\nThe graph is simple and connected.\n\nThe vertices are numbered 1, 2, ..., N.\n\nLet M be the number of edges in the graph. The edges are numbered 1, 2, ..., M, the length of each edge is 1, and Edge i connects Vertex u_i and Vertex v_i.\n\nThere are exactly K pairs of vertices (i,\\ j)\\ (i < j) such that the shortest distance between them is 2.\n\nIf there exists such a graph, construct an example.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq K \\leq \\frac{N(N - 1)}{2}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf there does not exist an undirected graph with N vertices satisfying the conditions, print -1.\n\nIf there exists such a graph, print an example in the following format (refer to Problem Statement for what the symbols stand for):\n\nM\nu_1 v_1\n:\nu_M v_M\n\nIf there exist multiple graphs satisfying the conditions, any of them will be accepted.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n5\n4 3\n1 2\n3 1\n4 5\n2 3\n\nThis graph has three pairs of vertices such that the shortest distance between them is 2: (1,\\ 4), (2,\\ 4), and (3,\\ 5). Thus, the condition is satisfied.\n\nSample Input 2\n\n5 8\n\nSample Output 2\n\n-1\n\nThere is no graph satisfying the conditions.", "sample_input": "5 3\n"}, "reference_outputs": ["5\n4 3\n1 2\n3 1\n4 5\n2 3\n"], "source_document_id": "p02997", "source_text": "Score: 500 points\n\nProblem Statement\n\nDoes there exist an undirected graph with N vertices satisfying the following conditions?\n\nThe graph is simple and connected.\n\nThe vertices are numbered 1, 2, ..., N.\n\nLet M be the number of edges in the graph. The edges are numbered 1, 2, ..., M, the length of each edge is 1, and Edge i connects Vertex u_i and Vertex v_i.\n\nThere are exactly K pairs of vertices (i,\\ j)\\ (i < j) such that the shortest distance between them is 2.\n\nIf there exists such a graph, construct an example.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n0 \\leq K \\leq \\frac{N(N - 1)}{2}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf there does not exist an undirected graph with N vertices satisfying the conditions, print -1.\n\nIf there exists such a graph, print an example in the following format (refer to Problem Statement for what the symbols stand for):\n\nM\nu_1 v_1\n:\nu_M v_M\n\nIf there exist multiple graphs satisfying the conditions, any of them will be accepted.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n5\n4 3\n1 2\n3 1\n4 5\n2 3\n\nThis graph has three pairs of vertices such that the shortest distance between them is 2: (1,\\ 4), (2,\\ 4), and (3,\\ 5). Thus, the condition is satisfied.\n\nSample Input 2\n\n5 8\n\nSample Output 2\n\n-1\n\nThere is no graph satisfying the conditions.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1335, "cpu_time_ms": 18, "memory_kb": 1852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s078502659", "group_id": "codeNet:p03000", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar N, X int\n\tfmt.Scanf(\"%d %d\", &N, &X)\n\n\tL := make([]int, N+1)\n\tvar D []int\n\t\n\tfor i:=0; i < N; i++ {\n\t\tfmt.Scan(&L[i])\n\t}\n\tD = append(D, 0)\n\tqtd := 0\n\tfor i:=0; D[i] <= X; i++ {\n\t\tD = append(D, D[i]+L[i])\n\t\tqtd++\n\t\t//fmt.Println(D[i], qtd)\n\t}\n\tfmt.Println(qtd)\n}", "language": "Go", "metadata": {"date": 1587008143, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03000.html", "problem_id": "p03000", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03000/input.txt", "sample_output_relpath": "derived/input_output/data/p03000/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03000/Go/s078502659.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s078502659", "user_id": "u863370423"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar N, X int\n\tfmt.Scanf(\"%d %d\", &N, &X)\n\n\tL := make([]int, N+1)\n\tvar D []int\n\t\n\tfor i:=0; i < N; i++ {\n\t\tfmt.Scan(&L[i])\n\t}\n\tD = append(D, 0)\n\tqtd := 0\n\tfor i:=0; D[i] <= X; i++ {\n\t\tD = append(D, D[i]+L[i])\n\t\tqtd++\n\t\t//fmt.Println(D[i], qtd)\n\t}\n\tfmt.Println(qtd)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "sample_input": "3 6\n3 4 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03000", "source_text": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 312, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s378149756", "group_id": "codeNet:p03000", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = nextInt()\n\t}\n\treturn ints\n}\n\nfunc countBounding(x int, ls []int) (boundNum int) {\n\tboundNum = 1\n\tn := len(ls)\n\td := make([]int, n+1)\n\td[0] = 0\n\tfor i, l := range ls {\n\t\tnext := d[i] + l\n\t\tif x < next {\n\t\t\tbreak\n\t\t}\n\t\tboundNum++\n\t\td[i+1] = next\n\t}\n\treturn\n}\n\nfunc main() {\n\tn, x := nextInt(), nextInt()\n\tints := nextInts(n)\n\tr := countBounding(x, ints)\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1572473685, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03000.html", "problem_id": "p03000", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03000/input.txt", "sample_output_relpath": "derived/input_output/data/p03000/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03000/Go/s378149756.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s378149756", "user_id": "u727347518"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = nextInt()\n\t}\n\treturn ints\n}\n\nfunc countBounding(x int, ls []int) (boundNum int) {\n\tboundNum = 1\n\tn := len(ls)\n\td := make([]int, n+1)\n\td[0] = 0\n\tfor i, l := range ls {\n\t\tnext := d[i] + l\n\t\tif x < next {\n\t\t\tbreak\n\t\t}\n\t\tboundNum++\n\t\td[i+1] = next\n\t}\n\treturn\n}\n\nfunc main() {\n\tn, x := nextInt(), nextInt()\n\tints := nextInts(n)\n\tr := countBounding(x, ints)\n\tfmt.Println(r)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "sample_input": "3 6\n3 4 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03000", "source_text": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 752, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s859103597", "group_id": "codeNet:p03001", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tw := nextInt()\n\th := nextInt()\n\tx := nextInt()\n\ty := nextInt()\n\n\tarea := float64(w) * float64(h) / 2.0\n\tfmt.Printf(\"%v \", area)\n\tif x == w/2 && y == h/2 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1560713677, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03001.html", "problem_id": "p03001", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03001/input.txt", "sample_output_relpath": "derived/input_output/data/p03001/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03001/Go/s859103597.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s859103597", "user_id": "u651597583"}, "prompt_components": {"gold_output": "3.000000 0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tw := nextInt()\n\th := nextInt()\n\tx := nextInt()\n\ty := nextInt()\n\n\tarea := float64(w) * float64(h) / 2.0\n\tfmt.Printf(\"%v \", area)\n\tif x == w/2 && y == h/2 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).\nYou are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.\n\nConstraints\n\n1 \\leq W,H \\leq 10^9\n\n0\\leq x\\leq W\n\n0\\leq y\\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nW H x y\n\nOutput\n\nPrint the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.\n\nThe area printed will be judged correct when its absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n2 3 1 2\n\nSample Output 1\n\n3.000000 0\n\nThe line x=1 gives the optimal cut, and no other line does.\n\nSample Input 2\n\n2 2 1 1\n\nSample Output 2\n\n2.000000 1", "sample_input": "2 3 1 2\n"}, "reference_outputs": ["3.000000 0\n"], "source_document_id": "p03001", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).\nYou are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.\n\nConstraints\n\n1 \\leq W,H \\leq 10^9\n\n0\\leq x\\leq W\n\n0\\leq y\\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nW H x y\n\nOutput\n\nPrint the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.\n\nThe area printed will be judged correct when its absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n2 3 1 2\n\nSample Output 1\n\n3.000000 0\n\nThe line x=1 gives the optimal cut, and no other line does.\n\nSample Input 2\n\n2 2 1 1\n\nSample Output 2\n\n2.000000 1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 449, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s672891179", "group_id": "codeNet:p03003", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t} \n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tm := scanInt()\n\ts := scanInts(n)\n\tt := scanInts(m)\n\n\tdp := make([][]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tdp[i] = make([]int, m+1)\n\t}\n\tfor i := 0; i < m+1; i++ {\n\t\tdp[0][i] = 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tdp[i+1][0] = 1\n\t\tfor j := 0; j < m; j++ {\n\t\t\tdp[i+1][j+1] = dp[i][j+1] + dp[i+1][j]\n\t\t\tif s[i] != t[j] {\n\t\t\t\tdp[i+1][j+1] -= dp[i][j]\n\t\t\t}\n\n\t\t\tdp[i+1][j+1] = (MOD+dp[i+1][j+1])%MOD\n\t\t}\n\t\t// debug(dp[i+1])\n\t}\n\n\tfmt.Fprintln(wr, dp[n][m])\n}\n\n// MOD constant\nconst MOD = 1000000007\n", "language": "Go", "metadata": {"date": 1585880408, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03003.html", "problem_id": "p03003", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03003/input.txt", "sample_output_relpath": "derived/input_output/data/p03003/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03003/Go/s672891179.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s672891179", "user_id": "u548992197"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t} \n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tm := scanInt()\n\ts := scanInts(n)\n\tt := scanInts(m)\n\n\tdp := make([][]int, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tdp[i] = make([]int, m+1)\n\t}\n\tfor i := 0; i < m+1; i++ {\n\t\tdp[0][i] = 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tdp[i+1][0] = 1\n\t\tfor j := 0; j < m; j++ {\n\t\t\tdp[i+1][j+1] = dp[i][j+1] + dp[i+1][j]\n\t\t\tif s[i] != t[j] {\n\t\t\t\tdp[i+1][j+1] -= dp[i][j]\n\t\t\t}\n\n\t\t\tdp[i+1][j+1] = (MOD+dp[i+1][j+1])%MOD\n\t\t}\n\t\t// debug(dp[i+1])\n\t}\n\n\tfmt.Fprintln(wr, dp[n][m])\n}\n\n// MOD constant\nconst MOD = 1000000007\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given two integer sequences S and T of length N and M, respectively, both consisting of integers between 1 and 10^5 (inclusive).\n\nIn how many pairs of a subsequence of S and a subsequence of T do the two subsequences are the same in content?\n\nHere the subsequence of A is a sequence obtained by removing zero or more elements from A and concatenating the remaining elements without changing the order.\n\nFor both S and T, we distinguish two subsequences if the sets of the indices of the removed elements are different, even if the subsequences are the same in content.\n\nSince the answer can be tremendous, print the number modulo 10^9+7.\n\nConstraints\n\n1 \\leq N, M \\leq 2 \\times 10^3\n\nThe length of S is N.\n\nThe length of T is M.\n\n1 \\leq S_i, T_i \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS_1 S_2 ... S_{N-1} S_{N}\nT_1 T_2 ... T_{M-1} T_{M}\n\nOutput\n\nPrint the number of pairs of a subsequence of S and a subsequence of T such that the subsequences are the same in content, modulo 10^9+7.\n\nSample Input 1\n\n2 2\n1 3\n3 1\n\nSample Output 1\n\n3\n\nS has four subsequences: (), (1), (3), (1, 3).\n\nT has four subsequences: (), (3), (1), (3, 1).\n\nThere are 1 \\times 1 pair of subsequences in which the subsequences are both (), 1 \\times 1 pair of subsequences in which the subsequences are both (1), and 1 \\times 1 pair of subsequences in which the subsequences are both (3), for a total of three pairs.\n\nSample Input 2\n\n2 2\n1 1\n1 1\n\nSample Output 2\n\n6\n\nS has four subsequences: (), (1), (1), (1, 1).\n\nT has four subsequences: (), (1), (1), (1, 1).\n\nThere are 1 \\times 1 pair of subsequences in which the subsequences are both (), 2 \\times 2 pairs of subsequences in which the subsequences are both (1), and 1 \\times 1 pair of subsequences in which the subsequences are both (1,1), for a total of six pairs.\nNote again that we distinguish two subsequences if the sets of the indices of the removed elements are different, even if the subsequences are the same in content.\n\nSample Input 3\n\n4 4\n3 4 5 6\n3 4 5 6\n\nSample Output 3\n\n16\n\nSample Input 4\n\n10 9\n9 6 5 7 5 9 8 5 6 7\n8 6 8 5 5 7 9 9 7\n\nSample Output 4\n\n191\n\nSample Input 5\n\n20 20\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n\nSample Output 5\n\n846527861\n\nBe sure to print the number modulo 10^9+7.", "sample_input": "2 2\n1 3\n3 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03003", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given two integer sequences S and T of length N and M, respectively, both consisting of integers between 1 and 10^5 (inclusive).\n\nIn how many pairs of a subsequence of S and a subsequence of T do the two subsequences are the same in content?\n\nHere the subsequence of A is a sequence obtained by removing zero or more elements from A and concatenating the remaining elements without changing the order.\n\nFor both S and T, we distinguish two subsequences if the sets of the indices of the removed elements are different, even if the subsequences are the same in content.\n\nSince the answer can be tremendous, print the number modulo 10^9+7.\n\nConstraints\n\n1 \\leq N, M \\leq 2 \\times 10^3\n\nThe length of S is N.\n\nThe length of T is M.\n\n1 \\leq S_i, T_i \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS_1 S_2 ... S_{N-1} S_{N}\nT_1 T_2 ... T_{M-1} T_{M}\n\nOutput\n\nPrint the number of pairs of a subsequence of S and a subsequence of T such that the subsequences are the same in content, modulo 10^9+7.\n\nSample Input 1\n\n2 2\n1 3\n3 1\n\nSample Output 1\n\n3\n\nS has four subsequences: (), (1), (3), (1, 3).\n\nT has four subsequences: (), (3), (1), (3, 1).\n\nThere are 1 \\times 1 pair of subsequences in which the subsequences are both (), 1 \\times 1 pair of subsequences in which the subsequences are both (1), and 1 \\times 1 pair of subsequences in which the subsequences are both (3), for a total of three pairs.\n\nSample Input 2\n\n2 2\n1 1\n1 1\n\nSample Output 2\n\n6\n\nS has four subsequences: (), (1), (1), (1, 1).\n\nT has four subsequences: (), (1), (1), (1, 1).\n\nThere are 1 \\times 1 pair of subsequences in which the subsequences are both (), 2 \\times 2 pairs of subsequences in which the subsequences are both (1), and 1 \\times 1 pair of subsequences in which the subsequences are both (1,1), for a total of six pairs.\nNote again that we distinguish two subsequences if the sets of the indices of the removed elements are different, even if the subsequences are the same in content.\n\nSample Input 3\n\n4 4\n3 4 5 6\n3 4 5 6\n\nSample Output 3\n\n16\n\nSample Input 4\n\n10 9\n9 6 5 7 5 9 8 5 6 7\n8 6 8 5 5 7 9 9 7\n\nSample Output 4\n\n191\n\nSample Input 5\n\n20 20\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n\nSample Output 5\n\n846527861\n\nBe sure to print the number modulo 10^9+7.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1546, "cpu_time_ms": 78, "memory_kb": 33920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s729017824", "group_id": "codeNet:p03005", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tif k == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(n - k)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1560647076, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03005.html", "problem_id": "p03005", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03005/input.txt", "sample_output_relpath": "derived/input_output/data/p03005/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03005/Go/s729017824.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s729017824", "user_id": "u102310764"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tif k == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(n - k)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is distributing N balls to K persons.\n\nIf each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?\n\nConstraints\n\n1 \\leq K \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the maximum possible difference in the number of balls received.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1\n\nThe only way to distribute three balls to two persons so that each of them receives at least one ball is to give one ball to one person and give two balls to the other person.\n\nThus, the maximum possible difference in the number of balls received is 1.\n\nSample Input 2\n\n3 1\n\nSample Output 2\n\n0\n\nWe have no choice but to give three balls to the only person, in which case the difference in the number of balls received is 0.\n\nSample Input 3\n\n8 5\n\nSample Output 3\n\n3\n\nFor example, if we give 1, 4, 1, 1, 1 balls to the five persons, the number of balls received between the person with the most balls and the person with the fewest balls would be 3, which is the maximum result.", "sample_input": "3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03005", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is distributing N balls to K persons.\n\nIf each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?\n\nConstraints\n\n1 \\leq K \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the maximum possible difference in the number of balls received.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1\n\nThe only way to distribute three balls to two persons so that each of them receives at least one ball is to give one ball to one person and give two balls to the other person.\n\nThus, the maximum possible difference in the number of balls received is 1.\n\nSample Input 2\n\n3 1\n\nSample Output 2\n\n0\n\nWe have no choice but to give three balls to the only person, in which case the difference in the number of balls received is 0.\n\nSample Input 3\n\n8 5\n\nSample Output 3\n\n3\n\nFor example, if we give 1, 4, 1, 1, 1 balls to the five persons, the number of balls received between the person with the most balls and the person with the fewest balls would be 3, which is the maximum result.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 141, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s747342770", "group_id": "codeNet:p03006", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype Point struct{ X, Y int }\ntype Key struct{ Dx, Dy int }\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tps := make([]Point, n)\n\tfor i := range ps {\n\t\tfmt.Scan(&ps[i].X, &ps[i].Y)\n\t}\n\n\txm := make(map[Key]int)\n\tfor _, v1 := range ps {\n\t\tfor _, v2 := range ps {\n\t\t\tif v1 == v2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\txm[Key{v1.X - v2.X, v1.Y - v2.Y}]++\n\t\t}\n\t}\n\n\tmax := 0\n\tfor _, v := range xm {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\tfmt.Println(n - max)\n}\n", "language": "Go", "metadata": {"date": 1561034142, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03006.html", "problem_id": "p03006", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03006/input.txt", "sample_output_relpath": "derived/input_output/data/p03006/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03006/Go/s747342770.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s747342770", "user_id": "u461993794"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype Point struct{ X, Y int }\ntype Key struct{ Dx, Dy int }\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tps := make([]Point, n)\n\tfor i := range ps {\n\t\tfmt.Scan(&ps[i].X, &ps[i].Y)\n\t}\n\n\txm := make(map[Key]int)\n\tfor _, v1 := range ps {\n\t\tfor _, v2 := range ps {\n\t\t\tif v1 == v2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\txm[Key{v1.X - v2.X, v1.Y - v2.Y}]++\n\t\t}\n\t}\n\n\tmax := 0\n\tfor _, v := range xm {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\tfmt.Println(n - max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N balls in a two-dimensional plane. The i-th ball is at coordinates (x_i, y_i).\n\nWe will collect all of these balls, by choosing two integers p and q such that p \\neq 0 or q \\neq 0 and then repeating the following operation:\n\nChoose a ball remaining in the plane and collect it. Let (a, b) be the coordinates of this ball. If we collected a ball at coordinates (a - p, b - q) in the previous operation, the cost of this operation is 0. Otherwise, including when this is the first time to do this operation, the cost of this operation is 1.\n\nFind the minimum total cost required to collect all the balls when we optimally choose p and q.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n|x_i|, |y_i| \\leq 10^9\n\nIf i \\neq j, x_i \\neq x_j or y_i \\neq y_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum total cost required to collect all the balls.\n\nSample Input 1\n\n2\n1 1\n2 2\n\nSample Output 1\n\n1\n\nIf we choose p = 1, q = 1, we can collect all the balls at a cost of 1 by collecting them in the order (1, 1), (2, 2).\n\nSample Input 2\n\n3\n1 4\n4 6\n7 8\n\nSample Output 2\n\n1\n\nIf we choose p = -3, q = -2, we can collect all the balls at a cost of 1 by collecting them in the order (7, 8), (4, 6), (1, 4).\n\nSample Input 3\n\n4\n1 1\n1 2\n2 1\n2 2\n\nSample Output 3\n\n2", "sample_input": "2\n1 1\n2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03006", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N balls in a two-dimensional plane. The i-th ball is at coordinates (x_i, y_i).\n\nWe will collect all of these balls, by choosing two integers p and q such that p \\neq 0 or q \\neq 0 and then repeating the following operation:\n\nChoose a ball remaining in the plane and collect it. Let (a, b) be the coordinates of this ball. If we collected a ball at coordinates (a - p, b - q) in the previous operation, the cost of this operation is 0. Otherwise, including when this is the first time to do this operation, the cost of this operation is 1.\n\nFind the minimum total cost required to collect all the balls when we optimally choose p and q.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n|x_i|, |y_i| \\leq 10^9\n\nIf i \\neq j, x_i \\neq x_j or y_i \\neq y_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum total cost required to collect all the balls.\n\nSample Input 1\n\n2\n1 1\n2 2\n\nSample Output 1\n\n1\n\nIf we choose p = 1, q = 1, we can collect all the balls at a cost of 1 by collecting them in the order (1, 1), (2, 2).\n\nSample Input 2\n\n3\n1 4\n4 6\n7 8\n\nSample Output 2\n\n1\n\nIf we choose p = -3, q = -2, we can collect all the balls at a cost of 1 by collecting them in the order (7, 8), (4, 6), (1, 4).\n\nSample Input 3\n\n4\n1 1\n1 2\n2 1\n2 2\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 506, "cpu_time_ms": 2, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s519769788", "group_id": "codeNet:p03006", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype area struct {\n\tx int\n\ty int\n}\n\ntype areas []area\n\nfunc (d areas) Len() int {\n\treturn len(d)\n}\n\nfunc (d areas) Swap(i, j int) {\n\td[i], d[j] = d[j], d[i]\n}\n\nfunc (d areas) Less(i, j int) bool {\n\treturn d[i].x < d[j].x\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tar := make(areas, n)\n\tfor i := range ar {\n\t\tfmt.Scan(&ar[i].x, &ar[i].y)\n\t}\n\tif n == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tsort.Sort(ar)\n\tmp := map[area]int{}\n\tfor i := 0; i < n-1; i++ {\n\t\tbuf := map[area]bool{}\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tv := area{}\n\t\t\tv.x = ar[i].x - ar[j].x\n\t\t\tv.y = ar[i].y - ar[j].y\n\t\t\tif buf[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmp[v]++\n\t\t\tbuf[v] = true\n\t\t}\n\t}\n\tmax := 0\n\tfor k, v := range mp {\n\t\tif k.x == 0 && k.y == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\tfmt.Println(n - max)\n}\n", "language": "Go", "metadata": {"date": 1560649431, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03006.html", "problem_id": "p03006", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03006/input.txt", "sample_output_relpath": "derived/input_output/data/p03006/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03006/Go/s519769788.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s519769788", "user_id": "u375977529"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype area struct {\n\tx int\n\ty int\n}\n\ntype areas []area\n\nfunc (d areas) Len() int {\n\treturn len(d)\n}\n\nfunc (d areas) Swap(i, j int) {\n\td[i], d[j] = d[j], d[i]\n}\n\nfunc (d areas) Less(i, j int) bool {\n\treturn d[i].x < d[j].x\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tar := make(areas, n)\n\tfor i := range ar {\n\t\tfmt.Scan(&ar[i].x, &ar[i].y)\n\t}\n\tif n == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tsort.Sort(ar)\n\tmp := map[area]int{}\n\tfor i := 0; i < n-1; i++ {\n\t\tbuf := map[area]bool{}\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tv := area{}\n\t\t\tv.x = ar[i].x - ar[j].x\n\t\t\tv.y = ar[i].y - ar[j].y\n\t\t\tif buf[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmp[v]++\n\t\t\tbuf[v] = true\n\t\t}\n\t}\n\tmax := 0\n\tfor k, v := range mp {\n\t\tif k.x == 0 && k.y == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\tfmt.Println(n - max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N balls in a two-dimensional plane. The i-th ball is at coordinates (x_i, y_i).\n\nWe will collect all of these balls, by choosing two integers p and q such that p \\neq 0 or q \\neq 0 and then repeating the following operation:\n\nChoose a ball remaining in the plane and collect it. Let (a, b) be the coordinates of this ball. If we collected a ball at coordinates (a - p, b - q) in the previous operation, the cost of this operation is 0. Otherwise, including when this is the first time to do this operation, the cost of this operation is 1.\n\nFind the minimum total cost required to collect all the balls when we optimally choose p and q.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n|x_i|, |y_i| \\leq 10^9\n\nIf i \\neq j, x_i \\neq x_j or y_i \\neq y_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum total cost required to collect all the balls.\n\nSample Input 1\n\n2\n1 1\n2 2\n\nSample Output 1\n\n1\n\nIf we choose p = 1, q = 1, we can collect all the balls at a cost of 1 by collecting them in the order (1, 1), (2, 2).\n\nSample Input 2\n\n3\n1 4\n4 6\n7 8\n\nSample Output 2\n\n1\n\nIf we choose p = -3, q = -2, we can collect all the balls at a cost of 1 by collecting them in the order (7, 8), (4, 6), (1, 4).\n\nSample Input 3\n\n4\n1 1\n1 2\n2 1\n2 2\n\nSample Output 3\n\n2", "sample_input": "2\n1 1\n2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03006", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N balls in a two-dimensional plane. The i-th ball is at coordinates (x_i, y_i).\n\nWe will collect all of these balls, by choosing two integers p and q such that p \\neq 0 or q \\neq 0 and then repeating the following operation:\n\nChoose a ball remaining in the plane and collect it. Let (a, b) be the coordinates of this ball. If we collected a ball at coordinates (a - p, b - q) in the previous operation, the cost of this operation is 0. Otherwise, including when this is the first time to do this operation, the cost of this operation is 1.\n\nFind the minimum total cost required to collect all the balls when we optimally choose p and q.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n|x_i|, |y_i| \\leq 10^9\n\nIf i \\neq j, x_i \\neq x_j or y_i \\neq y_j.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the minimum total cost required to collect all the balls.\n\nSample Input 1\n\n2\n1 1\n2 2\n\nSample Output 1\n\n1\n\nIf we choose p = 1, q = 1, we can collect all the balls at a cost of 1 by collecting them in the order (1, 1), (2, 2).\n\nSample Input 2\n\n3\n1 4\n4 6\n7 8\n\nSample Output 2\n\n1\n\nIf we choose p = -3, q = -2, we can collect all the balls at a cost of 1 by collecting them in the order (7, 8), (4, 6), (1, 4).\n\nSample Input 3\n\n4\n1 1\n1 2\n2 1\n2 2\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 816, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s994909220", "group_id": "codeNet:p03007", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn := io.NextInt()\n\n\tnums := []int{}\n\n\tpositives := []int{}\n\tnegatives := []int{}\n\tzeros := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tn := io.NextInt()\n\t\tnums = append(nums, n)\n\n\t\tif n > 0 {\n\t\t\tpositives = append(positives, n)\n\t\t} else if n <= 0 {\n\t\t\tnegatives = append(negatives, n)\n\t\t} else {\n\t\t\tzeros = append(zeros, n)\n\t\t}\n\t}\n\n\tlateShow := []string{}\n\n\tif len(negatives) == 0 {\n\t\tif len(zeros) == 0 {\n\t\t\tif positives[0] > positives[1] {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(positives[1], positives[0]))\n\t\t\t} else {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(positives[0], positives[1]))\n\t\t\t}\n\t\t\tnegatives = append(negatives, -abs(positives[0]-positives[1]))\n\t\t\tpositives = positives[2:]\n\t\t\tn--\n\t\t} else {\n\t\t\tnegatives = append(negatives, zeros...)\n\t\t}\n\t} else if len(positives) == 0 {\n\t\tif len(zeros) == 0 {\n\t\t\tif negatives[0] > negatives[1] {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(negatives[0], negatives[1]))\n\t\t\t} else {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(negatives[1], negatives[0]))\n\t\t\t}\n\t\t\tpositives = append(positives, abs(negatives[0]-negatives[1]))\n\t\t\tnegatives = negatives[2:]\n\t\t\tn--\n\n\t\t} else {\n\t\t\tpositives = append(positives, zeros...)\n\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, n := range positives {\n\t\tans += abs(n)\n\t}\n\n\tfor _, n := range negatives {\n\t\tans += abs(n)\n\t}\n\n\tfmt.Println(ans)\n\n\tfor _, s := range lateShow {\n\t\tif s != \"\" {\n\t\t\tfmt.Print(s)\n\t\t}\n\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tplus := positives[0]\n\t\tminus := negatives[0]\n\t\t//fmt.Println(\"hogheo\", plus, minus)\n\t\t//fmt.Println(\"hogheo\", plus, minus)\n\t\tif len(positives) > len(negatives) {\n\t\t\tfmt.Println(minus, plus)\n\t\t\tnegatives = append(negatives, minus-plus)\n\t\t} else {\n\t\t\tfmt.Println(plus, minus)\n\t\t\tpositives = append(positives, plus-minus)\n\t\t}\n\n\t\tpositives = positives[1:]\n\t\tnegatives = negatives[1:]\n\t}\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc cumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n", "language": "Go", "metadata": {"date": 1560650314, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03007.html", "problem_id": "p03007", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03007/input.txt", "sample_output_relpath": "derived/input_output/data/p03007/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03007/Go/s994909220.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s994909220", "user_id": "u134387396"}, "prompt_components": {"gold_output": "4\n-1 1\n2 -2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn := io.NextInt()\n\n\tnums := []int{}\n\n\tpositives := []int{}\n\tnegatives := []int{}\n\tzeros := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tn := io.NextInt()\n\t\tnums = append(nums, n)\n\n\t\tif n > 0 {\n\t\t\tpositives = append(positives, n)\n\t\t} else if n <= 0 {\n\t\t\tnegatives = append(negatives, n)\n\t\t} else {\n\t\t\tzeros = append(zeros, n)\n\t\t}\n\t}\n\n\tlateShow := []string{}\n\n\tif len(negatives) == 0 {\n\t\tif len(zeros) == 0 {\n\t\t\tif positives[0] > positives[1] {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(positives[1], positives[0]))\n\t\t\t} else {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(positives[0], positives[1]))\n\t\t\t}\n\t\t\tnegatives = append(negatives, -abs(positives[0]-positives[1]))\n\t\t\tpositives = positives[2:]\n\t\t\tn--\n\t\t} else {\n\t\t\tnegatives = append(negatives, zeros...)\n\t\t}\n\t} else if len(positives) == 0 {\n\t\tif len(zeros) == 0 {\n\t\t\tif negatives[0] > negatives[1] {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(negatives[0], negatives[1]))\n\t\t\t} else {\n\t\t\t\tlateShow = append(lateShow, fmt.Sprintln(negatives[1], negatives[0]))\n\t\t\t}\n\t\t\tpositives = append(positives, abs(negatives[0]-negatives[1]))\n\t\t\tnegatives = negatives[2:]\n\t\t\tn--\n\n\t\t} else {\n\t\t\tpositives = append(positives, zeros...)\n\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, n := range positives {\n\t\tans += abs(n)\n\t}\n\n\tfor _, n := range negatives {\n\t\tans += abs(n)\n\t}\n\n\tfmt.Println(ans)\n\n\tfor _, s := range lateShow {\n\t\tif s != \"\" {\n\t\t\tfmt.Print(s)\n\t\t}\n\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tplus := positives[0]\n\t\tminus := negatives[0]\n\t\t//fmt.Println(\"hogheo\", plus, minus)\n\t\t//fmt.Println(\"hogheo\", plus, minus)\n\t\tif len(positives) > len(negatives) {\n\t\t\tfmt.Println(minus, plus)\n\t\t\tnegatives = append(negatives, minus-plus)\n\t\t} else {\n\t\t\tfmt.Println(plus, minus)\n\t\t\tpositives = append(positives, plus-minus)\n\t\t}\n\n\t\tpositives = positives[1:]\n\t\tnegatives = negatives[1:]\n\t}\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc cumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on a blackboard.\n\nWe will repeat the following operation N-1 times so that we have only one integer on the blackboard.\n\nChoose two integers x and y on the blackboard and erase these two integers. Then, write a new integer x-y.\n\nFind the maximum possible value of the final integer on the blackboard and a sequence of operations that maximizes the final integer.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-10^4 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value M of the final integer on the blackboard, and a sequence of operations x_i, y_i that maximizes the final integer, in the format below.\n\nHere x_i and y_i represent the integers x and y chosen in the i-th operation, respectively.\n\nIf there are multiple sequences of operations that maximize the final integer, any of them will be accepted.\n\nM\nx_1 y_1\n:\nx_{N-1} y_{N-1}\n\nSample Input 1\n\n3\n1 -1 2\n\nSample Output 1\n\n4\n-1 1\n2 -2\n\nIf we choose x = -1 and y = 1 in the first operation, the set of integers written on the blackboard becomes (-2, 2).\n\nThen, if we choose x = 2 and y = -2 in the second operation, the set of integers written on the blackboard becomes (4).\n\nIn this case, we have 4 as the final integer. We cannot end with a greater integer, so the answer is 4.\n\nSample Input 2\n\n3\n1 1 1\n\nSample Output 2\n\n1\n1 1\n1 0", "sample_input": "3\n1 -1 2\n"}, "reference_outputs": ["4\n-1 1\n2 -2\n"], "source_document_id": "p03007", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on a blackboard.\n\nWe will repeat the following operation N-1 times so that we have only one integer on the blackboard.\n\nChoose two integers x and y on the blackboard and erase these two integers. Then, write a new integer x-y.\n\nFind the maximum possible value of the final integer on the blackboard and a sequence of operations that maximizes the final integer.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-10^4 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value M of the final integer on the blackboard, and a sequence of operations x_i, y_i that maximizes the final integer, in the format below.\n\nHere x_i and y_i represent the integers x and y chosen in the i-th operation, respectively.\n\nIf there are multiple sequences of operations that maximize the final integer, any of them will be accepted.\n\nM\nx_1 y_1\n:\nx_{N-1} y_{N-1}\n\nSample Input 1\n\n3\n1 -1 2\n\nSample Output 1\n\n4\n-1 1\n2 -2\n\nIf we choose x = -1 and y = 1 in the first operation, the set of integers written on the blackboard becomes (-2, 2).\n\nThen, if we choose x = 2 and y = -2 in the second operation, the set of integers written on the blackboard becomes (4).\n\nIn this case, we have 4 as the final integer. We cannot end with a greater integer, so the answer is 4.\n\nSample Input 2\n\n3\n1 1 1\n\nSample Output 2\n\n1\n1 1\n1 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4636, "cpu_time_ms": 264, "memory_kb": 12416}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s145575015", "group_id": "codeNet:p03011", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc main() {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n sc.Scan()\n p, _ := strconv.Atoi(sc.Text())\n\n sc.Scan()\n q, _ := strconv.Atoi(sc.Text())\n\n sc.Scan()\n r, _ := strconv.Atoi(sc.Text())\n\n if p + q < q + r {\n if p + q < r + p {\n fmt.Println(p + q)\n } else {\n fmt.Println(r + p)\n }\n } else {\n if q + r < r + p {\n fmt.Println(q + r)\n } else {\n fmt.Println(r + p)\n }\n }\n\n}\n\n", "language": "Go", "metadata": {"date": 1560128657, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03011.html", "problem_id": "p03011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03011/input.txt", "sample_output_relpath": "derived/input_output/data/p03011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03011/Go/s145575015.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s145575015", "user_id": "u212486902"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc main() {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n sc.Scan()\n p, _ := strconv.Atoi(sc.Text())\n\n sc.Scan()\n q, _ := strconv.Atoi(sc.Text())\n\n sc.Scan()\n r, _ := strconv.Atoi(sc.Text())\n\n if p + q < q + r {\n if p + q < r + p {\n fmt.Println(p + q)\n } else {\n fmt.Println(r + p)\n }\n } else {\n if q + r < r + p {\n fmt.Println(q + r)\n } else {\n fmt.Println(r + p)\n }\n }\n\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are three airports A, B and C, and flights between each pair of airports in both directions.\n\nA one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.\n\nConsider a route where we start at one of the airports, fly to another airport and then fly to the other airport.\n\nWhat is the minimum possible sum of the flight times?\n\nConstraints\n\n1 \\leq P,Q,R \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nP Q R\n\nOutput\n\nPrint the minimum possible sum of the flight times.\n\nSample Input 1\n\n1 3 4\n\nSample Output 1\n\n4\n\nThe sum of the flight times in the route A \\rightarrow B \\rightarrow C: 1 + 3 = 4 hours\n\nThe sum of the flight times in the route A \\rightarrow C \\rightarrow C: 4 + 3 = 7 hours\n\nThe sum of the flight times in the route B \\rightarrow A \\rightarrow C: 1 + 4 = 5 hours\n\nThe sum of the flight times in the route B \\rightarrow C \\rightarrow A: 3 + 4 = 7 hours\n\nThe sum of the flight times in the route C \\rightarrow A \\rightarrow B: 4 + 1 = 5 hours\n\nThe sum of the flight times in the route C \\rightarrow B \\rightarrow A: 3 + 1 = 4 hours\n\nThe minimum of these is 4 hours.\n\nSample Input 2\n\n3 2 3\n\nSample Output 2\n\n5", "sample_input": "1 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are three airports A, B and C, and flights between each pair of airports in both directions.\n\nA one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.\n\nConsider a route where we start at one of the airports, fly to another airport and then fly to the other airport.\n\nWhat is the minimum possible sum of the flight times?\n\nConstraints\n\n1 \\leq P,Q,R \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nP Q R\n\nOutput\n\nPrint the minimum possible sum of the flight times.\n\nSample Input 1\n\n1 3 4\n\nSample Output 1\n\n4\n\nThe sum of the flight times in the route A \\rightarrow B \\rightarrow C: 1 + 3 = 4 hours\n\nThe sum of the flight times in the route A \\rightarrow C \\rightarrow C: 4 + 3 = 7 hours\n\nThe sum of the flight times in the route B \\rightarrow A \\rightarrow C: 1 + 4 = 5 hours\n\nThe sum of the flight times in the route B \\rightarrow C \\rightarrow A: 3 + 4 = 7 hours\n\nThe sum of the flight times in the route C \\rightarrow A \\rightarrow B: 4 + 1 = 5 hours\n\nThe sum of the flight times in the route C \\rightarrow B \\rightarrow A: 3 + 1 = 4 hours\n\nThe minimum of these is 4 hours.\n\nSample Input 2\n\n3 2 3\n\nSample Output 2\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 506, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s253989252", "group_id": "codeNet:p03012", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tW := make([]int, N)\n\tsum := 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&W[i])\n\t\tsum += W[i]\n\t}\n\n\tans := sum\n\tp := 0\n\tfor i := 0; i < N; i++ {\n\t\tp += W[i]\n\t\tans = int(math.Min(\n\t\t\tfloat64(ans),\n\t\t\tmath.Abs(float64(p-(sum-p))),\n\t\t))\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1573056015, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03012.html", "problem_id": "p03012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03012/input.txt", "sample_output_relpath": "derived/input_output/data/p03012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03012/Go/s253989252.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s253989252", "user_id": "u902409225"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tW := make([]int, N)\n\tsum := 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&W[i])\n\t\tsum += W[i]\n\t}\n\n\tans := sum\n\tp := 0\n\tfor i := 0; i < N; i++ {\n\t\tp += W[i]\n\t\tans = int(math.Min(\n\t\t\tfloat64(ans),\n\t\t\tmath.Abs(float64(p-(sum-p))),\n\t\t))\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03012", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 331, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s526503564", "group_id": "codeNet:p03012", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsum := 0\n\tws := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&ws[i])\n\t\tsum += ws[i]\n\t}\n\n\tret := 0\n\ttmp := 0\n\tfor i := 0; i < n; i++ {\n\t\ttmp += ws[i]\n\t\tif tmp >= (sum / 2) {\n\t\t\tcalc1 := getAbs(tmp, sum-tmp)\n\t\t\tcalc2 := getAbs(tmp-ws[i], sum-tmp-ws[i])\n\t\t\tif calc1 > calc2 {\n\t\t\t\tret = calc2\n\t\t\t} else {\n\t\t\t\tret = calc1\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ret)\n}\n\nfunc getAbs(a, b int) int {\n\ttmp := a - b\n\tif tmp > 0 {\n\t\treturn tmp\n\t} else {\n\t\treturn -tmp\n\t}\n}\n", "language": "Go", "metadata": {"date": 1560129616, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03012.html", "problem_id": "p03012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03012/input.txt", "sample_output_relpath": "derived/input_output/data/p03012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03012/Go/s526503564.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s526503564", "user_id": "u433254839"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsum := 0\n\tws := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&ws[i])\n\t\tsum += ws[i]\n\t}\n\n\tret := 0\n\ttmp := 0\n\tfor i := 0; i < n; i++ {\n\t\ttmp += ws[i]\n\t\tif tmp >= (sum / 2) {\n\t\t\tcalc1 := getAbs(tmp, sum-tmp)\n\t\t\tcalc2 := getAbs(tmp-ws[i], sum-tmp-ws[i])\n\t\t\tif calc1 > calc2 {\n\t\t\t\tret = calc2\n\t\t\t} else {\n\t\t\t\tret = calc1\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ret)\n}\n\nfunc getAbs(a, b int) int {\n\ttmp := a - b\n\tif tmp > 0 {\n\t\treturn tmp\n\t} else {\n\t\treturn -tmp\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03012", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 539, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s836377169", "group_id": "codeNet:p03012", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tN := readInt()\n\tW := make([]int, N)\n\tvar ans int\n\tfor i := range W {\n\t\tW[i] = readInt()\n\t\tans += W[i]\n\t}\n\n\tfor i := 0; i < N-1; i++ {\n\t\tvar s1, s2, j int\n\t\tfor ; j <= i; j++ {\n\t\t\ts1 += W[j]\n\t\t}\n\t\tfor ; j < N; j++ {\n\t\t\ts2 += W[j]\n\t\t}\n\t\tans = min(ans, abs(s1-s2))\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1560128700, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03012.html", "problem_id": "p03012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03012/input.txt", "sample_output_relpath": "derived/input_output/data/p03012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03012/Go/s836377169.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s836377169", "user_id": "u705974985"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tN := readInt()\n\tW := make([]int, N)\n\tvar ans int\n\tfor i := range W {\n\t\tW[i] = readInt()\n\t\tans += W[i]\n\t}\n\n\tfor i := 0; i < N-1; i++ {\n\t\tvar s1, s2, j int\n\t\tfor ; j <= i; j++ {\n\t\t\ts1 += W[j]\n\t\t}\n\t\tfor ; j < N; j++ {\n\t\t\ts2 += W[j]\n\t\t}\n\t\tans = min(ans, abs(s1-s2))\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03012", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2440, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s158804883", "group_id": "codeNet:p03013", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc COM(n, k int64) int64 {\n\tr := int64(1)\n\tfor i := int64(0); i < k; i++ {\n\t\tr = ModMul(r, n-i)\n\t\tr = ModDiv(r, i+1)\n\t}\n\n\treturn r\n}\n\nconst (\n\tMOD = 1000000000 + 7\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc FactoredPrimeNumber(num int) map[int]int {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\\n\", &N, &M)\n\tm := map[int]bool{}\n\tfor i := 0; i < M; i++ {\n\t\tvar w int\n\t\tfmt.Scanf(\"%d\\n\", &w)\n\t\tm[w] = true\n\t}\n\tdp := [1000000]int{}\n\tdp[0] = 1\n\tfor i := 0; i <= N; i++ {\n\t\tfor j := i + 1; j <= N && j <= i+2; j++ {\n\t\t\tif m[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[j] += dp[i]\n\t\t\tdp[j] %= MOD\n\t\t}\n\t}\n\tfmt.Println(dp[N])\n}\n\nfunc Reverse(runes []rune) []rune {\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn runes\n}\n", "language": "Go", "metadata": {"date": 1589311382, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03013.html", "problem_id": "p03013", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03013/input.txt", "sample_output_relpath": "derived/input_output/data/p03013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03013/Go/s158804883.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s158804883", "user_id": "u534481484"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc COM(n, k int64) int64 {\n\tr := int64(1)\n\tfor i := int64(0); i < k; i++ {\n\t\tr = ModMul(r, n-i)\n\t\tr = ModDiv(r, i+1)\n\t}\n\n\treturn r\n}\n\nconst (\n\tMOD = 1000000000 + 7\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc FactoredPrimeNumber(num int) map[int]int {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\\n\", &N, &M)\n\tm := map[int]bool{}\n\tfor i := 0; i < M; i++ {\n\t\tvar w int\n\t\tfmt.Scanf(\"%d\\n\", &w)\n\t\tm[w] = true\n\t}\n\tdp := [1000000]int{}\n\tdp[0] = 1\n\tfor i := 0; i <= N; i++ {\n\t\tfor j := i + 1; j <= N && j <= i+2; j++ {\n\t\t\tif m[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[j] += dp[i]\n\t\t\tdp[j] %= MOD\n\t\t}\n\t}\n\tfmt.Println(dp[N])\n}\n\nfunc Reverse(runes []rune) []rune {\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn runes\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "sample_input": "6 1\n3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03013", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2389, "cpu_time_ms": 495, "memory_kb": 13056}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s560914908", "group_id": "codeNet:p03013", "input_text": "// https://atcoder.jp/contests/abc129/tasks/abc129_c\n\npackage main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\nconst mod = 1000000007\n\nfunc main() {\n\tN := NextInt()\n\tM := NextInt()\n\tbroken := make([]bool, N+1)\n\tfor i := 0; i < M; i++ {\n\t\ta := NextInt()\n\t\tbroken[a] = true\n\t}\n\n\t// i 段目まで行く方法\n\tcounts := make([]int, N+1)\n\tcounts[0] = 1\n\n\tfor i := 1; i < len(counts); i++ {\n\t\tif broken[i] {\n\t\t\tcounts[i] = 0\n\t\t\tcontinue\n\t\t}\n\n\t\tif i == 1 {\n\t\t\tcounts[i] = counts[i-1]\n\t\t} else {\n\t\t\tcounts[i] = (counts[i-1] + counts[i-2]) % mod\n\t\t}\n\t}\n\n\tfmt.Println(counts[N] % mod)\n}\n\nfunc init() {\n\t_sw.Split(bufio.ScanWords)\n}\n\nfunc NextInt() int {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\ti, e := strconv.Atoi(_sw.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc NextString() string {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\treturn _sw.Text()\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1566911501, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03013.html", "problem_id": "p03013", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03013/input.txt", "sample_output_relpath": "derived/input_output/data/p03013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03013/Go/s560914908.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s560914908", "user_id": "u764320774"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc129/tasks/abc129_c\n\npackage main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\nconst mod = 1000000007\n\nfunc main() {\n\tN := NextInt()\n\tM := NextInt()\n\tbroken := make([]bool, N+1)\n\tfor i := 0; i < M; i++ {\n\t\ta := NextInt()\n\t\tbroken[a] = true\n\t}\n\n\t// i 段目まで行く方法\n\tcounts := make([]int, N+1)\n\tcounts[0] = 1\n\n\tfor i := 1; i < len(counts); i++ {\n\t\tif broken[i] {\n\t\t\tcounts[i] = 0\n\t\t\tcontinue\n\t\t}\n\n\t\tif i == 1 {\n\t\t\tcounts[i] = counts[i-1]\n\t\t} else {\n\t\t\tcounts[i] = (counts[i-1] + counts[i-2]) % mod\n\t\t}\n\t}\n\n\tfmt.Println(counts[N] % mod)\n}\n\nfunc init() {\n\t_sw.Split(bufio.ScanWords)\n}\n\nfunc NextInt() int {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\ti, e := strconv.Atoi(_sw.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc NextString() string {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\treturn _sw.Text()\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "sample_input": "6 1\n3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03013", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1047, "cpu_time_ms": 19, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s278608839", "group_id": "codeNet:p03013", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\ta := make([]int, m)\n\tdp := make([]int, n+2)\n\tbroken := make([]bool, n+2)\n\tdp[n] = 1\n\tfor i:= range a {\n\t\tfmt.Scan(&a[i])\n\t\tbroken[a[i]] = true\n\t}\n\tfor i:=n-1; i>=0; i-- {\n\t\tif (broken[i]) {\n\t\t\tdp[i] = 0\n\t\t} else {\n\t\t\tdp[i] = (dp[i+1] + dp[i+2]) % 1000000007\n\t\t}\n\t}\n\tfmt.Println(dp[0])\n}", "language": "Go", "metadata": {"date": 1560318534, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03013.html", "problem_id": "p03013", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03013/input.txt", "sample_output_relpath": "derived/input_output/data/p03013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03013/Go/s278608839.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s278608839", "user_id": "u360765331"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\ta := make([]int, m)\n\tdp := make([]int, n+2)\n\tbroken := make([]bool, n+2)\n\tdp[n] = 1\n\tfor i:= range a {\n\t\tfmt.Scan(&a[i])\n\t\tbroken[a[i]] = true\n\t}\n\tfor i:=n-1; i>=0; i-- {\n\t\tif (broken[i]) {\n\t\t\tdp[i] = 0\n\t\t} else {\n\t\t\tdp[i] = (dp[i+1] + dp[i+2]) % 1000000007\n\t\t}\n\t}\n\tfmt.Println(dp[0])\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "sample_input": "6 1\n3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03013", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 368, "cpu_time_ms": 436, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s818629500", "group_id": "codeNet:p03013", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = nextInt()\n\t}\n\treturn ints\n}\n\nfunc calc(n int) int {\n\tif n == 0 || n == 1 {\n\t\treturn 1\n\t}\n\n\tif n == 2 {\n\t\treturn 2\n\t}\n\n\treturn calc(n-2) + calc(n-1)\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tm := nextInt()\n\tbrokenSteps := nextInts(m)\n\n\tif n == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tif n == 2 {\n\t\tif len(brokenSteps) == 0 {\n\t\t\tfmt.Println(2)\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tstart := 0\n\tvar answer uint64\n\tanswer = 1\n\tfor _, i := range brokenSteps {\n\t\tsteps := i - start - 1\n\t\tif steps < 0 {\n\t\t\tfmt.Println(0)\n\t\t\tos.Exit(0)\n\t\t}\n\t\tanswer *= uint64(calc(steps))\n\t\tstart = i + 1\n\t}\n\n\tif start < n {\n\t\tsteps := n - start\n\t\tanswer *= uint64(calc(steps))\n\t}\n\n\tfmt.Println(answer % 1000000007)\n}\n", "language": "Go", "metadata": {"date": 1560240135, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03013.html", "problem_id": "p03013", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03013/input.txt", "sample_output_relpath": "derived/input_output/data/p03013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03013/Go/s818629500.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s818629500", "user_id": "u262403099"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = nextInt()\n\t}\n\treturn ints\n}\n\nfunc calc(n int) int {\n\tif n == 0 || n == 1 {\n\t\treturn 1\n\t}\n\n\tif n == 2 {\n\t\treturn 2\n\t}\n\n\treturn calc(n-2) + calc(n-1)\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tm := nextInt()\n\tbrokenSteps := nextInts(m)\n\n\tif n == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tif n == 2 {\n\t\tif len(brokenSteps) == 0 {\n\t\t\tfmt.Println(2)\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tstart := 0\n\tvar answer uint64\n\tanswer = 1\n\tfor _, i := range brokenSteps {\n\t\tsteps := i - start - 1\n\t\tif steps < 0 {\n\t\t\tfmt.Println(0)\n\t\t\tos.Exit(0)\n\t\t}\n\t\tanswer *= uint64(calc(steps))\n\t\tstart = i + 1\n\t}\n\n\tif start < n {\n\t\tsteps := n - start\n\t\tanswer *= uint64(calc(steps))\n\t}\n\n\tfmt.Println(answer % 1000000007)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "sample_input": "6 1\n3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03013", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1040, "cpu_time_ms": 2107, "memory_kb": 4224}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s594922230", "group_id": "codeNet:p03014", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tmaxwh = 2000\n)\n\n/*\n * すみません、自作ではありません。本人には謝りました。\n */\n\nfunc main() {\n\t// 入力\n\tr := bufio.NewReader(os.Stdin)\n\tvar h, w int\n\tfmt.Fscan(r, &h, &w)\n\tr.ReadString('\\n')\n\tvar s [maxwh + 2][maxwh + 2]bool\n\tfor y := 1; y <= h; y++ {\n\t\tline, _ := r.ReadString('\\n')\n\t\tfor x := 1; x <= w; x++ {\n\t\t\ts[x][y] = line[x-1] == '.'\n\t\t}\n\t}\n\n\t// 上下左右の計算\n\tvar jo, ge, sa, yu [maxwh + 2][maxwh + 2]int\n\tfor y := 1; y <= h; y++ {\n\t\tfor x := 1; x <= w; x++ {\n\t\t\tif s[x][y] {\n\t\t\t\tjo[x][y] = jo[x][y-1] + 1\n\t\t\t\tsa[x][y] = sa[x-1][y] + 1\n\t\t\t}\n\t\t}\n\t}\n\tfor y := h; y >= 1; y-- {\n\t\tfor x := w; x >= 1; x-- {\n\t\t\tif s[x][y] {\n\t\t\t\tge[x][y] = ge[x][y+1] + 1\n\t\t\t\tyu[x][y] = yu[x+1][y] + 1\n\t\t\t}\n\t\t}\n\t}\n\n\t// 最大値の計算\n\tres := 0\n\tfor y := 1; y <= h; y++ {\n\t\tfor x := 1; x <= w; x++ {\n\t\t\tv := jo[x][y] + ge[x][y] + sa[x][y] + yu[x][y] - 3\n\t\t\tif v > res {\n\t\t\t\tres = v\n\t\t\t}\n\t\t}\n\t}\n\n\t// 出力\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1596164448, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03014.html", "problem_id": "p03014", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03014/input.txt", "sample_output_relpath": "derived/input_output/data/p03014/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03014/Go/s594922230.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s594922230", "user_id": "u624782787"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tmaxwh = 2000\n)\n\n/*\n * すみません、自作ではありません。本人には謝りました。\n */\n\nfunc main() {\n\t// 入力\n\tr := bufio.NewReader(os.Stdin)\n\tvar h, w int\n\tfmt.Fscan(r, &h, &w)\n\tr.ReadString('\\n')\n\tvar s [maxwh + 2][maxwh + 2]bool\n\tfor y := 1; y <= h; y++ {\n\t\tline, _ := r.ReadString('\\n')\n\t\tfor x := 1; x <= w; x++ {\n\t\t\ts[x][y] = line[x-1] == '.'\n\t\t}\n\t}\n\n\t// 上下左右の計算\n\tvar jo, ge, sa, yu [maxwh + 2][maxwh + 2]int\n\tfor y := 1; y <= h; y++ {\n\t\tfor x := 1; x <= w; x++ {\n\t\t\tif s[x][y] {\n\t\t\t\tjo[x][y] = jo[x][y-1] + 1\n\t\t\t\tsa[x][y] = sa[x-1][y] + 1\n\t\t\t}\n\t\t}\n\t}\n\tfor y := h; y >= 1; y-- {\n\t\tfor x := w; x >= 1; x-- {\n\t\t\tif s[x][y] {\n\t\t\t\tge[x][y] = ge[x][y+1] + 1\n\t\t\t\tyu[x][y] = yu[x+1][y] + 1\n\t\t\t}\n\t\t}\n\t}\n\n\t// 最大値の計算\n\tres := 0\n\tfor y := 1; y <= h; y++ {\n\t\tfor x := 1; x <= w; x++ {\n\t\t\tv := jo[x][y] + ge[x][y] + sa[x][y] + yu[x][y] - 3\n\t\t\tif v > res {\n\t\t\t\tres = v\n\t\t\t}\n\t\t}\n\t}\n\n\t// 出力\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with H horizontal rows and W vertical columns, and there are obstacles on some of the squares.\n\nSnuke is going to choose one of the squares not occupied by an obstacle and place a lamp on it.\nThe lamp placed on the square will emit straight beams of light in four cardinal directions: up, down, left, and right.\nIn each direction, the beam will continue traveling until it hits a square occupied by an obstacle or it hits the border of the grid. It will light all the squares on the way, including the square on which the lamp is placed, but not the square occupied by an obstacle.\n\nSnuke wants to maximize the number of squares lighted by the lamp.\n\nYou are given H strings S_i (1 \\leq i \\leq H), each of length W. If the j-th character (1 \\leq j \\leq W) of S_i is #, there is an obstacle on the square at the i-th row from the top and the j-th column from the left; if that character is ., there is no obstacle on that square.\n\nFind the maximum possible number of squares lighted by the lamp.\n\nConstraints\n\n1 \\leq H \\leq 2,000\n\n1 \\leq W \\leq 2,000\n\nS_i is a string of length W consisting of # and ..\n\n. occurs at least once in one of the strings S_i (1 \\leq i \\leq H).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the maximum possible number of squares lighted by the lamp.\n\nSample Input 1\n\n4 6\n#..#..\n.....#\n....#.\n#.#...\n\nSample Output 1\n\n8\n\nIf Snuke places the lamp on the square at the second row from the top and the second column from the left, it will light the following squares: the first through fifth squares from the left in the second row, and the first through fourth squares from the top in the second column, for a total of eight squares.\n\nSample Input 2\n\n8 8\n..#...#.\n....#...\n##......\n..###..#\n...#..#.\n##....#.\n#...#...\n###.#..#\n\nSample Output 2\n\n13", "sample_input": "4 6\n#..#..\n.....#\n....#.\n#.#...\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03014", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with H horizontal rows and W vertical columns, and there are obstacles on some of the squares.\n\nSnuke is going to choose one of the squares not occupied by an obstacle and place a lamp on it.\nThe lamp placed on the square will emit straight beams of light in four cardinal directions: up, down, left, and right.\nIn each direction, the beam will continue traveling until it hits a square occupied by an obstacle or it hits the border of the grid. It will light all the squares on the way, including the square on which the lamp is placed, but not the square occupied by an obstacle.\n\nSnuke wants to maximize the number of squares lighted by the lamp.\n\nYou are given H strings S_i (1 \\leq i \\leq H), each of length W. If the j-th character (1 \\leq j \\leq W) of S_i is #, there is an obstacle on the square at the i-th row from the top and the j-th column from the left; if that character is ., there is no obstacle on that square.\n\nFind the maximum possible number of squares lighted by the lamp.\n\nConstraints\n\n1 \\leq H \\leq 2,000\n\n1 \\leq W \\leq 2,000\n\nS_i is a string of length W consisting of # and ..\n\n. occurs at least once in one of the strings S_i (1 \\leq i \\leq H).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the maximum possible number of squares lighted by the lamp.\n\nSample Input 1\n\n4 6\n#..#..\n.....#\n....#.\n#.#...\n\nSample Output 1\n\n8\n\nIf Snuke places the lamp on the square at the second row from the top and the second column from the left, it will light the following squares: the first through fifth squares from the left in the second row, and the first through fourth squares from the top in the second column, for a total of eight squares.\n\nSample Input 2\n\n8 8\n..#...#.\n....#...\n##......\n..###..#\n...#..#.\n##....#.\n#...#...\n###.#..#\n\nSample Output 2\n\n13", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1008, "cpu_time_ms": 377, "memory_kb": 139592}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s741910513", "group_id": "codeNet:p03016", "input_text": "package main\nimport (\n \"fmt\"\n \"strconv\"\n)\nvar mod int64\nfunc main() {\n var l,a,b,m int64\n fmt.Scan(&l,&a,&b,&m)\n mod = m\n c := make([]int64,19)\n t := int64(1)\n k := len(strconv.FormatInt(a,10))\n for d:=0;d= a+b*(l-1) { c[d] = l;break }\n c[d] = (t-a-1)/b+1\n t *= 10\n }\n for d:=18;d>0;d-- {\n if c[d] > 0 { c[d] -= c[d-1] }\n }\n t = 1\n y := Identity(3)\n for d:=1;d<19;d++ {\n t = (10*t)%mod\n z := NewMatrix(3)\n z[0].v[0] = t\n z[1].v[0] = 1\n z[1].v[1] = 1\n z[2].v[1] = b\n z[2].v[2] = 1\n y = y.MatMul(z.Pow(c[d]))\n }\n x := Vector{[]int64{0,a,1}}\n fmt.Println(x.DotProduct(y.ColVec(0)))\n}\ntype Vector struct { v []int64 }\nfunc(x Vector) DotProduct(y Vector) int64 {\n if len(x.v) != len(y.v) || len(x.v) == 0 { return 0 }\n d := (x.v[0]*y.v[0])%mod\n for i:=1;i= len(a[0].v) { return Vector{nil} }\n v := make([]int64,len(a))\n for i:=0;i= a+b*(l-1) { c[d] = l;break }\n c[d] = (t-a-1)/b+1\n t *= 10\n }\n for d:=18;d>0;d-- {\n if c[d] > 0 { c[d] -= c[d-1] }\n }\n t = 1\n y := Identity(3)\n for d:=1;d<19;d++ {\n t = (10*t)%mod\n z := NewMatrix(3)\n z[0].v[0] = t\n z[1].v[0] = 1\n z[1].v[1] = 1\n z[2].v[1] = b\n z[2].v[2] = 1\n y = y.MatMul(z.Pow(c[d]))\n }\n x := Vector{[]int64{0,a,1}}\n fmt.Println(x.DotProduct(y.ColVec(0)))\n}\ntype Vector struct { v []int64 }\nfunc(x Vector) DotProduct(y Vector) int64 {\n if len(x.v) != len(y.v) || len(x.v) == 0 { return 0 }\n d := (x.v[0]*y.v[0])%mod\n for i:=1;i= len(a[0].v) { return Vector{nil} }\n v := make([]int64,len(a))\n for i:=0;i C\n\tpreBlock := false\n\tfor i := A; i <= C; i++ {\n\t\tif S[i] == '#' {\n\t\t\tif preBlock {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tpreBlock = S[i] == '#'\n\t}\n\n\t// B -> D\n\tpreBlock = false\n\tfor i := B; i <= D; i++ {\n\t\tif S[i] == '#' {\n\t\t\tif preBlock {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tpreBlock = S[i] == '#'\n\t}\n\n\tif C < D {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\n\t// B -> D\n\tseq := 0\n\tfor i := B - 1; i <= D+1; i++ {\n\t\tif S[i] == '.' {\n\t\t\tseq++\n\t\t\tif seq >= 3 {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tseq = 0\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1594086273, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03017/input.txt", "sample_output_relpath": "derived/input_output/data/p03017/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03017/Go/s528629355.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s528629355", "user_id": "u328656362"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\t_, A, B, C, D := ReadInt(), ReadInt()-1, ReadInt()-1, ReadInt()-1, ReadInt()-1\n\tS := ReadString()\n\n\t// A -> C\n\tpreBlock := false\n\tfor i := A; i <= C; i++ {\n\t\tif S[i] == '#' {\n\t\t\tif preBlock {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tpreBlock = S[i] == '#'\n\t}\n\n\t// B -> D\n\tpreBlock = false\n\tfor i := B; i <= D; i++ {\n\t\tif S[i] == '#' {\n\t\t\tif preBlock {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tpreBlock = S[i] == '#'\n\t}\n\n\tif C < D {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\n\t// B -> D\n\tseq := 0\n\tfor i := B - 1; i <= D+1; i++ {\n\t\tif S[i] == '.' {\n\t\t\tseq++\n\t\t\tif seq >= 3 {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tseq = 0\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1069, "cpu_time_ms": 19, "memory_kb": 2952}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s326816130", "group_id": "codeNet:p03017", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc check1(f, t, n int, s string) bool {\n\tfor i := f + 1; i <= t; i++ {\n\t\tif s[i] == '#' && s[i-1] == '#' {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc check2(b, d int, s string) bool {\n\tif b == 0 {\n\t\tb++\n\t}\n\tif d == len(s)-1 {\n\t\td--\n\t}\n\tfor i := b; i <= d; i++ {\n\t\tif s[i-1] == '.' && s[i] == '.' && s[i+1] == '.' {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, A, B, C, D := getInt(), getInt()-1, getInt()-1,\n\t\tgetInt()-1, getInt()-1\n\ts := getString()\n\n\tans := true\n\tif s[C] == '#' || s[D] == '#' {\n\t\tans = false\n\t}\n\tret := check1(A, C, N, s)\n\tans = ans && ret\n\n\tret = check1(B, D, N, s)\n\tans = ans && ret\n\n\tif C > D {\n\t\tret = check2(B, D, s)\n\t\tans = ans && ret\n\t}\n\tif ans {\n\t\tout(\"Yes\")\n\t} else {\n\t\tout(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586307659, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03017/input.txt", "sample_output_relpath": "derived/input_output/data/p03017/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03017/Go/s326816130.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s326816130", "user_id": "u814575783"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc check1(f, t, n int, s string) bool {\n\tfor i := f + 1; i <= t; i++ {\n\t\tif s[i] == '#' && s[i-1] == '#' {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc check2(b, d int, s string) bool {\n\tif b == 0 {\n\t\tb++\n\t}\n\tif d == len(s)-1 {\n\t\td--\n\t}\n\tfor i := b; i <= d; i++ {\n\t\tif s[i-1] == '.' && s[i] == '.' && s[i+1] == '.' {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, A, B, C, D := getInt(), getInt()-1, getInt()-1,\n\t\tgetInt()-1, getInt()-1\n\ts := getString()\n\n\tans := true\n\tif s[C] == '#' || s[D] == '#' {\n\t\tans = false\n\t}\n\tret := check1(A, C, N, s)\n\tans = ans && ret\n\n\tret = check1(B, D, N, s)\n\tans = ans && ret\n\n\tif C > D {\n\t\tret = check2(B, D, s)\n\t\tans = ans && ret\n\t}\n\tif ans {\n\t\tout(\"Yes\")\n\t} else {\n\t\tout(\"No\")\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1404, "cpu_time_ms": 10, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s469169466", "group_id": "codeNet:p03017", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c, d int\n\tvar s string\n\tfmt.Scan(&n, &a, &b, &c, &d, &s)\n\ta--\n\tb--\n\tc--\n\td--\n\tif c < d {\n\t\tfor {\n\t\t\tif b+1 == d || b+2 == d {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[b+1] == '.' {\n\t\t\t\tb++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[b+2] == '.' {\n\t\t\t\tb += 2\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tfor {\n\t\t\tif a+1 == c || a+2 == c {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[a+1] == '.' {\n\t\t\t\ta++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[a+2] == '.' {\n\t\t\t\ta += 2\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfor {\n\t\tno := true\n\t\tfor a != c {\n\t\t\tif s[a+1] == '.' && a+1 != b {\n\t\t\t\ta++\n\t\t\t\tno = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[a+2] == '.' && a+2 != b {\n\t\t\t\ta += 2\n\t\t\t\tno = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tfor {\n\t\t\tif b == d {\n\t\t\t\tif a == c {\n\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[b+1] == '.' && b+1 != a {\n\t\t\t\tb++\n\t\t\t\tno = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[b+2] == '.' && b+2 != a {\n\t\t\t\tb += 2\n\t\t\t\tno = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif a > c || b > d {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif no {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1559525614, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03017/input.txt", "sample_output_relpath": "derived/input_output/data/p03017/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03017/Go/s469169466.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s469169466", "user_id": "u375977529"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c, d int\n\tvar s string\n\tfmt.Scan(&n, &a, &b, &c, &d, &s)\n\ta--\n\tb--\n\tc--\n\td--\n\tif c < d {\n\t\tfor {\n\t\t\tif b+1 == d || b+2 == d {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[b+1] == '.' {\n\t\t\t\tb++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[b+2] == '.' {\n\t\t\t\tb += 2\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tfor {\n\t\t\tif a+1 == c || a+2 == c {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[a+1] == '.' {\n\t\t\t\ta++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[a+2] == '.' {\n\t\t\t\ta += 2\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfor {\n\t\tno := true\n\t\tfor a != c {\n\t\t\tif s[a+1] == '.' && a+1 != b {\n\t\t\t\ta++\n\t\t\t\tno = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[a+2] == '.' && a+2 != b {\n\t\t\t\ta += 2\n\t\t\t\tno = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tfor {\n\t\t\tif b == d {\n\t\t\t\tif a == c {\n\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[b+1] == '.' && b+1 != a {\n\t\t\t\tb++\n\t\t\t\tno = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s[b+2] == '.' && b+2 != a {\n\t\t\t\tb += 2\n\t\t\t\tno = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif a > c || b > d {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif no {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1105, "cpu_time_ms": 2107, "memory_kb": 1664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s707579033", "group_id": "codeNet:p03024", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\tresults := strings.Split(str, \"\")\n\twinCount := 0\n\tfor _, result := range results {\n\t\tif result == \"o\" {\n\t\t\twinCount++\n\t\t}\n\t}\n\n\tif winCount + 15 - len(results) >= 8 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "language": "Go", "metadata": {"date": 1559439320, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03024.html", "problem_id": "p03024", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03024/input.txt", "sample_output_relpath": "derived/input_output/data/p03024/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03024/Go/s707579033.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s707579033", "user_id": "u717943620"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\tresults := strings.Split(str, \"\")\n\twinCount := 0\n\tfor _, result := range results {\n\t\tif result == \"o\" {\n\t\t\twinCount++\n\t\t}\n\t}\n\n\tif winCount + 15 - len(results) >= 8 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "sample_input": "oxoxoxoxoxoxox\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03024", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 312, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s906029244", "group_id": "codeNet:p03026", "input_text": "package main\n\nimport (\n\t\"container/heap\"\n\t\"sort\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tn := scanInt()\n\n\tt := make([][]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta := scanInt()-1\n\t\tb := scanInt()-1\n\t\tt[a] = append(t[a], b)\n\t\tt[b] = append(t[b], a)\n\t}\n\n\tc := scanInts(n)\n\tsort.Ints(c)\n\n\tcnt := &verts{}\n\theap.Init(cnt)\n\tec := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tec[i] = len(t[i])\n\t\theap.Push(cnt, vert{i,ec[i]})\n\t}\n\n\tdone := make([]bool, n)\n\td := make([]int, n)\n\tm := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tnext := -1\n\t\tfor cnt.Len() != 0 {\n\t\t\tv := heap.Pop(cnt).(vert)\n\t\t\tif !done[v.num] {\n\t\t\t\tnext = v.num\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\td[next] = c[i]\n\t\tdone[next] = true\n\t\tm += c[i]*ec[next]\n\n\t\tfor _, e := range t[next] {\n\t\t\tec[e]--\n\t\t\theap.Push(cnt, vert{e, ec[e]})\n\t\t}\n\t}\n\n\tfmt.Println(m)\n\n\tfor i, e := range d {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(d)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\ntype vert struct {\n\tnum int\n\tcnt int\n}\n\ntype verts []vert\n\nfunc (a verts) Len() int { return len(a) }\nfunc (a verts) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a verts) Less(i, j int) bool { return a[i].cnt < a[j].cnt }\n\nfunc (a *verts) Push(x interface{}) {\n\t*a = append(*a, x.(vert))\n}\n\nfunc (a *verts) Pop() interface{} {\n\told := *a\n\tn := len(old)\n\tx := old[n-1]\n\t*a = old[0:n-1]\n\n\treturn x\n}", "language": "Go", "metadata": {"date": 1581408561, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03026.html", "problem_id": "p03026", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03026/input.txt", "sample_output_relpath": "derived/input_output/data/p03026/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03026/Go/s906029244.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s906029244", "user_id": "u548992197"}, "prompt_components": {"gold_output": "10\n1 2 3 4 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"container/heap\"\n\t\"sort\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tn := scanInt()\n\n\tt := make([][]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta := scanInt()-1\n\t\tb := scanInt()-1\n\t\tt[a] = append(t[a], b)\n\t\tt[b] = append(t[b], a)\n\t}\n\n\tc := scanInts(n)\n\tsort.Ints(c)\n\n\tcnt := &verts{}\n\theap.Init(cnt)\n\tec := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tec[i] = len(t[i])\n\t\theap.Push(cnt, vert{i,ec[i]})\n\t}\n\n\tdone := make([]bool, n)\n\td := make([]int, n)\n\tm := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tnext := -1\n\t\tfor cnt.Len() != 0 {\n\t\t\tv := heap.Pop(cnt).(vert)\n\t\t\tif !done[v.num] {\n\t\t\t\tnext = v.num\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\td[next] = c[i]\n\t\tdone[next] = true\n\t\tm += c[i]*ec[next]\n\n\t\tfor _, e := range t[next] {\n\t\t\tec[e]--\n\t\t\theap.Push(cnt, vert{e, ec[e]})\n\t\t}\n\t}\n\n\tfmt.Println(m)\n\n\tfor i, e := range d {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(d)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\ntype vert struct {\n\tnum int\n\tcnt int\n}\n\ntype verts []vert\n\nfunc (a verts) Len() int { return len(a) }\nfunc (a verts) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a verts) Less(i, j int) bool { return a[i].cnt < a[j].cnt }\n\nfunc (a *verts) Push(x interface{}) {\n\t*a = append(*a, x.(vert))\n}\n\nfunc (a *verts) Pop() interface{} {\n\told := *a\n\tn := len(old)\n\tx := old[n-1]\n\t*a = old[0:n-1]\n\n\treturn x\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a tree with N vertices 1,2,\\ldots,N, and positive integers c_1,c_2,\\ldots,c_N.\nThe i-th edge in the tree (1 \\leq i \\leq N-1) connects Vertex a_i and Vertex b_i.\n\nWe will write a positive integer on each vertex in T and calculate our score as follows:\n\nOn each edge, write the smaller of the integers written on the two endpoints.\n\nLet our score be the sum of the integers written on all the edges.\n\nFind the maximum possible score when we write each of c_1,c_2,\\ldots,c_N on one vertex in T, and show one way to achieve it. If an integer occurs multiple times in c_1,c_2,\\ldots,c_N, we must use it that number of times.\n\nConstraints\n\n1 \\leq N \\leq 10000\n\n1 \\leq a_i,b_i \\leq N\n\n1 \\leq c_i \\leq 10^5\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nc_1 \\ldots c_N\n\nOutput\n\nUse the following format:\n\nM\nd_1 \\ldots d_N\n\nwhere M is the maximum possible score, and d_i is the integer to write on Vertex i.\nd_1,d_2,\\ldots,d_N must be a permutation of c_1,c_2,\\ldots,c_N.\nIf there are multiple ways to achieve the maximum score, any of them will be accepted.\n\nSample Input 1\n\n5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n\nSample Output 1\n\n10\n1 2 3 4 5\n\nIf we write 1,2,3,4,5 on Vertex 1,2,3,4,5, respectively, the integers written on the four edges will be 1,2,3,4, for the score of 10. This is the maximum possible score.\n\nSample Input 2\n\n5\n1 2\n1 3\n1 4\n1 5\n3141 59 26 53 59\n\nSample Output 2\n\n197\n59 26 3141 59 53\n\nc_1,c_2,\\ldots,c_N may not be pairwise distinct.", "sample_input": "5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n"}, "reference_outputs": ["10\n1 2 3 4 5\n"], "source_document_id": "p03026", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a tree with N vertices 1,2,\\ldots,N, and positive integers c_1,c_2,\\ldots,c_N.\nThe i-th edge in the tree (1 \\leq i \\leq N-1) connects Vertex a_i and Vertex b_i.\n\nWe will write a positive integer on each vertex in T and calculate our score as follows:\n\nOn each edge, write the smaller of the integers written on the two endpoints.\n\nLet our score be the sum of the integers written on all the edges.\n\nFind the maximum possible score when we write each of c_1,c_2,\\ldots,c_N on one vertex in T, and show one way to achieve it. If an integer occurs multiple times in c_1,c_2,\\ldots,c_N, we must use it that number of times.\n\nConstraints\n\n1 \\leq N \\leq 10000\n\n1 \\leq a_i,b_i \\leq N\n\n1 \\leq c_i \\leq 10^5\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nc_1 \\ldots c_N\n\nOutput\n\nUse the following format:\n\nM\nd_1 \\ldots d_N\n\nwhere M is the maximum possible score, and d_i is the integer to write on Vertex i.\nd_1,d_2,\\ldots,d_N must be a permutation of c_1,c_2,\\ldots,c_N.\nIf there are multiple ways to achieve the maximum score, any of them will be accepted.\n\nSample Input 1\n\n5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n\nSample Output 1\n\n10\n1 2 3 4 5\n\nIf we write 1,2,3,4,5 on Vertex 1,2,3,4,5, respectively, the integers written on the four edges will be 1,2,3,4, for the score of 10. This is the maximum possible score.\n\nSample Input 2\n\n5\n1 2\n1 3\n1 4\n1 5\n3141 59 26 53 59\n\nSample Output 2\n\n197\n59 26 3141 59 53\n\nc_1,c_2,\\ldots,c_N may not be pairwise distinct.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2114, "cpu_time_ms": 27, "memory_kb": 4480}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s793679996", "group_id": "codeNet:p03027", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tmod = int64(1000003)\n)\n\nfunc pow(x, y int64) int64 {\n\tif y == 0 {\n\t\treturn 1\n\t}\n\tif y == 1 {\n\t\treturn x\n\t}\n\tif y%2 == 0 {\n\t\tx2 := x * x % mod\n\t\treturn pow(x2, y/2) % mod\n\t}\n\treturn x * pow(x, y-1) % mod\n}\n\nfunc divide(x, y int64) int64 {\n\treturn x * pow(y, mod-2) % mod\n}\n\nfunc main() {\n\tvar q int\n\tfmt.Scan(&q)\n\n\tfactorial := make([]int64, mod)\n\tfactorial[0] = 1\n\tfor i := int64(1); i < mod; i++ {\n\t\tfactorial[i] = factorial[i-1] * i % mod\n\t}\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\txi, _ := strconv.Atoi(scanner.Text())\n\t\tx := int64(xi)\n\t\tscanner.Scan()\n\t\tdi, _ := strconv.Atoi(scanner.Text())\n\t\td := int64(di)\n\t\tscanner.Scan()\n\t\tni, _ := strconv.Atoi(scanner.Text())\n\t\tn := int64(ni)\n\n\t\tif d == 0 {\n\t\t\tfmt.Println(pow(x, n))\n\t\t\tbreak\n\t\t}\n\t\t\n\t\txdd := divide(x, d)\n\t\tret := int64(1)\n\t\tfor j := xdd; j < xdd+n; j++ {\n\t\t\tif j%mod == 0 {\n\t\t\t\tfmt.Println(0)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tret = ret * j % mod\n\t\t}\n\t\tret = divide(factorial[xdd+n-1], factorial[xdd-1]) % mod\n\t\tret = ret * pow(d, n) % mod\n\t\tfmt.Println(ret)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1559487987, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03027.html", "problem_id": "p03027", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03027/input.txt", "sample_output_relpath": "derived/input_output/data/p03027/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03027/Go/s793679996.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s793679996", "user_id": "u836866227"}, "prompt_components": {"gold_output": "9009\n916936\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tmod = int64(1000003)\n)\n\nfunc pow(x, y int64) int64 {\n\tif y == 0 {\n\t\treturn 1\n\t}\n\tif y == 1 {\n\t\treturn x\n\t}\n\tif y%2 == 0 {\n\t\tx2 := x * x % mod\n\t\treturn pow(x2, y/2) % mod\n\t}\n\treturn x * pow(x, y-1) % mod\n}\n\nfunc divide(x, y int64) int64 {\n\treturn x * pow(y, mod-2) % mod\n}\n\nfunc main() {\n\tvar q int\n\tfmt.Scan(&q)\n\n\tfactorial := make([]int64, mod)\n\tfactorial[0] = 1\n\tfor i := int64(1); i < mod; i++ {\n\t\tfactorial[i] = factorial[i-1] * i % mod\n\t}\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\txi, _ := strconv.Atoi(scanner.Text())\n\t\tx := int64(xi)\n\t\tscanner.Scan()\n\t\tdi, _ := strconv.Atoi(scanner.Text())\n\t\td := int64(di)\n\t\tscanner.Scan()\n\t\tni, _ := strconv.Atoi(scanner.Text())\n\t\tn := int64(ni)\n\n\t\tif d == 0 {\n\t\t\tfmt.Println(pow(x, n))\n\t\t\tbreak\n\t\t}\n\t\t\n\t\txdd := divide(x, d)\n\t\tret := int64(1)\n\t\tfor j := xdd; j < xdd+n; j++ {\n\t\t\tif j%mod == 0 {\n\t\t\t\tfmt.Println(0)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tret = ret * j % mod\n\t\t}\n\t\tret = divide(factorial[xdd+n-1], factorial[xdd-1]) % mod\n\t\tret = ret * pow(d, n) % mod\n\t\tfmt.Println(ret)\n\t}\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nConsider the following arithmetic progression with n terms:\n\nx, x + d, x + 2d, \\ldots, x + (n-1)d\n\nWhat is the product of all terms in this sequence?\nCompute the answer modulo 1\\ 000\\ 003.\n\nYou are given Q queries of this form.\nIn the i-th query, compute the answer in case x = x_i, d = d_i, n = n_i.\n\nConstraints\n\n1 \\leq Q \\leq 10^5\n\n0 \\leq x_i, d_i \\leq 1\\ 000\\ 002\n\n1 \\leq n_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nx_1 d_1 n_1\n:\nx_Q d_Q n_Q\n\nOutput\n\nPrint Q lines.\n\nIn the i-th line, print the answer for the i-th query.\n\nSample Input 1\n\n2\n7 2 4\n12345 67890 2019\n\nSample Output 1\n\n9009\n916936\n\nFor the first query, the answer is 7 \\times 9 \\times 11 \\times 13 = 9009.\nDon't forget to compute the answer modulo 1\\ 000\\ 003.", "sample_input": "2\n7 2 4\n12345 67890 2019\n"}, "reference_outputs": ["9009\n916936\n"], "source_document_id": "p03027", "source_text": "Score : 600 points\n\nProblem Statement\n\nConsider the following arithmetic progression with n terms:\n\nx, x + d, x + 2d, \\ldots, x + (n-1)d\n\nWhat is the product of all terms in this sequence?\nCompute the answer modulo 1\\ 000\\ 003.\n\nYou are given Q queries of this form.\nIn the i-th query, compute the answer in case x = x_i, d = d_i, n = n_i.\n\nConstraints\n\n1 \\leq Q \\leq 10^5\n\n0 \\leq x_i, d_i \\leq 1\\ 000\\ 002\n\n1 \\leq n_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nx_1 d_1 n_1\n:\nx_Q d_Q n_Q\n\nOutput\n\nPrint Q lines.\n\nIn the i-th line, print the answer for the i-th query.\n\nSample Input 1\n\n2\n7 2 4\n12345 67890 2019\n\nSample Output 1\n\n9009\n916936\n\nFor the first query, the answer is 7 \\times 9 \\times 11 \\times 13 = 9009.\nDon't forget to compute the answer modulo 1\\ 000\\ 003.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1156, "cpu_time_ms": 34, "memory_kb": 8704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s888808883", "group_id": "codeNet:p03029", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc main() {\n\ta, p := nextInt(), nextInt()\n\tp += a * 3\n\tpie := p / 2\n\tfmt.Println(pie)\n}\n", "language": "Go", "metadata": {"date": 1572840896, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03029.html", "problem_id": "p03029", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03029/input.txt", "sample_output_relpath": "derived/input_output/data/p03029/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03029/Go/s888808883.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s888808883", "user_id": "u727347518"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc main() {\n\ta, p := nextInt(), nextInt()\n\tp += a * 3\n\tpie := p / 2\n\tfmt.Println(pie)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have A apples and P pieces of apple.\n\nWe can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.\n\nFind the maximum number of apple pies we can make with what we have now.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, P \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA P\n\nOutput\n\nPrint the maximum number of apple pies we can make with what we have.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n3\n\nWe can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.\n\nSample Input 2\n\n0 1\n\nSample Output 2\n\n0\n\nWe cannot make an apple pie in this case, unfortunately.\n\nSample Input 3\n\n32 21\n\nSample Output 3\n\n58", "sample_input": "1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03029", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A apples and P pieces of apple.\n\nWe can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.\n\nFind the maximum number of apple pies we can make with what we have now.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, P \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA P\n\nOutput\n\nPrint the maximum number of apple pies we can make with what we have.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n3\n\nWe can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.\n\nSample Input 2\n\n0 1\n\nSample Output 2\n\n0\n\nWe cannot make an apple pie in this case, unfortunately.\n\nSample Input 3\n\n32 21\n\nSample Output 3\n\n58", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 380, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s576275751", "group_id": "codeNet:p03030", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 1000000007\n\n// 1MB\nconst ioBufferSize = 1 * 1024 * 1024\n\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype Restaurant struct {\n\tCity string\n\tScore int\n\tIndex int\n}\n\ntype Restaurants []Restaurant\n\nfunc (r Restaurants) Len() int {\n\treturn len(r)\n}\n\nfunc (r Restaurants) Less(i, j int) bool {\n\tif r[i].City != r[j].City {\n\t\treturn r[i].City < r[j].City\n\t} else {\n\t\treturn r[i].Score > r[j].Score\n\t}\n}\n\nfunc (r Restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tn := nextInt()\n\tr := make([]Restaurant, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = Restaurant{\n\t\t\tnext(), nextInt(), i,\n\t\t}\n\t}\n\n\tsort.Sort(Restaurants(r))\n\n\tfor _, res := range r {\n\t\tfmt.Println(res.Index + 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592197121, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03030.html", "problem_id": "p03030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03030/input.txt", "sample_output_relpath": "derived/input_output/data/p03030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03030/Go/s576275751.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s576275751", "user_id": "u703739962"}, "prompt_components": {"gold_output": "3\n4\n6\n1\n5\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst mod = 1000000007\n\n// 1MB\nconst ioBufferSize = 1 * 1024 * 1024\n\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype Restaurant struct {\n\tCity string\n\tScore int\n\tIndex int\n}\n\ntype Restaurants []Restaurant\n\nfunc (r Restaurants) Len() int {\n\treturn len(r)\n}\n\nfunc (r Restaurants) Less(i, j int) bool {\n\tif r[i].City != r[j].City {\n\t\treturn r[i].City < r[j].City\n\t} else {\n\t\treturn r[i].Score > r[j].Score\n\t}\n}\n\nfunc (r Restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tn := nextInt()\n\tr := make([]Restaurant, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = Restaurant{\n\t\t\tnext(), nextInt(), i,\n\t\t}\n\t}\n\n\tsort.Sort(Restaurants(r))\n\n\tfor _, res := range r {\n\t\tfmt.Println(res.Index + 1)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "sample_input": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n"}, "reference_outputs": ["3\n4\n6\n1\n5\n2\n"], "source_document_id": "p03030", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1049, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s502613343", "group_id": "codeNet:p03030", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tiv, _ := strconv.Atoi(scanString())\n\treturn iv\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 100001), 100001*100)\n}\n\nfunc main() {\n\tn := scanInt()\n\ttype restaurant struct {\n\t\tn string\n\t\tp, i int\n\t}\n\trs := make([]restaurant, n)\n\tfor i := 0; i < n; i++ {\n\t\trs[i].i = i + 1\n\t\trs[i].n, rs[i].p = scanString(), scanInt()\n\t}\n\n\tsort.Slice(rs, func(i, j int) bool {\n\t\tif rs[i].n == rs[j].n {\n\t\t\treturn rs[i].p > rs[j].p\n\t\t}\n\t\treturn rs[i].n < rs[j].n\n\t})\n\n\tvar wr = bufio.NewWriter(os.Stdout)\n\tfor _, v := range rs {\n\t\twr.WriteString(strconv.Itoa(v.i) + \"\\n\")\n\t}\n\twr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1589446947, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03030.html", "problem_id": "p03030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03030/input.txt", "sample_output_relpath": "derived/input_output/data/p03030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03030/Go/s502613343.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s502613343", "user_id": "u461993794"}, "prompt_components": {"gold_output": "3\n4\n6\n1\n5\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tiv, _ := strconv.Atoi(scanString())\n\treturn iv\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 100001), 100001*100)\n}\n\nfunc main() {\n\tn := scanInt()\n\ttype restaurant struct {\n\t\tn string\n\t\tp, i int\n\t}\n\trs := make([]restaurant, n)\n\tfor i := 0; i < n; i++ {\n\t\trs[i].i = i + 1\n\t\trs[i].n, rs[i].p = scanString(), scanInt()\n\t}\n\n\tsort.Slice(rs, func(i, j int) bool {\n\t\tif rs[i].n == rs[j].n {\n\t\t\treturn rs[i].p > rs[j].p\n\t\t}\n\t\treturn rs[i].n < rs[j].n\n\t})\n\n\tvar wr = bufio.NewWriter(os.Stdout)\n\tfor _, v := range rs {\n\t\twr.WriteString(strconv.Itoa(v.i) + \"\\n\")\n\t}\n\twr.Flush()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "sample_input": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n"}, "reference_outputs": ["3\n4\n6\n1\n5\n2\n"], "source_document_id": "p03030", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 772, "cpu_time_ms": 3, "memory_kb": 1504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s078497551", "group_id": "codeNet:p03030", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Restaurant struct {\n\tidx int\n\tcity string\n\tpoint int\n}\n\ntype Restaurants []Restaurant\n\nfunc (p Restaurants) Len() int {\n\treturn len(p)\n}\n\nfunc (p Restaurants) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Restaurants) Less(i, j int) bool {\n\tif p[i].city != p[j].city {\n\t\treturn p[i].city < p[j].city\n\t} else {\n\t\treturn p[j].point < p[i].point\n\t}\n}\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\tres := make(Restaurants, 0, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar city string\n\t\tvar point int\n\t\tfmt.Scan(&city, &point)\n\n\t\tres = append(res, Restaurant{idx: i+1, city: city, point:point})\n\t}\n\n\tsort.Sort(res)\n\tfor _, v := range res {\n\t\tfmt.Println(v.idx)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558920417, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03030.html", "problem_id": "p03030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03030/input.txt", "sample_output_relpath": "derived/input_output/data/p03030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03030/Go/s078497551.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s078497551", "user_id": "u425059542"}, "prompt_components": {"gold_output": "3\n4\n6\n1\n5\n2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Restaurant struct {\n\tidx int\n\tcity string\n\tpoint int\n}\n\ntype Restaurants []Restaurant\n\nfunc (p Restaurants) Len() int {\n\treturn len(p)\n}\n\nfunc (p Restaurants) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Restaurants) Less(i, j int) bool {\n\tif p[i].city != p[j].city {\n\t\treturn p[i].city < p[j].city\n\t} else {\n\t\treturn p[j].point < p[i].point\n\t}\n}\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\tres := make(Restaurants, 0, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar city string\n\t\tvar point int\n\t\tfmt.Scan(&city, &point)\n\n\t\tres = append(res, Restaurant{idx: i+1, city: city, point:point})\n\t}\n\n\tsort.Sort(res)\n\tfor _, v := range res {\n\t\tfmt.Println(v.idx)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "sample_input": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n"}, "reference_outputs": ["3\n4\n6\n1\n5\n2\n"], "source_document_id": "p03030", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 702, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s343246588", "group_id": "codeNet:p03032", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tconst maxWord = (1 << 30)\n\tbuf := []byte{}\n\tsc.Buffer(buf, maxWord)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc input() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc solve(n, k int, v []int) int {\n\tr := min(n, k)\n\tans := 0\n\tfor a := 0; a <= r; a++ {\n\t\tfor b := 0; b <= r-a; b++ {\n\t\t\tselected := make([]int, 0, r)\n\t\t\tfor i := 0; i < a; i++ {\n\t\t\t\tselected = append(selected, v[i])\n\t\t\t}\n\t\t\tfor i := n - 1; i >= n-b; i-- {\n\t\t\t\tselected = append(selected, v[i])\n\t\t\t}\n\n\t\t\tsort.Ints(selected)\n\t\t\tlimit := min(len(selected), k-(a+b))\n\t\t\tfor i := 0; i < limit; i++ {\n\t\t\t\tif selected[i] >= 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tselected[i] = 0\n\t\t\t}\n\n\t\t\tsum := 0\n\t\t\tfor _, num := range selected {\n\t\t\t\tsum += num\n\t\t\t}\n\t\t\tans = max(ans, sum)\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tn, _ := strconv.Atoi(input())\n\tk, _ := strconv.Atoi(input())\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv[i], _ = strconv.Atoi(input())\n\t}\n\tfmt.Println(solve(n, k, v))\n}\n", "language": "Go", "metadata": {"date": 1598726768, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03032.html", "problem_id": "p03032", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03032/input.txt", "sample_output_relpath": "derived/input_output/data/p03032/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03032/Go/s343246588.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s343246588", "user_id": "u029315034"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tconst maxWord = (1 << 30)\n\tbuf := []byte{}\n\tsc.Buffer(buf, maxWord)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc input() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc solve(n, k int, v []int) int {\n\tr := min(n, k)\n\tans := 0\n\tfor a := 0; a <= r; a++ {\n\t\tfor b := 0; b <= r-a; b++ {\n\t\t\tselected := make([]int, 0, r)\n\t\t\tfor i := 0; i < a; i++ {\n\t\t\t\tselected = append(selected, v[i])\n\t\t\t}\n\t\t\tfor i := n - 1; i >= n-b; i-- {\n\t\t\t\tselected = append(selected, v[i])\n\t\t\t}\n\n\t\t\tsort.Ints(selected)\n\t\t\tlimit := min(len(selected), k-(a+b))\n\t\t\tfor i := 0; i < limit; i++ {\n\t\t\t\tif selected[i] >= 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tselected[i] = 0\n\t\t\t}\n\n\t\t\tsum := 0\n\t\t\tfor _, num := range selected {\n\t\t\t\tsum += num\n\t\t\t}\n\t\t\tans = max(ans, sum)\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tn, _ := strconv.Atoi(input())\n\tk, _ := strconv.Atoi(input())\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv[i], _ = strconv.Atoi(input())\n\t}\n\tfmt.Println(solve(n, k, v))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "sample_input": "6 4\n-10 8 2 1 2 6\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03032", "source_text": "Score : 400 points\n\nProblem Statement\n\nYour friend gave you a dequeue D as a birthday present.\n\nD is a horizontal cylinder that contains a row of N jewels.\n\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values.\n\nIn the beginning, you have no jewel in your hands.\n\nYou can perform at most K operations on D, chosen from the following, at most K times (possibly zero):\n\nOperation A: Take out the leftmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation B: Take out the rightmost jewel contained in D and have it in your hand. You cannot do this operation when D is empty.\n\nOperation C: Choose a jewel in your hands and insert it to the left end of D. You cannot do this operation when you have no jewel in your hand.\n\nOperation D: Choose a jewel in your hands and insert it to the right end of D. You cannot do this operation when you have no jewel in your hand.\n\nFind the maximum possible sum of the values of jewels in your hands after the operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 100\n\n-10^7 \\leq V_i \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nV_1 V_2 ... V_N\n\nOutput\n\nPrint the maximum possible sum of the values of jewels in your hands after the operations.\n\nSample Input 1\n\n6 4\n-10 8 2 1 2 6\n\nSample Output 1\n\n14\n\nAfter the following sequence of operations, you have two jewels of values 8 and 6 in your hands for a total of 14, which is the maximum result.\n\nDo operation A. You take out the jewel of value -10 from the left end of D.\n\nDo operation B. You take out the jewel of value 6 from the right end of D.\n\nDo operation A. You take out the jewel of value 8 from the left end of D.\n\nDo operation D. You insert the jewel of value -10 to the right end of D.\n\nSample Input 2\n\n6 4\n-6 -100 50 -2 -5 -3\n\nSample Output 2\n\n44\n\nSample Input 3\n\n6 3\n-6 -100 50 -2 -5 -3\n\nSample Output 3\n\n0\n\nIt is optimal to do no operation.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1167, "cpu_time_ms": 8, "memory_kb": 2400}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218327607", "group_id": "codeNet:p03035", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n switch {\n case a>12:\n case a>5:\n b/=2\n default:\n b=0\n }\n fmt.Println(b)\n}\n", "language": "Go", "metadata": {"date": 1559088360, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03035.html", "problem_id": "p03035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03035/input.txt", "sample_output_relpath": "derived/input_output/data/p03035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03035/Go/s218327607.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s218327607", "user_id": "u360765331"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n switch {\n case a>12:\n case a>5:\n b/=2\n default:\n b=0\n }\n fmt.Println(b)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "sample_input": "30 100\n"}, "reference_outputs": ["100\n"], "source_document_id": "p03035", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 187, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s105919544", "group_id": "codeNet:p03035", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tA := io.NextInt()\n\tB := io.NextInt()\n\n\tif A >= 13 {\n\t\tio.PrintLn(B)\n\t} else if A >= 6 {\n\t\tio.PrintLn(B / 2)\n\t} else {\n\t\tio.PrintLn(0)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558832532, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03035.html", "problem_id": "p03035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03035/input.txt", "sample_output_relpath": "derived/input_output/data/p03035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03035/Go/s105919544.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s105919544", "user_id": "u272266919"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tA := io.NextInt()\n\tB := io.NextInt()\n\n\tif A >= 13 {\n\t\tio.PrintLn(B)\n\t} else if A >= 6 {\n\t\tio.PrintLn(B / 2)\n\t} else {\n\t\tio.PrintLn(0)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "sample_input": "30 100\n"}, "reference_outputs": ["100\n"], "source_document_id": "p03035", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1671, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s552079683", "group_id": "codeNet:p03036", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\n\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tr := iScan()\n\td := iScan()\n\tx := iScan()\n\tfor i := 0; i < 10; i++ {\n\t\tx = r*x - d\n\t\tfmt.Println(x)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594328762, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03036.html", "problem_id": "p03036", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03036/input.txt", "sample_output_relpath": "derived/input_output/data/p03036/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03036/Go/s552079683.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s552079683", "user_id": "u843722521"}, "prompt_components": {"gold_output": "30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\n\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tr := iScan()\n\td := iScan()\n\tx := iScan()\n\tfor i := 0; i < 10; i++ {\n\t\tx = r*x - d\n\t\tfmt.Println(x)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "sample_input": "2 10 20\n"}, "reference_outputs": ["30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n"], "source_document_id": "p03036", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1308, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s515614777", "group_id": "codeNet:p03037", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := scanInt()\n\tm := scanInt()\n\n\tp,q := 1,n\n\n\tfor i:=0; ir {\n\t\t\tq = r\n\t\t}\n\t}\n\n\tif q-p+1 < 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(q-p+1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1574317869, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03037/input.txt", "sample_output_relpath": "derived/input_output/data/p03037/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03037/Go/s515614777.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s515614777", "user_id": "u548992197"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := scanInt()\n\tm := scanInt()\n\n\tp,q := 1,n\n\n\tfor i:=0; ir {\n\t\t\tq = r\n\t\t}\n\t}\n\n\tif q-p+1 < 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(q-p+1)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "sample_input": "4 2\n1 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03037", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 440, "cpu_time_ms": 35, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s427178978", "group_id": "codeNet:p03037", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tN := 0\n\tM := 0\n\tfmt.Scan(&N, &M)\n\n\tLmin := 0\n\tRmax := 100001\n\n\tfor i := 0; i < M; i++ {\n\t\tL, R := 0, 0\n\t\tfmt.Scan(&L, &R)\n\t\tif L > Lmin {\n\t\t\tLmin = L\n\t\t}\n\n\t\tif R < Rmax {\n\t\t\tRmax = R\n\t\t}\n\t}\n\n\tt := Rmax - Lmin\n\tif t < 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println((Rmax - Lmin) + 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1573081921, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03037/input.txt", "sample_output_relpath": "derived/input_output/data/p03037/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03037/Go/s427178978.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s427178978", "user_id": "u053483992"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tN := 0\n\tM := 0\n\tfmt.Scan(&N, &M)\n\n\tLmin := 0\n\tRmax := 100001\n\n\tfor i := 0; i < M; i++ {\n\t\tL, R := 0, 0\n\t\tfmt.Scan(&L, &R)\n\t\tif L > Lmin {\n\t\t\tLmin = L\n\t\t}\n\n\t\tif R < Rmax {\n\t\t\tRmax = R\n\t\t}\n\t}\n\n\tt := Rmax - Lmin\n\tif t < 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println((Rmax - Lmin) + 1)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "sample_input": "4 2\n1 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03037", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 334, "cpu_time_ms": 827, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s148409650", "group_id": "codeNet:p03037", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tl := make([]int, m)\n\tr := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&l[i], &r[i])\n\t}\n\n\tvar min, max int\n\tmax = 0\n\tfor _, v := range l {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\n\tmin = 100000\n\tfor i := range r {\n\t\tif r[i] < min {\n\t\t\tmin = r[i]\n\t\t}\n\t}\n\n\tfmt.Println(min - max + 1)\n\n}\n", "language": "Go", "metadata": {"date": 1565370604, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03037/input.txt", "sample_output_relpath": "derived/input_output/data/p03037/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03037/Go/s148409650.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s148409650", "user_id": "u262602763"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tl := make([]int, m)\n\tr := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&l[i], &r[i])\n\t}\n\n\tvar min, max int\n\tmax = 0\n\tfor _, v := range l {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\n\tmin = 100000\n\tfor i := range r {\n\t\tif r[i] < min {\n\t\t\tmin = r[i]\n\t\t}\n\t}\n\n\tfmt.Println(min - max + 1)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "sample_input": "4 2\n1 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03037", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 366, "cpu_time_ms": 822, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s100455600", "group_id": "codeNet:p03038", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\ntype Heap struct {\n\tdata []int\n}\n\nfunc (h *Heap) Len() int { return len(h.data) }\nfunc (h *Heap) Less(i, j int) bool { return h.data[i] > h.data[j] }\nfunc (h *Heap) Swap(i, j int) { h.data[i], h.data[j] = h.data[j], h.data[i] }\nfunc (h *Heap) Push(i interface{}) { h.data = append(h.data, i.(int)) }\nfunc (h *Heap) Pop() interface{} {\n\ti := h.data[len(h.data)-1]\n\th.data = h.data[:len(h.data)-1]\n\treturn i\n}\n\nfunc main() {\n\tnm := scanNums(2)\n\tn, m := nm[0], nm[1]\n\tinput := scanNums(n)\n\n\tans := calc(input, n, m)\n\tfmt.Println(ans)\n\n}\n\nfunc calc(input []int, n, m int) int {\n\th := &Heap{}\n\theap.Init(h)\n\tfor _, a := range input {\n\t\theap.Push(h, a)\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb, c := oneInt(), oneInt()\n\t\tfor j := 0; j < b; j++ {\n\t\t\theap.Push(h, c)\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif m, ok := heap.Pop(h).(int); ok {\n\t\t\tsum += m\n\t\t}\n\t}\n\n\treturn sum\n}\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc scanStrings() []string {\n\tstr := readLine()\n\ts := strings.Split(str, \" \")\n\n\treturn s\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc cumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n", "language": "Go", "metadata": {"date": 1558842758, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03038.html", "problem_id": "p03038", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03038/input.txt", "sample_output_relpath": "derived/input_output/data/p03038/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03038/Go/s100455600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s100455600", "user_id": "u134387396"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\ntype Heap struct {\n\tdata []int\n}\n\nfunc (h *Heap) Len() int { return len(h.data) }\nfunc (h *Heap) Less(i, j int) bool { return h.data[i] > h.data[j] }\nfunc (h *Heap) Swap(i, j int) { h.data[i], h.data[j] = h.data[j], h.data[i] }\nfunc (h *Heap) Push(i interface{}) { h.data = append(h.data, i.(int)) }\nfunc (h *Heap) Pop() interface{} {\n\ti := h.data[len(h.data)-1]\n\th.data = h.data[:len(h.data)-1]\n\treturn i\n}\n\nfunc main() {\n\tnm := scanNums(2)\n\tn, m := nm[0], nm[1]\n\tinput := scanNums(n)\n\n\tans := calc(input, n, m)\n\tfmt.Println(ans)\n\n}\n\nfunc calc(input []int, n, m int) int {\n\th := &Heap{}\n\theap.Init(h)\n\tfor _, a := range input {\n\t\theap.Push(h, a)\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb, c := oneInt(), oneInt()\n\t\tfor j := 0; j < b; j++ {\n\t\t\theap.Push(h, c)\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif m, ok := heap.Pop(h).(int); ok {\n\t\t\tsum += m\n\t\t}\n\t}\n\n\treturn sum\n}\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc scanStrings() []string {\n\tstr := readLine()\n\ts := strings.Split(str, \" \")\n\n\treturn s\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc cumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "3 2\n5 1 4\n2 3\n1 5\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03038", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2772, "cpu_time_ms": 2111, "memory_kb": 830208}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s939783914", "group_id": "codeNet:p03038", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tvar m int\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\tsort.Ints(nums)\n\n\tvar b int\n\tvar c int\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&b)\n\t\tfmt.Scan(&c)\n\n\t\tchanged := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif nums[j] <= c {\n\t\t\t\tnums[j] = c\n\t\t\t\tchanged++\n\t\t\t}\n\t\t\tif changed == b {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tsort.Ints(nums)\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += nums[i]\n\t}\n\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1558836686, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03038.html", "problem_id": "p03038", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03038/input.txt", "sample_output_relpath": "derived/input_output/data/p03038/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03038/Go/s939783914.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s939783914", "user_id": "u433254839"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tvar m int\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\tsort.Ints(nums)\n\n\tvar b int\n\tvar c int\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&b)\n\t\tfmt.Scan(&c)\n\n\t\tchanged := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif nums[j] <= c {\n\t\t\t\tnums[j] = c\n\t\t\t\tchanged++\n\t\t\t}\n\t\t\tif changed == b {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tsort.Ints(nums)\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += nums[i]\n\t}\n\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "3 2\n5 1 4\n2 3\n1 5\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03038", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 514, "cpu_time_ms": 2107, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s536860199", "group_id": "codeNet:p03041", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, k int\n\t\ts string\n\t)\n\tfmt.Scan(&n, &k, &s)\n\tfmt.Println(s[:k-1] + strings.ToLower(s[k-1:k]) + s[k:])\n}\n", "language": "Go", "metadata": {"date": 1558320940, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03041.html", "problem_id": "p03041", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03041/input.txt", "sample_output_relpath": "derived/input_output/data/p03041/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03041/Go/s536860199.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s536860199", "user_id": "u461993794"}, "prompt_components": {"gold_output": "aBC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, k int\n\t\ts string\n\t)\n\tfmt.Scan(&n, &k, &s)\n\tfmt.Println(s[:k-1] + strings.ToLower(s[k-1:k]) + s[k:])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "sample_input": "3 1\nABC\n"}, "reference_outputs": ["aBC\n"], "source_document_id": "p03041", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 175, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s094600415", "group_id": "codeNet:p03042", "input_text": "package main\n\nimport(\n \"fmt\"\n \"strconv\"\n)\n\n\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n a := s[:2]\n b := s[2:]\n c, _ := strconv.Atoi(a)\n d, _ := strconv.Atoi(b)\n ans := \"NA\"\n switch{\n case c>=1 && c<=12 && d>=1 && d<=12:\n ans = \"AMBIGUOUS\"\n case (c==0 && d>12) || (c>12 && d==0):\n ans = \"NA\"\n case c>=1 && c<=12:\n ans = \"MMYY\"\n default:\n ans = \"YYMM\"\n }\n fmt.Println(ans)\n}\n\n\n\n\n\nfunc abs32(a int) int {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc abs64(a int64) int64 {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc min32(a, b int) int {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n", "language": "Go", "metadata": {"date": 1562443390, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03042/input.txt", "sample_output_relpath": "derived/input_output/data/p03042/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03042/Go/s094600415.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s094600415", "user_id": "u480831358"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n \"strconv\"\n)\n\n\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n a := s[:2]\n b := s[2:]\n c, _ := strconv.Atoi(a)\n d, _ := strconv.Atoi(b)\n ans := \"NA\"\n switch{\n case c>=1 && c<=12 && d>=1 && d<=12:\n ans = \"AMBIGUOUS\"\n case (c==0 && d>12) || (c>12 && d==0):\n ans = \"NA\"\n case c>=1 && c<=12:\n ans = \"MMYY\"\n default:\n ans = \"YYMM\"\n }\n fmt.Println(ans)\n}\n\n\n\n\n\nfunc abs32(a int) int {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc abs64(a int64) int64 {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc min32(a, b int) int {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "sample_input": "1905\n"}, "reference_outputs": ["YYMM\n"], "source_document_id": "p03042", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1154, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s405714987", "group_id": "codeNet:p03042", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tnn := strings.Split(n, \"\")\n\ta := nn[0] + nn[1]\n\tb := nn[2] + nn[3]\n\n\tc, _ := strconv.Atoi(a)\n\td, _ := strconv.Atoi(b)\n\n\tswitch {\n\tcase 0 < c && c <= 12 && 0 < d && d <= 12:\n\t\tfmt.Println(\"AMBIGUOUS\")\n\tcase (0 == c) || (0 == d || d > 12):\n\t\tfmt.Println(\"NA\")\n\tcase c > 12 && 0 < d && d <= 12:\n\t\tfmt.Println(\"YYMM\")\n\tcase d > 12 && 0 < c && c <= 12:\n\t\tfmt.Println(\"MMYY\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558810400, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03042/input.txt", "sample_output_relpath": "derived/input_output/data/p03042/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03042/Go/s405714987.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s405714987", "user_id": "u317845566"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tnn := strings.Split(n, \"\")\n\ta := nn[0] + nn[1]\n\tb := nn[2] + nn[3]\n\n\tc, _ := strconv.Atoi(a)\n\td, _ := strconv.Atoi(b)\n\n\tswitch {\n\tcase 0 < c && c <= 12 && 0 < d && d <= 12:\n\t\tfmt.Println(\"AMBIGUOUS\")\n\tcase (0 == c) || (0 == d || d > 12):\n\t\tfmt.Println(\"NA\")\n\tcase c > 12 && 0 < d && d <= 12:\n\t\tfmt.Println(\"YYMM\")\n\tcase d > 12 && 0 < c && c <= 12:\n\t\tfmt.Println(\"MMYY\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "sample_input": "1905\n"}, "reference_outputs": ["YYMM\n"], "source_document_id": "p03042", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 474, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s818752537", "group_id": "codeNet:p03042", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc main() {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanLines)\n\n sc.Scan()\n s := sc.Text()\n\n yymm := false\n mmyy := false\n\n a, _ := strconv.Atoi(s[:2])\n if a > 0 && a < 13 {\n mmyy = true\n }\n a, _ = strconv.Atoi(s[2:])\n if a > 0 && a < 13 {\n yymm = true\n }\n\n if yymm && mmyy {\n fmt.Println(\"AMBIGUOUS\")\n } else if yymm {\n fmt.Println(\"YYMM\")\n } else if mmyy {\n fmt.Println(\"MMYY\")\n } else {\n fmt.Println(\"NA\")\n }\n}\n", "language": "Go", "metadata": {"date": 1558495879, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03042/input.txt", "sample_output_relpath": "derived/input_output/data/p03042/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03042/Go/s818752537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s818752537", "user_id": "u212486902"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc main() {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanLines)\n\n sc.Scan()\n s := sc.Text()\n\n yymm := false\n mmyy := false\n\n a, _ := strconv.Atoi(s[:2])\n if a > 0 && a < 13 {\n mmyy = true\n }\n a, _ = strconv.Atoi(s[2:])\n if a > 0 && a < 13 {\n yymm = true\n }\n\n if yymm && mmyy {\n fmt.Println(\"AMBIGUOUS\")\n } else if yymm {\n fmt.Println(\"YYMM\")\n } else if mmyy {\n fmt.Println(\"MMYY\")\n } else {\n fmt.Println(\"NA\")\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "sample_input": "1905\n"}, "reference_outputs": ["YYMM\n"], "source_document_id": "p03042", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 524, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s103833346", "group_id": "codeNet:p03042", "input_text": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n \n n1, _ := strconv.Atoi(s[0:2])\n n2, _ := strconv.Atoi(s[2:])\n \n fmt.Println(ret(n1,n2))\n}\n \nfunc ret(n1, n2 int) string {\n if n1 == 0 {\n switch {\n case n2 == 0:\n return \"NA\"\n case 1 <= n2 && n2 <= 12:\n return \"YYMM\"\n case 13 <= n2:\n return \"NA\"\n }\n }\n if 1 <= n1 && n1 <= 12 {\n switch {\n case n2 == 0:\n return \"MMYY\"\n case 1 <= n2 && n2 <= 12:\n return \"AMBIGUOUS\"\n case 13 <= n2:\n return \"MMYY\"\n }\n }\n if 13 <= n1 {\n switch {\n case n2 == 0:\n return \"NA\"\n \tcase 1 <= n2 && n2 <= 12:\n return \"YYMM\"\n case 13 <= n2:\n return \"NA\"\n }\n }\n return \"NA\"\n}", "language": "Go", "metadata": {"date": 1558316671, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03042.html", "problem_id": "p03042", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03042/input.txt", "sample_output_relpath": "derived/input_output/data/p03042/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03042/Go/s103833346.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s103833346", "user_id": "u017421706"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n \n n1, _ := strconv.Atoi(s[0:2])\n n2, _ := strconv.Atoi(s[2:])\n \n fmt.Println(ret(n1,n2))\n}\n \nfunc ret(n1, n2 int) string {\n if n1 == 0 {\n switch {\n case n2 == 0:\n return \"NA\"\n case 1 <= n2 && n2 <= 12:\n return \"YYMM\"\n case 13 <= n2:\n return \"NA\"\n }\n }\n if 1 <= n1 && n1 <= 12 {\n switch {\n case n2 == 0:\n return \"MMYY\"\n case 1 <= n2 && n2 <= 12:\n return \"AMBIGUOUS\"\n case 13 <= n2:\n return \"MMYY\"\n }\n }\n if 13 <= n1 {\n switch {\n case n2 == 0:\n return \"NA\"\n \tcase 1 <= n2 && n2 <= 12:\n return \"YYMM\"\n case 13 <= n2:\n return \"NA\"\n }\n }\n return \"NA\"\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "sample_input": "1905\n"}, "reference_outputs": ["YYMM\n"], "source_document_id": "p03042", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n\nYYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order\n\nMMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order\n\nIf S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.\n\nConstraints\n\nS is a digit sequence of length 4.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the specified string: YYMM, MMYY, AMBIGUOUS or NA.\n\nSample Input 1\n\n1905\n\nSample Output 1\n\nYYMM\n\nMay XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.\n\nSample Input 2\n\n0112\n\nSample Output 2\n\nAMBIGUOUS\n\nBoth December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.\n\nSample Input 3\n\n1700\n\nSample Output 3\n\nNA\n\nNeither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 744, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s458699263", "group_id": "codeNet:p03043", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tans := 0.0\n\tfor i := 1; i <= n; i++ {\n\t\tp := 1.0 / float64(n)\n\t\tfor score := i; score < k; score *= 2 {\n\t\t\tp /= 2\n\t\t}\n\t\tans += p\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1558374875, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03043/input.txt", "sample_output_relpath": "derived/input_output/data/p03043/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03043/Go/s458699263.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s458699263", "user_id": "u554269352"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tans := 0.0\n\tfor i := 1; i <= n; i++ {\n\t\tp := 1.0 / float64(n)\n\t\tfor score := i; score < k; score *= 2 {\n\t\t\tp /= 2\n\t\t}\n\t\tans += p\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "sample_input": "3 10\n"}, "reference_outputs": ["0.145833333333\n"], "source_document_id": "p03043", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 229, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s882442727", "group_id": "codeNet:p03044", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ta, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\ntype To struct {\n\te int\n\tw int\n}\n\nfunc makeLengths(n int, to map[int][]To, l []int) {\n\tl[0] = 0\n\tvar impl func(p, gp int)\n\timpl = func(p, gp int) {\n\t\tif to[p] == nil {\n\t\t\treturn\n\t\t}\n\t\tfor _, nextTo := range to[p] {\n\t\t\tif nextTo.e == gp {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tl[nextTo.e] = nextTo.w + l[p]\n\t\t\timpl(nextTo.e, p)\n\t\t}\n\t}\n\timpl(0, -1)\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\n\tto := map[int][]To{}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tu := scanInt()\n\t\tv := scanInt()\n\t\tw := scanInt()\n\n\t\tif to[u-1] == nil {\n\t\t\tto[u-1] = []To{{e: v - 1, w: w}}\n\t\t} else {\n\t\t\tto[u-1] = append(to[u-1], To{e: v - 1, w: w})\n\t\t}\n\n\t\tif to[v-1] == nil {\n\t\t\tto[v-1] = []To{{e: u - 1, w: w}}\n\t\t} else {\n\t\t\tto[v-1] = append(to[v-1], To{e: u - 1, w: w})\n\t\t}\n\t}\n\n\tl := make([]int, n)\n\tmakeLengths(n, to, l)\n\n\tfor i := range l {\n\t\tif l[i]%2 == 0 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(1)\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1582581662, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03044.html", "problem_id": "p03044", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03044/input.txt", "sample_output_relpath": "derived/input_output/data/p03044/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03044/Go/s882442727.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s882442727", "user_id": "u605983940"}, "prompt_components": {"gold_output": "0\n0\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ta, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\ntype To struct {\n\te int\n\tw int\n}\n\nfunc makeLengths(n int, to map[int][]To, l []int) {\n\tl[0] = 0\n\tvar impl func(p, gp int)\n\timpl = func(p, gp int) {\n\t\tif to[p] == nil {\n\t\t\treturn\n\t\t}\n\t\tfor _, nextTo := range to[p] {\n\t\t\tif nextTo.e == gp {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tl[nextTo.e] = nextTo.w + l[p]\n\t\t\timpl(nextTo.e, p)\n\t\t}\n\t}\n\timpl(0, -1)\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\n\tto := map[int][]To{}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tu := scanInt()\n\t\tv := scanInt()\n\t\tw := scanInt()\n\n\t\tif to[u-1] == nil {\n\t\t\tto[u-1] = []To{{e: v - 1, w: w}}\n\t\t} else {\n\t\t\tto[u-1] = append(to[u-1], To{e: v - 1, w: w})\n\t\t}\n\n\t\tif to[v-1] == nil {\n\t\t\tto[v-1] = []To{{e: u - 1, w: w}}\n\t\t} else {\n\t\t\tto[v-1] = append(to[v-1], To{e: u - 1, w: w})\n\t\t}\n\t}\n\n\tl := make([]int, n)\n\tmakeLengths(n, to, l)\n\n\tfor i := range l {\n\t\tif l[i]%2 == 0 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(1)\n\t\t}\n\t}\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "sample_input": "3\n1 2 2\n2 3 1\n"}, "reference_outputs": ["0\n0\n1\n"], "source_document_id": "p03044", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1118, "cpu_time_ms": 351, "memory_kb": 38656}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s839133282", "group_id": "codeNet:p03044", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tedges map[int]map[int]int\n\tdists []int\n)\n\nfunc newLineInt() int {\n\tsc.Scan()\n\tdata, _ := strconv.Atoi(sc.Text())\n\treturn data\n}\n\nfunc pop(stack []int) (int, []int) {\n\te := stack[len(stack)-1]\n\tupdatedStack := stack[:len(stack)-1]\n\treturn e, updatedStack\n}\n\nfunc dfs(v int) {\n\tvar stack []int\n\tvar current int\n\tvar currentDist int\n\tstack = append(stack, v)\n\tcurrent = v\n\tfor {\n\t\tif len(stack) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tcurrent, stack = pop(stack)\n\t\tcurrentDist = dists[current]\n\n\t\tfor neibor, w := range edges[current] {\n\t\t\tif dists[neibor] == -1 {\n\t\t\t\tstack = append(stack, neibor)\n\t\t\t\tdists[neibor] = (w + currentDist) % 2\n\t\t\t}\n\t\t}\n\n\t}\n}\n\nfunc main() {\n\n\tedges = make(map[int]map[int]int)\n\n\tsc.Split(bufio.ScanWords)\n\tn := newLineInt()\n\tfor i := 0; i < n; i++ {\n\t\tedges[i] = make(map[int]int)\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\tu, v, w := newLineInt(), newLineInt(), newLineInt()\n\t\tedges[u-1][v-1] = w % 2\n\t\tedges[v-1][u-1] = w % 2\n\t}\n\tdists = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdists[i] = -1\n\t}\n\tdists[0] = 0\n\tdfs(0)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(dists[i])\n\t}\n}", "language": "Go", "metadata": {"date": 1559504600, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03044.html", "problem_id": "p03044", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03044/input.txt", "sample_output_relpath": "derived/input_output/data/p03044/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03044/Go/s839133282.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s839133282", "user_id": "u688382286"}, "prompt_components": {"gold_output": "0\n0\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tedges map[int]map[int]int\n\tdists []int\n)\n\nfunc newLineInt() int {\n\tsc.Scan()\n\tdata, _ := strconv.Atoi(sc.Text())\n\treturn data\n}\n\nfunc pop(stack []int) (int, []int) {\n\te := stack[len(stack)-1]\n\tupdatedStack := stack[:len(stack)-1]\n\treturn e, updatedStack\n}\n\nfunc dfs(v int) {\n\tvar stack []int\n\tvar current int\n\tvar currentDist int\n\tstack = append(stack, v)\n\tcurrent = v\n\tfor {\n\t\tif len(stack) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tcurrent, stack = pop(stack)\n\t\tcurrentDist = dists[current]\n\n\t\tfor neibor, w := range edges[current] {\n\t\t\tif dists[neibor] == -1 {\n\t\t\t\tstack = append(stack, neibor)\n\t\t\t\tdists[neibor] = (w + currentDist) % 2\n\t\t\t}\n\t\t}\n\n\t}\n}\n\nfunc main() {\n\n\tedges = make(map[int]map[int]int)\n\n\tsc.Split(bufio.ScanWords)\n\tn := newLineInt()\n\tfor i := 0; i < n; i++ {\n\t\tedges[i] = make(map[int]int)\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\tu, v, w := newLineInt(), newLineInt(), newLineInt()\n\t\tedges[u-1][v-1] = w % 2\n\t\tedges[v-1][u-1] = w % 2\n\t}\n\tdists = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdists[i] = -1\n\t}\n\tdists[0] = 0\n\tdfs(0)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(dists[i])\n\t}\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "sample_input": "3\n1 2 2\n2 3 1\n"}, "reference_outputs": ["0\n0\n1\n"], "source_document_id": "p03044", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1178, "cpu_time_ms": 437, "memory_kb": 34560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s273853661", "group_id": "codeNet:p03047", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, k string\n\tfmt.Scan(&n, &k)\n\n\tc, _ := strconv.Atoi(n)\n\ts := newSlice(0, c, 1)\n\n\tp := 0\n\tintK, _ := strconv.Atoi(k)\n\ti := 0\n\tfor i < len(s) {\n\t\tif i+intK <= len(s) {\n\t\t\tp++\n\t\t}\n\t\ti++\n\t}\n\tfmt.Println(p)\n}\n\nfunc newSlice(start, count, step int) []int {\n\ts := make([]int, count)\n\tfor i := range s {\n\t\ts[i] = start\n\t\tstart += step\n\t}\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1557703564, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03047.html", "problem_id": "p03047", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03047/input.txt", "sample_output_relpath": "derived/input_output/data/p03047/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03047/Go/s273853661.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s273853661", "user_id": "u044788022"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, k string\n\tfmt.Scan(&n, &k)\n\n\tc, _ := strconv.Atoi(n)\n\ts := newSlice(0, c, 1)\n\n\tp := 0\n\tintK, _ := strconv.Atoi(k)\n\ti := 0\n\tfor i < len(s) {\n\t\tif i+intK <= len(s) {\n\t\t\tp++\n\t\t}\n\t\ti++\n\t}\n\tfmt.Println(p)\n}\n\nfunc newSlice(start, count, step int) []int {\n\ts := make([]int, count)\n\tfor i := range s {\n\t\ts[i] = start\n\t\tstart += step\n\t}\n\treturn s\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has N integers: 1,2,\\ldots,N.\nHe will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K \\leq N \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are two ways to choose two consecutive integers: (1,2) and (2,3).\n\nSample Input 2\n\n13 3\n\nSample Output 2\n\n11", "sample_input": "3 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03047", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has N integers: 1,2,\\ldots,N.\nHe will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K \\leq N \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are two ways to choose two consecutive integers: (1,2) and (2,3).\n\nSample Input 2\n\n13 3\n\nSample Output 2\n\n11", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 406, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s903392188", "group_id": "codeNet:p03048", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tR, G, B, N := readInt(), readInt(), readInt(), readInt()\n\tvar ans int64\n\tfor r := int64(0); r <= 3000; r++ {\n\t\tfor g := int64(0); g <= 3000; g++ {\n\t\t\tvar sum = R*r + G*g\n\t\t\tif N >= sum && (N-sum)%B == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1598407065, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03048.html", "problem_id": "p03048", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03048/input.txt", "sample_output_relpath": "derived/input_output/data/p03048/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03048/Go/s903392188.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s903392188", "user_id": "u967669872"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tR, G, B, N := readInt(), readInt(), readInt(), readInt()\n\tvar ans int64\n\tfor r := int64(0); r <= 3000; r++ {\n\t\tfor g := int64(0); g <= 3000; g++ {\n\t\t\tvar sum = R*r + G*g\n\t\t\tif N >= sum && (N-sum)%B == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "sample_input": "1 2 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03048", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5809, "cpu_time_ms": 73, "memory_kb": 1788}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s278781204", "group_id": "codeNet:p03048", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getNextLine(scanner *bufio.Reader) string {\n\tvar buffer string\n\tfor {\n\t\tline, isPrefix, _ := scanner.ReadLine()\n\t\tbuffer += string(line)\n\t\tif isPrefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buffer\n}\n\nfunc getIntList(scanner *bufio.Reader) []int {\n\tlist := strings.Split(getNextLine(scanner), \" \")\n\tl := len(list)\n\tresult := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tresult[i], _ = strconv.Atoi(list[i])\n\t}\n\treturn result\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := bufio.NewReader(fp)\n\n\tvar r, g, b, n int\n\n\tfmt.Sscan(getNextLine(scanner), &r, &g, &b, &n)\n\n\tarr := make([]int, n+1)\n\tans := 0\n\tfor i := 0; i <= n; i += r {\n\t\tfor j := 0; j <= n; j += g {\n\t\t\tt := i + j\n\t\t\tif t > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tarr[t]++\n\t\t}\n\t}\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n; j += b {\n\t\t\tt := i + j\n\t\t\tif t > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif t == n {\n\t\t\t\tans += arr[i]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1557627350, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03048.html", "problem_id": "p03048", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03048/input.txt", "sample_output_relpath": "derived/input_output/data/p03048/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03048/Go/s278781204.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s278781204", "user_id": "u150542210"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getNextLine(scanner *bufio.Reader) string {\n\tvar buffer string\n\tfor {\n\t\tline, isPrefix, _ := scanner.ReadLine()\n\t\tbuffer += string(line)\n\t\tif isPrefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buffer\n}\n\nfunc getIntList(scanner *bufio.Reader) []int {\n\tlist := strings.Split(getNextLine(scanner), \" \")\n\tl := len(list)\n\tresult := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tresult[i], _ = strconv.Atoi(list[i])\n\t}\n\treturn result\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := bufio.NewReader(fp)\n\n\tvar r, g, b, n int\n\n\tfmt.Sscan(getNextLine(scanner), &r, &g, &b, &n)\n\n\tarr := make([]int, n+1)\n\tans := 0\n\tfor i := 0; i <= n; i += r {\n\t\tfor j := 0; j <= n; j += g {\n\t\t\tt := i + j\n\t\t\tif t > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tarr[t]++\n\t\t}\n\t}\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n; j += b {\n\t\t\tt := i + j\n\t\t\tif t > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif t == n {\n\t\t\t\tans += arr[i]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "sample_input": "1 2 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03048", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1012, "cpu_time_ms": 15, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s284086757", "group_id": "codeNet:p03049", "input_text": "package main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n)\n\tcount, bxa, bx, xa := 0, 0, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&s)\n\t\tfor j := 0; j < len(s)-1; j++ {\n\t\t\tif s[j] == 'A' && s[j+1] == 'B' {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tbxa++\n\t\t} else if s[0] == 'B' {\n\t\t\tbx++\n\t\t} else if s[len(s)-1] == 'A' {\n\t\t\txa++\n\t\t}\n\t}\n\n\tif bxa == 0 {\n\t\tcount += min(bx, xa)\n\t} else if bx == 0 && xa == 0 {\n\t\tcount += bxa - 1\n\t} else {\n\t\tcount += bxa + min(bx, xa)\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1557632602, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/Go/s284086757.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s284086757", "user_id": "u461993794"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n)\n\tcount, bxa, bx, xa := 0, 0, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&s)\n\t\tfor j := 0; j < len(s)-1; j++ {\n\t\t\tif s[j] == 'A' && s[j+1] == 'B' {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tbxa++\n\t\t} else if s[0] == 'B' {\n\t\t\tbx++\n\t\t} else if s[len(s)-1] == 'A' {\n\t\t\txa++\n\t\t}\n\t}\n\n\tif bxa == 0 {\n\t\tcount += min(bx, xa)\n\t} else if bx == 0 && xa == 0 {\n\t\tcount += bxa - 1\n\t} else {\n\t\tcount += bxa + min(bx, xa)\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 602, "cpu_time_ms": 46, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s725664617", "group_id": "codeNet:p03049", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&s[i])\n\t}\n\n\tans := 0\n\thb := 0\n\tta := 0\n\thbta := 0\n\tfor _, v := range s {\n\t\tc := strings.Count(v, \"AB\")\n\t\tif c > 0 {\n\t\t\tstrings.Replace(v, \"AB\", \"\", c)\n\t\t\tans += c\n\t\t}\n\t\tif strings.HasPrefix(v, \"B\") && strings.HasSuffix(v, \"A\") {\n\t\t\thbta++\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(v, \"B\") {\n\t\t\thb++\n\t\t}\n\t\tif strings.HasSuffix(v, \"A\") {\n\t\t\tta++\n\t\t}\n\t}\n\tif hb < ta {\n\t\tans += hb\n\t\tta -= hb\n\t\tif ta < hbta {\n\t\t\tans += ta\n\t\t\thbta -= ta\n\t\t\tans += hbta\n\t\t} else {\n\t\t\tans += hbta\n\t\t}\n\t} else {\n\t\tans += ta\n\t\thb -= ta\n\t\tif hb < hbta {\n\t\t\tans += hb\n\t\t\thbta -= hb\n\t\t\tans += hbta\n\t\t} else {\n\t\t\tans += hbta\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1557628381, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/Go/s725664617.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s725664617", "user_id": "u102310764"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&s[i])\n\t}\n\n\tans := 0\n\thb := 0\n\tta := 0\n\thbta := 0\n\tfor _, v := range s {\n\t\tc := strings.Count(v, \"AB\")\n\t\tif c > 0 {\n\t\t\tstrings.Replace(v, \"AB\", \"\", c)\n\t\t\tans += c\n\t\t}\n\t\tif strings.HasPrefix(v, \"B\") && strings.HasSuffix(v, \"A\") {\n\t\t\thbta++\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(v, \"B\") {\n\t\t\thb++\n\t\t}\n\t\tif strings.HasSuffix(v, \"A\") {\n\t\t\tta++\n\t\t}\n\t}\n\tif hb < ta {\n\t\tans += hb\n\t\tta -= hb\n\t\tif ta < hbta {\n\t\t\tans += ta\n\t\t\thbta -= ta\n\t\t\tans += hbta\n\t\t} else {\n\t\t\tans += hbta\n\t\t}\n\t} else {\n\t\tans += ta\n\t\thb -= ta\n\t\tif hb < hbta {\n\t\t\tans += hb\n\t\t\thbta -= hb\n\t\t\tans += hbta\n\t\t} else {\n\t\t\tans += hbta\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 764, "cpu_time_ms": 48, "memory_kb": 1408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s585047450", "group_id": "codeNet:p03049", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar counter int\n\tN := oneInt()\n\tvar sentences []string\n\tfor index := 0; index < N; index++ {\n\t\ts := oneStr()\n\t\tcounter += strings.Count(s, \"AB\")\n\t\tsentences = append(sentences, s)\n\t}\n\tsumOfA := countLastA(sentences)\n\tsumOfB := countFirstB(sentences)\n\tsumOfAB := countAB(sentences)\n\n\tvar result int\n\n\tif sumOfA == sumOfB && sumOfAB == sumOfA {\n\t\tfmt.Printf(\"%v\", counter+sumOfAB-1)\n\t\treturn\n\t}\n\n\tif sumOfB >= sumOfA {\n\t\tresult = sumOfA + counter\n\t} else {\n\t\tresult = sumOfB + counter\n\t}\n\n\tfmt.Printf(\"%v\", result)\n}\n\nfunc countLastA(sentence []string) int {\n\tcounter := 0\n\tfor _, s := range sentence {\n\t\tif s[len(s)-1] == 'A' {\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn counter\n}\n\nfunc countFirstB(sentence []string) int {\n\tcounter := 0\n\tfor _, s := range sentence {\n\t\tif s[0] == 'B' {\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn counter\n}\n\nfunc countAB(sentence []string) int {\n\tcounter := 0\n\tfor _, s := range sentence {\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn counter\n}\n", "language": "Go", "metadata": {"date": 1557628318, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/Go/s585047450.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s585047450", "user_id": "u643520570"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar counter int\n\tN := oneInt()\n\tvar sentences []string\n\tfor index := 0; index < N; index++ {\n\t\ts := oneStr()\n\t\tcounter += strings.Count(s, \"AB\")\n\t\tsentences = append(sentences, s)\n\t}\n\tsumOfA := countLastA(sentences)\n\tsumOfB := countFirstB(sentences)\n\tsumOfAB := countAB(sentences)\n\n\tvar result int\n\n\tif sumOfA == sumOfB && sumOfAB == sumOfA {\n\t\tfmt.Printf(\"%v\", counter+sumOfAB-1)\n\t\treturn\n\t}\n\n\tif sumOfB >= sumOfA {\n\t\tresult = sumOfA + counter\n\t} else {\n\t\tresult = sumOfB + counter\n\t}\n\n\tfmt.Printf(\"%v\", result)\n}\n\nfunc countLastA(sentence []string) int {\n\tcounter := 0\n\tfor _, s := range sentence {\n\t\tif s[len(s)-1] == 'A' {\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn counter\n}\n\nfunc countFirstB(sentence []string) int {\n\tcounter := 0\n\tfor _, s := range sentence {\n\t\tif s[0] == 'B' {\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn counter\n}\n\nfunc countAB(sentence []string) int {\n\tcounter := 0\n\tfor _, s := range sentence {\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tcounter++\n\t\t}\n\t}\n\treturn counter\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2636, "cpu_time_ms": 50, "memory_kb": 2176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s084746626", "group_id": "codeNet:p03050", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc primeFactors(n uint64) (pfs map[uint64]uint64) {\n\tpfs = make(map[uint64]uint64)\n\tfor n%2 == 0 {\n\t\tpfs[2]++\n\t\tn = n / 2\n\t}\n\n\tvar i uint64\n\tfor i = 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tpfs[i]++\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\tif n > 2 {\n\t\tpfs[n]++\n\t}\n\treturn\n}\n\nfunc pow(x uint64, y uint64) uint64 {\n\t//_, _ = fmt.Printf(\"pow: %v, %v\\n\", x,y)\n\tz := x\n\tif y == 0 {\n\t\treturn 1\n\t}\n\tvar i uint64\n\tfor i =1;i 2 {\n\t\t\tif n / pf <= pf {\n\t\t\t\tsum += pf - 1\n\t\t\t\t//_, _ = fmt.Printf(\"m: %v, %v, %v\\n\", pf-1, n/(pf-1), n%(pf-1))\n\t\t\t}\n\t\t}\n\t\tif !incIdx(&idx, &max) {\n\t\t\tbreak\n\t\t}\n\t}\n\t//_, _ = fmt.Printf(\"%v\\n\", sum)\n\t_, _ = fmt.Fprintf(writer, \"%v\", sum)\n}\n\nfunc main() {\n\tanswer(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1557693025, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03050.html", "problem_id": "p03050", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03050/input.txt", "sample_output_relpath": "derived/input_output/data/p03050/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03050/Go/s084746626.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s084746626", "user_id": "u880731071"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc primeFactors(n uint64) (pfs map[uint64]uint64) {\n\tpfs = make(map[uint64]uint64)\n\tfor n%2 == 0 {\n\t\tpfs[2]++\n\t\tn = n / 2\n\t}\n\n\tvar i uint64\n\tfor i = 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tpfs[i]++\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\tif n > 2 {\n\t\tpfs[n]++\n\t}\n\treturn\n}\n\nfunc pow(x uint64, y uint64) uint64 {\n\t//_, _ = fmt.Printf(\"pow: %v, %v\\n\", x,y)\n\tz := x\n\tif y == 0 {\n\t\treturn 1\n\t}\n\tvar i uint64\n\tfor i =1;i 2 {\n\t\t\tif n / pf <= pf {\n\t\t\t\tsum += pf - 1\n\t\t\t\t//_, _ = fmt.Printf(\"m: %v, %v, %v\\n\", pf-1, n/(pf-1), n%(pf-1))\n\t\t\t}\n\t\t}\n\t\tif !incIdx(&idx, &max) {\n\t\t\tbreak\n\t\t}\n\t}\n\t//_, _ = fmt.Printf(\"%v\\n\", sum)\n\t_, _ = fmt.Fprintf(writer, \"%v\", sum)\n}\n\nfunc main() {\n\tanswer(os.Stdin, os.Stdout)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSnuke received a positive integer N from Takahashi.\nA positive integer m is called a favorite number when the following condition is satisfied:\n\nThe quotient and remainder of N divided by m are equal, that is, \\lfloor \\frac{N}{m} \\rfloor = N \\bmod m holds.\n\nFind all favorite numbers and print the sum of those.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n10\n\nThere are two favorite numbers: 3 and 7. Print the sum of these, 10.\n\nSample Input 2\n\n1000000000000\n\nSample Output 2\n\n2499686339916\n\nWatch out for overflow.", "sample_input": "8\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03050", "source_text": "Score : 500 points\n\nProblem Statement\n\nSnuke received a positive integer N from Takahashi.\nA positive integer m is called a favorite number when the following condition is satisfied:\n\nThe quotient and remainder of N divided by m are equal, that is, \\lfloor \\frac{N}{m} \\rfloor = N \\bmod m holds.\n\nFind all favorite numbers and print the sum of those.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n10\n\nThere are two favorite numbers: 3 and 7. Print the sum of these, 10.\n\nSample Input 2\n\n1000000000000\n\nSample Output 2\n\n2499686339916\n\nWatch out for overflow.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1477, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s164698413", "group_id": "codeNet:p03055", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/agc033/tasks/agc033_c\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tn = ReadInt()\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := ReadInt2()\n\t\ta--\n\t\tb--\n\n\t\tG[a] = append(G[a], Edge{to: b, cost: 1})\n\t\tG[b] = append(G[b], Edge{to: a, cost: 1})\n\t}\n\n\tdfs(0, -1)\n\trdfs(0, -1, 0)\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tres = Max(res, ans[i])\n\t}\n\n\tif res%3 == 1 {\n\t\tfmt.Println(\"Second\")\n\t} else {\n\t\tfmt.Println(\"First\")\n\t}\n}\n\ntype Edge struct {\n\tto, cost int\n}\n\nvar (\n\tn int\n\n\tG [100000 + 50][]Edge\n\tdp [100000 + 50]int\n\tans [100000 + 50]int\n)\n\nfunc rdfs(cid, pid int, dpar int) {\n\tV := []int{}\n\tfor _, e := range G[cid] {\n\t\tif e.to == pid {\n\t\t\tV = append(V, dpar+e.cost)\n\t\t\tdpar += e.cost // 都合上ここで更新する\n\t\t\tcontinue\n\t\t}\n\t\tV = append(V, dp[e.to]+e.cost)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(V)))\n\tif len(V) == 1 {\n\t\tans[cid] = V[0]\n\t} else {\n\t\tans[cid] = V[0] + V[1]\n\t}\n\n\tcdp := []int{0}\n\tnexts := []int{-1}\n\tfor _, e := range G[cid] {\n\t\tif e.to == pid {\n\t\t\tcontinue\n\t\t}\n\t\tcdp = append(cdp, dp[e.to]+e.cost)\n\t\tnexts = append(nexts, e.to)\n\t}\n\tcdp = append(cdp, 0)\n\tnexts = append(nexts, -1)\n\n\tN := len(cdp)\n\tL, R := make([]int, N), make([]int, N)\n\tL[0], R[0], L[N-1], R[N-1] = 0, 0, 0, 0\n\tfor i := 1; i <= N-2; i++ {\n\t\tL[i] = Max(L[i-1], cdp[i])\n\t}\n\tfor i := N - 2; i >= 1; i-- {\n\t\tR[i] = Max(R[i+1], cdp[i])\n\t}\n\n\tfor i := 1; i <= N-2; i++ {\n\t\tndpar := Max(dpar, L[i-1], R[i+1])\n\t\trdfs(nexts[i], cid, ndpar)\n\t}\n}\n\nfunc dfs(cid, pid int) {\n\tres := 0\n\tfor _, e := range G[cid] {\n\t\tif e.to == pid {\n\t\t\tcontinue\n\t\t}\n\n\t\tdfs(e.to, cid)\n\t\tres = Max(res, dp[e.to]+e.cost)\n\t}\n\tdp[cid] = res\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc solve() {\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1595307517, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03055.html", "problem_id": "p03055", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03055/input.txt", "sample_output_relpath": "derived/input_output/data/p03055/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03055/Go/s164698413.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s164698413", "user_id": "u103600314"}, "prompt_components": {"gold_output": "First\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/agc033/tasks/agc033_c\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\t// MOD = 998244353\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tn = ReadInt()\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := ReadInt2()\n\t\ta--\n\t\tb--\n\n\t\tG[a] = append(G[a], Edge{to: b, cost: 1})\n\t\tG[b] = append(G[b], Edge{to: a, cost: 1})\n\t}\n\n\tdfs(0, -1)\n\trdfs(0, -1, 0)\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tres = Max(res, ans[i])\n\t}\n\n\tif res%3 == 1 {\n\t\tfmt.Println(\"Second\")\n\t} else {\n\t\tfmt.Println(\"First\")\n\t}\n}\n\ntype Edge struct {\n\tto, cost int\n}\n\nvar (\n\tn int\n\n\tG [100000 + 50][]Edge\n\tdp [100000 + 50]int\n\tans [100000 + 50]int\n)\n\nfunc rdfs(cid, pid int, dpar int) {\n\tV := []int{}\n\tfor _, e := range G[cid] {\n\t\tif e.to == pid {\n\t\t\tV = append(V, dpar+e.cost)\n\t\t\tdpar += e.cost // 都合上ここで更新する\n\t\t\tcontinue\n\t\t}\n\t\tV = append(V, dp[e.to]+e.cost)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(V)))\n\tif len(V) == 1 {\n\t\tans[cid] = V[0]\n\t} else {\n\t\tans[cid] = V[0] + V[1]\n\t}\n\n\tcdp := []int{0}\n\tnexts := []int{-1}\n\tfor _, e := range G[cid] {\n\t\tif e.to == pid {\n\t\t\tcontinue\n\t\t}\n\t\tcdp = append(cdp, dp[e.to]+e.cost)\n\t\tnexts = append(nexts, e.to)\n\t}\n\tcdp = append(cdp, 0)\n\tnexts = append(nexts, -1)\n\n\tN := len(cdp)\n\tL, R := make([]int, N), make([]int, N)\n\tL[0], R[0], L[N-1], R[N-1] = 0, 0, 0, 0\n\tfor i := 1; i <= N-2; i++ {\n\t\tL[i] = Max(L[i-1], cdp[i])\n\t}\n\tfor i := N - 2; i >= 1; i-- {\n\t\tR[i] = Max(R[i+1], cdp[i])\n\t}\n\n\tfor i := 1; i <= N-2; i++ {\n\t\tndpar := Max(dpar, L[i-1], R[i+1])\n\t\trdfs(nexts[i], cid, ndpar)\n\t}\n}\n\nfunc dfs(cid, pid int) {\n\tres := 0\n\tfor _, e := range G[cid] {\n\t\tif e.to == pid {\n\t\t\tcontinue\n\t\t}\n\n\t\tdfs(e.to, cid)\n\t\tres = Max(res, dp[e.to]+e.cost)\n\t}\n\tdp[cid] = res\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\nfunc solve() {\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nTakahashi and Aoki will play a game on a tree.\nThe tree has N vertices numbered 1 to N, and the i-th of the N-1 edges connects Vertex a_i and Vertex b_i.\n\nAt the beginning of the game, each vertex contains a coin.\nStarting from Takahashi, he and Aoki will alternately perform the following operation:\n\nChoose a vertex v that contains one or more coins, and remove all the coins from v.\n\nThen, move each coin remaining on the tree to the vertex that is nearest to v among the adjacent vertices of the coin's current vertex.\n\nThe player who becomes unable to play, loses the game.\nThat is, the player who takes his turn when there is no coin remaining on the tree, loses the game.\nDetermine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq a_i, b_i \\leq N\n\na_i \\neq b_i\n\nThe graph given as input is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_{N-1} b_{N-1}\n\nOutput\n\nPrint First if Takahashi will win, and print Second if Aoki will win.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\nFirst\n\nHere is one possible progress of the game:\n\nTakahashi removes the coin from Vertex 1. Now, Vertex 1 and Vertex 2 contain one coin each.\n\nAoki removes the coin from Vertex 2. Now, Vertex 2 contains one coin.\n\nTakahashi removes the coin from Vertex 2. Now, there is no coin remaining on the tree.\n\nAoki takes his turn when there is no coin on the tree and loses.\n\nSample Input 2\n\n6\n1 2\n2 3\n2 4\n4 6\n5 6\n\nSample Output 2\n\nSecond\n\nSample Input 3\n\n7\n1 7\n7 4\n3 4\n7 5\n6 3\n2 1\n\nSample Output 3\n\nFirst", "sample_input": "3\n1 2\n2 3\n"}, "reference_outputs": ["First\n"], "source_document_id": "p03055", "source_text": "Score : 800 points\n\nProblem Statement\n\nTakahashi and Aoki will play a game on a tree.\nThe tree has N vertices numbered 1 to N, and the i-th of the N-1 edges connects Vertex a_i and Vertex b_i.\n\nAt the beginning of the game, each vertex contains a coin.\nStarting from Takahashi, he and Aoki will alternately perform the following operation:\n\nChoose a vertex v that contains one or more coins, and remove all the coins from v.\n\nThen, move each coin remaining on the tree to the vertex that is nearest to v among the adjacent vertices of the coin's current vertex.\n\nThe player who becomes unable to play, loses the game.\nThat is, the player who takes his turn when there is no coin remaining on the tree, loses the game.\nDetermine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq a_i, b_i \\leq N\n\na_i \\neq b_i\n\nThe graph given as input is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_{N-1} b_{N-1}\n\nOutput\n\nPrint First if Takahashi will win, and print Second if Aoki will win.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\nFirst\n\nHere is one possible progress of the game:\n\nTakahashi removes the coin from Vertex 1. Now, Vertex 1 and Vertex 2 contain one coin each.\n\nAoki removes the coin from Vertex 2. Now, Vertex 2 contains one coin.\n\nTakahashi removes the coin from Vertex 2. Now, there is no coin remaining on the tree.\n\nAoki takes his turn when there is no coin on the tree and loses.\n\nSample Input 2\n\n6\n1 2\n2 3\n2 4\n4 6\n5 6\n\nSample Output 2\n\nSecond\n\nSample Input 3\n\n7\n1 7\n7 4\n3 4\n7 5\n6 3\n2 1\n\nSample Output 3\n\nFirst", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6840, "cpu_time_ms": 59, "memory_kb": 14372}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s003096636", "group_id": "codeNet:p03059", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar A, B, T int\n\tfmt.Scan(&A, &B, &T)\n\n\tbisket := 0\n\tfor i := 1; i <= T; i++ {\n\t\tif i%A == 0 {\n\t\t\tbisket += B\n\t\t}\n\t}\n\n\tfmt.Println(bisket)\n}\n", "language": "Go", "metadata": {"date": 1597180242, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/Go/s003096636.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003096636", "user_id": "u825925638"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar A, B, T int\n\tfmt.Scan(&A, &B, &T)\n\n\tbisket := 0\n\tfor i := 1; i <= T; i++ {\n\t\tif i%A == 0 {\n\t\t\tbisket += B\n\t\t}\n\t}\n\n\tfmt.Println(bisket)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 190, "cpu_time_ms": 3, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s407777533", "group_id": "codeNet:p03059", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\ta := nextInt()\n\tb := nextInt()\n\tt := nextInt()\n\n\tcnt := 0\n\tfor i := 1; i <= t; i++ {\n\t\tif i%a == 0 {\n\t\t\tcnt += b\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1596845502, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/Go/s407777533.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s407777533", "user_id": "u756000295"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\ta := nextInt()\n\tb := nextInt()\n\tt := nextInt()\n\n\tcnt := 0\n\tfor i := 1; i <= t; i++ {\n\t\tif i%a == 0 {\n\t\t\tcnt += b\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 588, "cpu_time_ms": 5, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s455279206", "group_id": "codeNet:p03059", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, t int\n\tfmt.Scan(&a, &b, &t)\n\n\tif a > t {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\n\ttime := 0\n\tmaked := 0\n\tcnt := 1\n\tfor time < t {\n\t\tmaked += b\n\t\tcnt++\n\t\ttime = a * cnt\n\t}\n\n\tfmt.Print(maked)\n\n}\n", "language": "Go", "metadata": {"date": 1576356270, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/Go/s455279206.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s455279206", "user_id": "u303616227"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, t int\n\tfmt.Scan(&a, &b, &t)\n\n\tif a > t {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\n\ttime := 0\n\tmaked := 0\n\tcnt := 1\n\tfor time < t {\n\t\tmaked += b\n\t\tcnt++\n\t\ttime = a * cnt\n\t}\n\n\tfmt.Print(maked)\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 239, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s893594555", "group_id": "codeNet:p03059", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tBufferSize = 10*10*10*10*10 + 10\n)\n\nfunc scanStr(sc *bufio.Scanner) string {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\n\treturn sc.Text()\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn i\n}\n\nfunc check() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\ta := scanInt(sc)\n\tb := scanInt(sc)\n\tt := scanInt(sc)\n\n\tvar i int\n\tfor ; (i+1)*a <= t; i++ {\n\t}\n\n\tfmt.Printf(\"%d\\n\", i*b)\n\treturn\n\n}\n\nfunc main() {\n\tcheck()\n}\n", "language": "Go", "metadata": {"date": 1557028346, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/Go/s893594555.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s893594555", "user_id": "u566651462"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tBufferSize = 10*10*10*10*10 + 10\n)\n\nfunc scanStr(sc *bufio.Scanner) string {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\n\treturn sc.Text()\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn i\n}\n\nfunc check() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\ta := scanInt(sc)\n\tb := scanInt(sc)\n\tt := scanInt(sc)\n\n\tvar i int\n\tfor ; (i+1)*a <= t; i++ {\n\t}\n\n\tfmt.Printf(\"%d\\n\", i*b)\n\treturn\n\n}\n\nfunc main() {\n\tcheck()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 649, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s049416310", "group_id": "codeNet:p03059", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, t int\n\tfmt.Scan(&a, &b, &t)\n\n\tfmt.Println(t / a * b)\n}\n", "language": "Go", "metadata": {"date": 1556413372, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/Go/s049416310.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s049416310", "user_id": "u113872560"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, t int\n\tfmt.Scan(&a, &b, &t)\n\n\tfmt.Println(t / a * b)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 108, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s206091396", "group_id": "codeNet:p03060", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int \n fmt.Scan(&n)\n res := 0\n v := make([]int, n)\n c := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&v[i])\n }\n for i := 0; i < n; i++ {\n fmt.Scan(&c[i])\n }\n for i := 0; i < n; i++ {\n if v[i] > c[i] {\n res += v[i] - c[i]\n }\n }\n fmt.Println(res)\n}", "language": "Go", "metadata": {"date": 1588147121, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03060.html", "problem_id": "p03060", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03060/input.txt", "sample_output_relpath": "derived/input_output/data/p03060/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03060/Go/s206091396.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s206091396", "user_id": "u254871849"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int \n fmt.Scan(&n)\n res := 0\n v := make([]int, n)\n c := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&v[i])\n }\n for i := 0; i < n; i++ {\n fmt.Scan(&c[i])\n }\n for i := 0; i < n; i++ {\n if v[i] > c[i] {\n res += v[i] - c[i]\n }\n }\n fmt.Println(res)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N gems. The value of the i-th gem is V_i.\n\nYou will choose some of these gems, possibly all or none, and get them.\n\nHowever, you need to pay a cost of C_i to get the i-th gem.\n\nLet X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.\n\nFind the maximum possible value of X-Y.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq C_i, V_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nV_1 V_2 ... V_N\nC_1 C_2 ... C_N\n\nOutput\n\nPrint the maximum possible value of X-Y.\n\nSample Input 1\n\n3\n10 2 5\n6 3 4\n\nSample Output 1\n\n5\n\nIf we choose the first and third gems, X = 10 + 5 = 15 and Y = 6 + 4 = 10.\nWe have X-Y = 5 here, which is the maximum possible value.\n\nSample Input 2\n\n4\n13 21 6 19\n11 30 6 15\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1\n1\n50\n\nSample Output 3\n\n0", "sample_input": "3\n10 2 5\n6 3 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03060", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N gems. The value of the i-th gem is V_i.\n\nYou will choose some of these gems, possibly all or none, and get them.\n\nHowever, you need to pay a cost of C_i to get the i-th gem.\n\nLet X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.\n\nFind the maximum possible value of X-Y.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq C_i, V_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nV_1 V_2 ... V_N\nC_1 C_2 ... C_N\n\nOutput\n\nPrint the maximum possible value of X-Y.\n\nSample Input 1\n\n3\n10 2 5\n6 3 4\n\nSample Output 1\n\n5\n\nIf we choose the first and third gems, X = 10 + 5 = 15 and Y = 6 + 4 = 10.\nWe have X-Y = 5 here, which is the maximum possible value.\n\nSample Input 2\n\n4\n13 21 6 19\n11 30 6 15\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1\n1\n50\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 336, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s636650149", "group_id": "codeNet:p03062", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tA := getIntArray(N)\n\n\ttotal := 0\n\tmin := pow(10, 6)\n\tmCnt := 0\n\tfor i := 0; i < N; i++ {\n\t\ttotal += abs(A[i])\n\n\t\tif abs(A[i]) < min {\n\t\t\tmin = abs(A[i])\n\t\t}\n\n\t\tif A[i] < 0 {\n\t\t\tmCnt++\n\t\t}\n\t}\n\tif mCnt % 2 == 1 {\n\t\ttotal -= min*2\n\t}\n\tfmt.Println(total)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1586835991, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03062.html", "problem_id": "p03062", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03062/input.txt", "sample_output_relpath": "derived/input_output/data/p03062/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03062/Go/s636650149.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s636650149", "user_id": "u964273035"}, "prompt_components": {"gold_output": "19\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tA := getIntArray(N)\n\n\ttotal := 0\n\tmin := pow(10, 6)\n\tmCnt := 0\n\tfor i := 0; i < N; i++ {\n\t\ttotal += abs(A[i])\n\n\t\tif abs(A[i]) < min {\n\t\t\tmin = abs(A[i])\n\t\t}\n\n\t\tif A[i] < 0 {\n\t\t\tmCnt++\n\t\t}\n\t}\n\tif mCnt % 2 == 1 {\n\t\ttotal -= min*2\n\t}\n\tfmt.Println(total)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, arranged in a row in this order.\n\nYou can perform the following operation on this integer sequence any number of times:\n\nOperation: Choose an integer i satisfying 1 \\leq i \\leq N-1. Multiply both A_i and A_{i+1} by -1.\n\nLet B_1, B_2, ..., B_N be the integer sequence after your operations.\n\nFind the maximum possible value of B_1 + B_2 + ... + B_N.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n-10^9 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value of B_1 + B_2 + ... + B_N.\n\nSample Input 1\n\n3\n-10 5 -4\n\nSample Output 1\n\n19\n\nIf we perform the operation as follows:\n\nChoose 1 as i, which changes the sequence to 10, -5, -4.\n\nChoose 2 as i, which changes the sequence to 10, 5, 4.\n\nwe have B_1 = 10, B_2 = 5, B_3 = 4. The sum here, B_1 + B_2 + B_3 = 10 + 5 + 4 = 19, is the maximum possible result.\n\nSample Input 2\n\n5\n10 -4 -8 -11 3\n\nSample Output 2\n\n30\n\nSample Input 3\n\n11\n-1000000000 1000000000 -1000000000 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000000\n\nSample Output 3\n\n10000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "3\n-10 5 -4\n"}, "reference_outputs": ["19\n"], "source_document_id": "p03062", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, arranged in a row in this order.\n\nYou can perform the following operation on this integer sequence any number of times:\n\nOperation: Choose an integer i satisfying 1 \\leq i \\leq N-1. Multiply both A_i and A_{i+1} by -1.\n\nLet B_1, B_2, ..., B_N be the integer sequence after your operations.\n\nFind the maximum possible value of B_1 + B_2 + ... + B_N.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n-10^9 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible value of B_1 + B_2 + ... + B_N.\n\nSample Input 1\n\n3\n-10 5 -4\n\nSample Output 1\n\n19\n\nIf we perform the operation as follows:\n\nChoose 1 as i, which changes the sequence to 10, -5, -4.\n\nChoose 2 as i, which changes the sequence to 10, 5, 4.\n\nwe have B_1 = 10, B_2 = 5, B_3 = 4. The sum here, B_1 + B_2 + B_3 = 10 + 5 + 4 = 19, is the maximum possible result.\n\nSample Input 2\n\n5\n10 -4 -8 -11 3\n\nSample Output 2\n\n30\n\nSample Input 3\n\n11\n-1000000000 1000000000 -1000000000 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000000\n\nSample Output 3\n\n10000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5280, "cpu_time_ms": 29, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s859750507", "group_id": "codeNet:p03068", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, S, K := ReadInt(), ReadString(), ReadInt()\n\tc := S[K-1]\n\tv := make([]byte, N)\n\tfor i := 0; i < N; i++ {\n\t\tv[i] = S[i]\n\t\tif v[i] != c {\n\t\t\tv[i] = '*'\n\t\t}\n\t}\n\tfmt.Println(string(v))\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1593739617, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03068.html", "problem_id": "p03068", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03068/input.txt", "sample_output_relpath": "derived/input_output/data/p03068/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03068/Go/s859750507.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s859750507", "user_id": "u328656362"}, "prompt_components": {"gold_output": "*rr*r\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, S, K := ReadInt(), ReadString(), ReadInt()\n\tc := S[K-1]\n\tv := make([]byte, N)\n\tfor i := 0; i < N; i++ {\n\t\tv[i] = S[i]\n\t\tif v[i] != c {\n\t\t\tv[i] = '*'\n\t\t}\n\t}\n\tfmt.Println(string(v))\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "sample_input": "5\nerror\n2\n"}, "reference_outputs": ["*rr*r\n"], "source_document_id": "p03068", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 594, "cpu_time_ms": 3, "memory_kb": 1840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s959797053", "group_id": "codeNet:p03068", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc main() {\n\t_ = readLine()\n\ts := strings.Split(readLine(), \"\")\n\tk, _ := strconv.Atoi(readLine())\n\n\tmatch := s[k-1]\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] != match {\n\t\t\tfmt.Print(\"*\")\n\t\t} else {\n\t\t\tfmt.Print(s[i])\n\t\t}\n\t}\n\n\tfmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1555809272, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03068.html", "problem_id": "p03068", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03068/input.txt", "sample_output_relpath": "derived/input_output/data/p03068/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03068/Go/s959797053.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s959797053", "user_id": "u468482169"}, "prompt_components": {"gold_output": "*rr*r\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc main() {\n\t_ = readLine()\n\ts := strings.Split(readLine(), \"\")\n\tk, _ := strconv.Atoi(readLine())\n\n\tmatch := s[k-1]\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] != match {\n\t\t\tfmt.Print(\"*\")\n\t\t} else {\n\t\t\tfmt.Print(s[i])\n\t\t}\n\t}\n\n\tfmt.Println()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "sample_input": "5\nerror\n2\n"}, "reference_outputs": ["*rr*r\n"], "source_document_id": "p03068", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 560, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s119382336", "group_id": "codeNet:p03069", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\tvar sum int\n\tfor i := n - 1; i >= 1; i-- {\n\t\tif s[i:i+1] == \".\" {\n\t\t\tif s[i-1:i] == \"#\" {\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1555809455, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03069.html", "problem_id": "p03069", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03069/input.txt", "sample_output_relpath": "derived/input_output/data/p03069/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03069/Go/s119382336.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s119382336", "user_id": "u375977529"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\tvar sum int\n\tfor i := n - 1; i >= 1; i-- {\n\t\tif s[i:i+1] == \".\" {\n\t\t\tif s[i-1:i] == \"#\" {\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N stones arranged in a row. Every stone is painted white or black.\nA string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is ., and the stone is black if the character is #.\n\nTakahashi wants to change the colors of some stones to black or white so that there will be no white stone immediately to the right of a black stone.\nFind the minimum number of stones that needs to be recolored.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS is a string of length N consisting of . and #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of stones that needs to be recolored.\n\nSample Input 1\n\n3\n#.#\n\nSample Output 1\n\n1\n\nIt is enough to change the color of the first stone to white.\n\nSample Input 2\n\n5\n#.##.\n\nSample Output 2\n\n2\n\nSample Input 3\n\n9\n.........\n\nSample Output 3\n\n0", "sample_input": "3\n#.#\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03069", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N stones arranged in a row. Every stone is painted white or black.\nA string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is ., and the stone is black if the character is #.\n\nTakahashi wants to change the colors of some stones to black or white so that there will be no white stone immediately to the right of a black stone.\nFind the minimum number of stones that needs to be recolored.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS is a string of length N consisting of . and #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of stones that needs to be recolored.\n\nSample Input 1\n\n3\n#.#\n\nSample Output 1\n\n1\n\nIt is enough to change the color of the first stone to white.\n\nSample Input 2\n\n5\n#.##.\n\nSample Output 2\n\n2\n\nSample Input 3\n\n9\n.........\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 218, "cpu_time_ms": 117, "memory_kb": 1920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s464613836", "group_id": "codeNet:p03071", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta := readInt()\n\tb := readInt()\n\tif a == b {\n\t\tfmt.Println(a + b)\n\t} else if a > b {\n\t\tfmt.Println(a + (a - 1))\n\t} else {\n\t\tfmt.Println(b + (b - 1))\n\t}\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt() int {\n\ti, e := strconv.Atoi(read())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1564696732, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/Go/s464613836.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s464613836", "user_id": "u985732221"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta := readInt()\n\tb := readInt()\n\tif a == b {\n\t\tfmt.Println(a + b)\n\t} else if a > b {\n\t\tfmt.Println(a + (a - 1))\n\t} else {\n\t\tfmt.Println(b + (b - 1))\n\t}\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt() int {\n\ti, e := strconv.Atoi(read())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 437, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s711453427", "group_id": "codeNet:p03071", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nvar (\n a,b,x,y int\n)\n\nfunc main() {\n fmt.Scanf(\"%d%d\",&a,&b)\n if a > b {\n x = a\n a--\n } else {\n x = b\n b--\n }\n if a > b {\n y = a\n a--\n } else {\n y = b\n b--\n }\n fmt.Println(x + y)\n}", "language": "Go", "metadata": {"date": 1555184369, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/Go/s711453427.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s711453427", "user_id": "u568763892"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nvar (\n a,b,x,y int\n)\n\nfunc main() {\n fmt.Scanf(\"%d%d\",&a,&b)\n if a > b {\n x = a\n a--\n } else {\n x = b\n b--\n }\n if a > b {\n y = a\n a--\n } else {\n y = b\n b--\n }\n fmt.Println(x + y)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 247, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s607249530", "group_id": "codeNet:p03071", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n)\n\nfunc main() {\n\n\tvar A, B int //\n\tvar result int\n\n\t\t_, err := fmt.Scan(&A, &B)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tif A == B{\n\t\t\tresult = A + B\n\t\t}else{\n\t\t\tresult = int(math.Max(float64(A),float64(B))) * 2 - 1\n\t\t}\n\n\t\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1555182656, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/Go/s607249530.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s607249530", "user_id": "u261629974"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n)\n\nfunc main() {\n\n\tvar A, B int //\n\tvar result int\n\n\t\t_, err := fmt.Scan(&A, &B)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tif A == B{\n\t\t\tresult = A + B\n\t\t}else{\n\t\t\tresult = int(math.Max(float64(A),float64(B))) * 2 - 1\n\t\t}\n\n\t\tfmt.Println(result)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 293, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s996891864", "group_id": "codeNet:p03071", "input_text": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a == b {\n\t\tfmt.Println(2 * a)\n\t} else {\n\t\tfmt.Println(2*max(a, b) - 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1555182255, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/Go/s996891864.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s996891864", "user_id": "u113872560"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a == b {\n\t\tfmt.Println(2 * a)\n\t} else {\n\t\tfmt.Println(2*max(a, b) - 1)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 218, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s668790703", "group_id": "codeNet:p03073", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, 10000)\n\tsc.Buffer(buf, 100000+1024)\n\n\ts := readLine(sc)\n\tsInts := strings.Split(s, \"\")\n\n\toutputValue := 0\n\tvar tileColorNumber string\n\n\tfor index, sInt := range sInts {\n\t\tif index == 0 {\n\t\t\ttileColorNumber = sInt\n\t\t\tcontinue\n\t\t}\n\n\t\tif tileColorNumber == sInt {\n\t\t\toutputValue++\n\t\t\tif tileColorNumber == \"0\" {\n\t\t\t\ttileColorNumber = \"1\"\n\t\t\t} else {\n\t\t\t\ttileColorNumber = \"0\"\n\t\t\t}\n\t\t} else {\n\t\t\ttileColorNumber = sInt\n\t\t}\n\t}\n\n\tfmt.Println(outputValue)\n}\n\n// helper\n\nfunc readLine(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn strings.TrimSpace(sc.Text())\n}\n\nfunc readLineToInt(sc *bufio.Scanner) int {\n\tintValue, err := strconv.Atoi(readLine(sc))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn intValue\n}\n\nfunc explodeString(delimiter string, inputValue string) []string {\n\tsplittedValue := strings.Split(inputValue, delimiter)\n\n\tvar trimmedValues []string\n\n\tfor _, value := range splittedValue {\n\t\tif value != \"\" {\n\t\t\ttrimmedValues = append(trimmedValues, value)\n\t\t}\n\t}\n\n\treturn trimmedValues\n}\n\nfunc explodeInt(delimiter string, inputValue string) []int {\n\tinputStrings := explodeString(\" \", inputValue)\n\n\tvar splittedInts []int\n\n\tfor _, inputString := range inputStrings {\n\t\tvar (\n\t\t\tintValue int\n\t\t\terr error\n\t\t)\n\t\tintValue, err = strconv.Atoi(inputString)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tsplittedInts = append(splittedInts, intValue)\n\t}\n\n\treturn splittedInts\n}\n", "language": "Go", "metadata": {"date": 1555421951, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03073.html", "problem_id": "p03073", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03073/input.txt", "sample_output_relpath": "derived/input_output/data/p03073/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03073/Go/s668790703.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s668790703", "user_id": "u630561892"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, 10000)\n\tsc.Buffer(buf, 100000+1024)\n\n\ts := readLine(sc)\n\tsInts := strings.Split(s, \"\")\n\n\toutputValue := 0\n\tvar tileColorNumber string\n\n\tfor index, sInt := range sInts {\n\t\tif index == 0 {\n\t\t\ttileColorNumber = sInt\n\t\t\tcontinue\n\t\t}\n\n\t\tif tileColorNumber == sInt {\n\t\t\toutputValue++\n\t\t\tif tileColorNumber == \"0\" {\n\t\t\t\ttileColorNumber = \"1\"\n\t\t\t} else {\n\t\t\t\ttileColorNumber = \"0\"\n\t\t\t}\n\t\t} else {\n\t\t\ttileColorNumber = sInt\n\t\t}\n\t}\n\n\tfmt.Println(outputValue)\n}\n\n// helper\n\nfunc readLine(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn strings.TrimSpace(sc.Text())\n}\n\nfunc readLineToInt(sc *bufio.Scanner) int {\n\tintValue, err := strconv.Atoi(readLine(sc))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn intValue\n}\n\nfunc explodeString(delimiter string, inputValue string) []string {\n\tsplittedValue := strings.Split(inputValue, delimiter)\n\n\tvar trimmedValues []string\n\n\tfor _, value := range splittedValue {\n\t\tif value != \"\" {\n\t\t\ttrimmedValues = append(trimmedValues, value)\n\t\t}\n\t}\n\n\treturn trimmedValues\n}\n\nfunc explodeInt(delimiter string, inputValue string) []int {\n\tinputStrings := explodeString(\" \", inputValue)\n\n\tvar splittedInts []int\n\n\tfor _, inputString := range inputStrings {\n\t\tvar (\n\t\t\tintValue int\n\t\t\terr error\n\t\t)\n\t\tintValue, err = strconv.Atoi(inputString)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tsplittedInts = append(splittedInts, intValue)\n\t}\n\n\treturn splittedInts\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03073", "source_text": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1510, "cpu_time_ms": 5, "memory_kb": 2560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s405579912", "group_id": "codeNet:p03073", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar text string\n\tfmt.Scan(&text)\n\n\tvar E0, E1, O0, O1 int\n\tfor i, t := range text {\n\t\tif i%2 == 0 {\n\t\t\tif t == '0' {\n\t\t\t\tE0++\n\t\t\t} else {\n\t\t\t\tE1++\n\t\t\t}\n\t\t} else {\n\t\t\tif t == '0' {\n\t\t\t\tO0++\n\t\t\t} else {\n\t\t\t\tO1++\n\t\t\t}\n\t\t}\n\t}\n//\tfmt.Println(min(E0+O1, E1+O0))\nif \tE0+O1 < E1+O0 {\n\tfmt.Println(E0+O1)\n\t}else {\n\tfmt.Println(E1+O0)\n}\n\n\n\n}\n\n/*\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n*/\n", "language": "Go", "metadata": {"date": 1555330306, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03073.html", "problem_id": "p03073", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03073/input.txt", "sample_output_relpath": "derived/input_output/data/p03073/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03073/Go/s405579912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s405579912", "user_id": "u017421706"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar text string\n\tfmt.Scan(&text)\n\n\tvar E0, E1, O0, O1 int\n\tfor i, t := range text {\n\t\tif i%2 == 0 {\n\t\t\tif t == '0' {\n\t\t\t\tE0++\n\t\t\t} else {\n\t\t\t\tE1++\n\t\t\t}\n\t\t} else {\n\t\t\tif t == '0' {\n\t\t\t\tO0++\n\t\t\t} else {\n\t\t\t\tO1++\n\t\t\t}\n\t\t}\n\t}\n//\tfmt.Println(min(E0+O1, E1+O0))\nif \tE0+O1 < E1+O0 {\n\tfmt.Println(E0+O1)\n\t}else {\n\tfmt.Println(E1+O0)\n}\n\n\n\n}\n\n/*\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n*/\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03073", "source_text": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 450, "cpu_time_ms": 55, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s728849727", "group_id": "codeNet:p03073", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Buffer(make([]byte, 101000), 101000)\n}\n\nfunc rb() []byte {\n\tsc.Scan()\n\treturn sc.Bytes()\n}\n\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\ts := rb()\n\n\tx := 0\n\tfor i, v := range s {\n\t\tif i&1 == 0 && v == '0' { // Odd\n\t\t\tx++\n\t\t} else if i&1 != 0 && v == '1' {\n\t\t\tx++\n\t\t}\n\t}\n\n\ty := 0\n\tfor i, v := range s {\n\t\tif i&1 == 0 && v == '1' { // Odd\n\t\t\ty++\n\t\t} else if i&1 != 0 && v == '0' {\n\t\t\ty++\n\t\t}\n\t}\n\n\tfmt.Println(smaller(x, y))\n}\n", "language": "Go", "metadata": {"date": 1555183648, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03073.html", "problem_id": "p03073", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03073/input.txt", "sample_output_relpath": "derived/input_output/data/p03073/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03073/Go/s728849727.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s728849727", "user_id": "u554269352"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Buffer(make([]byte, 101000), 101000)\n}\n\nfunc rb() []byte {\n\tsc.Scan()\n\treturn sc.Bytes()\n}\n\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\ts := rb()\n\n\tx := 0\n\tfor i, v := range s {\n\t\tif i&1 == 0 && v == '0' { // Odd\n\t\t\tx++\n\t\t} else if i&1 != 0 && v == '1' {\n\t\t\tx++\n\t\t}\n\t}\n\n\ty := 0\n\tfor i, v := range s {\n\t\tif i&1 == 0 && v == '1' { // Odd\n\t\t\ty++\n\t\t} else if i&1 != 0 && v == '0' {\n\t\t\ty++\n\t\t}\n\t}\n\n\tfmt.Println(smaller(x, y))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03073", "source_text": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 565, "cpu_time_ms": 2, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s645686557", "group_id": "codeNet:p03074", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc maxInt(a, b int) int {\n\tswitch {\n\tcase a >= b:\n\t\treturn a\n\tdefault:\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tvar n, k int\n\tvar str string\n\tfmt.Scan(&n, &k, &str)\n\n\tvar partLength []int\n\tprevChar := str[0:1]\n\tcnt := 1\n\tfor i := 1; i < n; i++ {\n\t\tif str[i:i+1] == prevChar {\n\t\t\tcnt++\n\t\t} else {\n\t\t\tpartLength = append(partLength, cnt)\n\t\t\tprevChar = str[i : i+1]\n\t\t\tcnt = 1\n\t\t}\n\t}\n\tpartLength = append(partLength, cnt)\n\n\tvar cumSum []int\n\tcumSum = append(cumSum, 0)\n\tfor i := range partLength {\n\t\tcumSum = append(cumSum, cumSum[i]+partLength[i])\n\t}\n\tif str[0:1] == \"0\" {\n\t\tcumSum = append([]int{0}, cumSum...)\n\t}\n\tif str[n-1:n] == \"0\" {\n\t\tcumSum = append(cumSum, n)\n\t}\n\n\tif len(cumSum) <= 2*k+2 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tmaxRet := 0\n\t\tfor i := 0; i < len(cumSum)-(2*k+1); i += 2 {\n\t\t\tmaxRet = maxInt(maxRet, cumSum[i+(2*k+1)]-cumSum[i])\n\t\t}\n\t\tfmt.Println(maxRet)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1555321347, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03074/input.txt", "sample_output_relpath": "derived/input_output/data/p03074/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03074/Go/s645686557.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s645686557", "user_id": "u712822150"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc maxInt(a, b int) int {\n\tswitch {\n\tcase a >= b:\n\t\treturn a\n\tdefault:\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tvar n, k int\n\tvar str string\n\tfmt.Scan(&n, &k, &str)\n\n\tvar partLength []int\n\tprevChar := str[0:1]\n\tcnt := 1\n\tfor i := 1; i < n; i++ {\n\t\tif str[i:i+1] == prevChar {\n\t\t\tcnt++\n\t\t} else {\n\t\t\tpartLength = append(partLength, cnt)\n\t\t\tprevChar = str[i : i+1]\n\t\t\tcnt = 1\n\t\t}\n\t}\n\tpartLength = append(partLength, cnt)\n\n\tvar cumSum []int\n\tcumSum = append(cumSum, 0)\n\tfor i := range partLength {\n\t\tcumSum = append(cumSum, cumSum[i]+partLength[i])\n\t}\n\tif str[0:1] == \"0\" {\n\t\tcumSum = append([]int{0}, cumSum...)\n\t}\n\tif str[n-1:n] == \"0\" {\n\t\tcumSum = append(cumSum, n)\n\t}\n\n\tif len(cumSum) <= 2*k+2 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tmaxRet := 0\n\t\tfor i := 0; i < len(cumSum)-(2*k+1); i += 2 {\n\t\t\tmaxRet = maxInt(maxRet, cumSum[i+(2*k+1)]-cumSum[i])\n\t\t}\n\t\tfmt.Println(maxRet)\n\t}\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "sample_input": "5 1\n00010\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03074", "source_text": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 900, "cpu_time_ms": 60, "memory_kb": 7296}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s984746741", "group_id": "codeNet:p03074", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\tvar input string\n\tfmt.Scan(&input)\n\tinputRune := []rune(input)\n\n\tfb := inputRune[0] == []rune(\"0\")[0]\n\tlines := make([]int, 0)\n\tfor i := 0; i < n; i++ {\n\t\tif len(lines) == 0 || inputRune[i-1] != inputRune[i] {\n\t\t\tlines = append(lines, 0)\n\t\t}\n\t\tlines[len(lines)-1] += 1\n\t}\n\n\tvar output int\n\tlineLength := len(lines)\n\n\tvar preValue int\n\tif fb {\n\t\t// indexが0の時を求める\n\t\tvar result int\n\t\tfor i := 0; i < 2*k; i++ {\n\t\t\tif i > lineLength {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tresult += lines[i]\n\t\t}\n\n\t\toutput = result\n\t\tpreValue = result\n\n\t\t// indexが0以上の時を求める\n\t\tfor i := 1; i*2-1 < lineLength; i++ {\n\t\t\tresult := preValue\n\n\t\t\t// 前のやつを引く\n\t\t\tfor j := 2*(i-1) - 1; j < 2*i-1; j++ {\n\t\t\t\tif j < 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tresult -= lines[j]\n\t\t\t}\n\n\t\t\t// 次のやつを足す\n\t\t\tfor j := 2 * (i - 1 + k); j <= 2*(i+k); j++ {\n\t\t\t\tif j >= len(lines) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tresult += lines[j]\n\t\t\t}\n\n\t\t\tif result > output {\n\t\t\t\toutput = result\n\t\t\t}\n\t\t\tpreValue = result\n\t\t}\n\t} else {\n\t\t// indexが0の時を求める\n\t\tvar result int\n\t\tfor j := 0; j <= k*2; j++ {\n\t\t\tif j >= lineLength {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tresult += lines[j]\n\t\t}\n\n\t\toutput = result\n\t\tpreValue = result\n\n\t\t// indexが0以上の時を求める\n\t\tfor i := 1; i*2 < lineLength; i++ {\n\t\t\tresult := preValue\n\n\t\t\t// 前のやつを引く\n\t\t\tfor j := 2 * (i - 1); j < 2*i; j++ {\n\t\t\t\tresult -= lines[j]\n\t\t\t}\n\n\t\t\t// 次のやつを引く\n\t\t\tfor j := 2*(i+k-1) + 1; j <= 2*(i+k); j++ {\n\t\t\t\tif j >= lineLength {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tresult += lines[j]\n\t\t\t}\n\n\t\t\tif result > output {\n\t\t\t\toutput = result\n\t\t\t}\n\t\t\tpreValue = result\n\t\t}\n\t}\n\tfmt.Println(output)\n}", "language": "Go", "metadata": {"date": 1555236630, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03074.html", "problem_id": "p03074", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03074/input.txt", "sample_output_relpath": "derived/input_output/data/p03074/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03074/Go/s984746741.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s984746741", "user_id": "u876149922"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\tvar input string\n\tfmt.Scan(&input)\n\tinputRune := []rune(input)\n\n\tfb := inputRune[0] == []rune(\"0\")[0]\n\tlines := make([]int, 0)\n\tfor i := 0; i < n; i++ {\n\t\tif len(lines) == 0 || inputRune[i-1] != inputRune[i] {\n\t\t\tlines = append(lines, 0)\n\t\t}\n\t\tlines[len(lines)-1] += 1\n\t}\n\n\tvar output int\n\tlineLength := len(lines)\n\n\tvar preValue int\n\tif fb {\n\t\t// indexが0の時を求める\n\t\tvar result int\n\t\tfor i := 0; i < 2*k; i++ {\n\t\t\tif i > lineLength {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tresult += lines[i]\n\t\t}\n\n\t\toutput = result\n\t\tpreValue = result\n\n\t\t// indexが0以上の時を求める\n\t\tfor i := 1; i*2-1 < lineLength; i++ {\n\t\t\tresult := preValue\n\n\t\t\t// 前のやつを引く\n\t\t\tfor j := 2*(i-1) - 1; j < 2*i-1; j++ {\n\t\t\t\tif j < 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tresult -= lines[j]\n\t\t\t}\n\n\t\t\t// 次のやつを足す\n\t\t\tfor j := 2 * (i - 1 + k); j <= 2*(i+k); j++ {\n\t\t\t\tif j >= len(lines) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tresult += lines[j]\n\t\t\t}\n\n\t\t\tif result > output {\n\t\t\t\toutput = result\n\t\t\t}\n\t\t\tpreValue = result\n\t\t}\n\t} else {\n\t\t// indexが0の時を求める\n\t\tvar result int\n\t\tfor j := 0; j <= k*2; j++ {\n\t\t\tif j >= lineLength {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tresult += lines[j]\n\t\t}\n\n\t\toutput = result\n\t\tpreValue = result\n\n\t\t// indexが0以上の時を求める\n\t\tfor i := 1; i*2 < lineLength; i++ {\n\t\t\tresult := preValue\n\n\t\t\t// 前のやつを引く\n\t\t\tfor j := 2 * (i - 1); j < 2*i; j++ {\n\t\t\t\tresult -= lines[j]\n\t\t\t}\n\n\t\t\t// 次のやつを引く\n\t\t\tfor j := 2*(i+k-1) + 1; j <= 2*(i+k); j++ {\n\t\t\t\tif j >= lineLength {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tresult += lines[j]\n\t\t\t}\n\n\t\t\tif result > output {\n\t\t\t\toutput = result\n\t\t\t}\n\t\t\tpreValue = result\n\t\t}\n\t}\n\tfmt.Println(output)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "sample_input": "5 1\n00010\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03074", "source_text": "Score : 400 points\n\nProblem Statement\n\nN people are arranged in a row from left to right.\n\nYou are given a string S of length N consisting of 0 and 1, and a positive integer K.\n\nThe i-th person from the left is standing on feet if the i-th character of S is 0, and standing on hands if that character is 1.\n\nYou will give the following direction at most K times (possibly zero):\n\nDirection: Choose integers l and r satisfying 1 \\leq l \\leq r \\leq N, and flip the l-th, (l+1)-th, ..., and r-th persons. That is, for each i = l, l+1, ..., r, the i-th person from the left now stands on hands if he/she was standing on feet, and stands on feet if he/she was standing on hands.\n\nFind the maximum possible number of consecutive people standing on hands after at most K directions.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^5.\n\nK is an integer satisfying 1 \\leq K \\leq 10^5.\n\nThe length of the string S is N.\n\nEach character of the string S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the maximum possible number of consecutive people standing on hands after at most K directions.\n\nSample Input 1\n\n5 1\n00010\n\nSample Output 1\n\n4\n\nWe can have four consecutive people standing on hands, which is the maximum result, by giving the following direction:\n\nGive the direction with l = 1, r = 3, which flips the first, second and third persons from the left.\n\nSample Input 2\n\n14 2\n11101010110011\n\nSample Output 2\n\n8\n\nSample Input 3\n\n1 1\n1\n\nSample Output 3\n\n1\n\nNo directions are necessary.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1715, "cpu_time_ms": 59, "memory_kb": 6400}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s562217580", "group_id": "codeNet:p03075", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b,c,d,e,k int\n\tfmt.Scan(&a,&b,&c,&d,&e,&k)\n\n\tif b - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if c - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if d - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if c - b >= k {\n\t\tfmt.Println(\":(\")\n\t} else if d - b >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - b >= k {\n\t\tfmt.Println(\":(\")\n\t} else if d - c >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - c >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - d >= k {\n\t\tfmt.Println(\":(\")\n\t} else {\n\t\tfmt.Println(\"Yay!\")\n\t}\n}", "language": "Go", "metadata": {"date": 1569477079, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/Go/s562217580.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s562217580", "user_id": "u390374229"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b,c,d,e,k int\n\tfmt.Scan(&a,&b,&c,&d,&e,&k)\n\n\tif b - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if c - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if d - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - a >= k {\n\t\tfmt.Println(\":(\")\n\t} else if c - b >= k {\n\t\tfmt.Println(\":(\")\n\t} else if d - b >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - b >= k {\n\t\tfmt.Println(\":(\")\n\t} else if d - c >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - c >= k {\n\t\tfmt.Println(\":(\")\n\t} else if e - d >= k {\n\t\tfmt.Println(\":(\")\n\t} else {\n\t\tfmt.Println(\"Yay!\")\n\t}\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 567, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s096905052", "group_id": "codeNet:p03075", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var (\n a,b,c,d,e,k int\n )\n fmt.Scan(&a,&b,&c,&d,&e,&k)\n\n if e - a <= k {\n fmt.Println(\":(\")\n } else {\n fmt.Println(\"Yay!\")\n }\n}", "language": "Go", "metadata": {"date": 1556263816, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/Go/s096905052.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s096905052", "user_id": "u985208127"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var (\n a,b,c,d,e,k int\n )\n fmt.Scan(&a,&b,&c,&d,&e,&k)\n\n if e - a <= k {\n fmt.Println(\":(\")\n } else {\n fmt.Println(\"Yay!\")\n }\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 195, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s892112649", "group_id": "codeNet:p03075", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc main() {\n anntenas := make([]int,5)\n \tfor i := 0; i< 5; i++{\n \tanntenas[i], _ = strconv.Atoi(nextLine())\n \t}\n dist, _ := strconv.Atoi(nextLine())\n sort.Sort(sort.IntSlice(anntenas))\n if (anntenas[len(anntenas)-1] - anntenas[0]) > dist {\n fmt.Println(\":(\")\n } else {\n fmt.Println(\"Yay!\")\n }\n}", "language": "Go", "metadata": {"date": 1554578006, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/Go/s892112649.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s892112649", "user_id": "u900615460"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc main() {\n anntenas := make([]int,5)\n \tfor i := 0; i< 5; i++{\n \tanntenas[i], _ = strconv.Atoi(nextLine())\n \t}\n dist, _ := strconv.Atoi(nextLine())\n sort.Sort(sort.IntSlice(anntenas))\n if (anntenas[len(anntenas)-1] - anntenas[0]) > dist {\n fmt.Println(\":(\")\n } else {\n fmt.Println(\"Yay!\")\n }\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 499, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s178618626", "group_id": "codeNet:p03076", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tarr := scanInts(5)\n\n\tans := 1 << 31-1\n\tpermutationSearch(5, func(a []int) {\n\t\tsum := 0\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tsum += ((arr[a[i]]+9)/10)*10\n\t\t}\n\t\tans = min(ans, sum+arr[a[4]])\n\t})\n\n\tfmt.Fprintln(wr, ans)\n}\n\n\nfunc permutationSearch(n int, fn func(a []int)) {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ { a[i] = i }\n\tswap := func(i,j int) { a[i],a[j] = a[j],a[i] }\n\n\tfn(a)\n\tfor i := n-2; i >= 0; i-- {\n\t\tif a[i] > a[i+1] { continue }\n\t\tfor j := n-1; j >= 0; j-- {\n\t\t\tif a[i] > a[j] { continue }\n\t\t\tswap(i,j)\n\t\t\tfor k := i+1; k < (n+i+1)/2; k++ { swap(k,n-(k-i)) }\n\t\t\tfn(a)\n\t\t\ti = n-1\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584311160, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03076.html", "problem_id": "p03076", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03076/input.txt", "sample_output_relpath": "derived/input_output/data/p03076/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03076/Go/s178618626.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s178618626", "user_id": "u548992197"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tarr := scanInts(5)\n\n\tans := 1 << 31-1\n\tpermutationSearch(5, func(a []int) {\n\t\tsum := 0\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tsum += ((arr[a[i]]+9)/10)*10\n\t\t}\n\t\tans = min(ans, sum+arr[a[4]])\n\t})\n\n\tfmt.Fprintln(wr, ans)\n}\n\n\nfunc permutationSearch(n int, fn func(a []int)) {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ { a[i] = i }\n\tswap := func(i,j int) { a[i],a[j] = a[j],a[i] }\n\n\tfn(a)\n\tfor i := n-2; i >= 0; i-- {\n\t\tif a[i] > a[i+1] { continue }\n\t\tfor j := n-1; j >= 0; j-- {\n\t\t\tif a[i] > a[j] { continue }\n\t\t\tswap(i,j)\n\t\t\tfor k := i+1; k < (n+i+1)/2; k++ { swap(k,n-(k-i)) }\n\t\t\tfn(a)\n\t\t\ti = n-1\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "sample_input": "29\n20\n7\n35\n120\n"}, "reference_outputs": ["215\n"], "source_document_id": "p03076", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1602, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s697303122", "group_id": "codeNet:p03076", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// var a, b, c, d, e int\n\t// fmt.Scan(&a, &b, &c, &d, &e)\n\tts := make([]int, 5)\n\tfor i := 0; i < 5; i++ {\n\t\tfmt.Scan(&ts[i])\n\t}\n\n\tmin := 10\n\tsum := 0\n\tfor i := 0; i < 5; i++ {\n\t\tt := (ts[i] % 10)\n\t\tif t != 0 && t < min {\n\t\t\tmin = t\n\t\t}\n\t\tif t == 0 {\n\t\t\tsum += ts[i]\n\t\t} else {\n\t\t\tsum += ts[i] + 10 - t\n\t\t}\n\t}\n\tsum = sum - (10 - min)\n\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1576945387, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03076.html", "problem_id": "p03076", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03076/input.txt", "sample_output_relpath": "derived/input_output/data/p03076/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03076/Go/s697303122.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s697303122", "user_id": "u303616227"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// var a, b, c, d, e int\n\t// fmt.Scan(&a, &b, &c, &d, &e)\n\tts := make([]int, 5)\n\tfor i := 0; i < 5; i++ {\n\t\tfmt.Scan(&ts[i])\n\t}\n\n\tmin := 10\n\tsum := 0\n\tfor i := 0; i < 5; i++ {\n\t\tt := (ts[i] % 10)\n\t\tif t != 0 && t < min {\n\t\t\tmin = t\n\t\t}\n\t\tif t == 0 {\n\t\t\tsum += ts[i]\n\t\t} else {\n\t\t\tsum += ts[i] + 10 - t\n\t\t}\n\t}\n\tsum = sum - (10 - min)\n\n\tfmt.Println(sum)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "sample_input": "29\n20\n7\n35\n120\n"}, "reference_outputs": ["215\n"], "source_document_id": "p03076", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 402, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s395040488", "group_id": "codeNet:p03076", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, p int\n\tsum := 0\n\tmax := 0\n\tfor i := 0; i < 5; i++ {\n\t\tfmt.Scan(&x)\n\t\tsum += x\n\t\tif v := x % 10; v != 0 {\n\t\t\tp = 10 - v\n\t\t\tsum += p\n\t\t\tif p > max {\n\t\t\t\tmax = p\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum - max)\n}\n", "language": "Go", "metadata": {"date": 1556223623, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03076.html", "problem_id": "p03076", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03076/input.txt", "sample_output_relpath": "derived/input_output/data/p03076/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03076/Go/s395040488.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s395040488", "user_id": "u461993794"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, p int\n\tsum := 0\n\tmax := 0\n\tfor i := 0; i < 5; i++ {\n\t\tfmt.Scan(&x)\n\t\tsum += x\n\t\tif v := x % 10; v != 0 {\n\t\t\tp = 10 - v\n\t\t\tsum += p\n\t\t\tif p > max {\n\t\t\t\tmax = p\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum - max)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "sample_input": "29\n20\n7\n35\n120\n"}, "reference_outputs": ["215\n"], "source_document_id": "p03076", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 247, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s732205837", "group_id": "codeNet:p03077", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmin := int(1e16)\n\tfor i := 0 ; i < 5; i++{\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tif min > a {\n\t\t\tmin = a\n\t\t}\n\t}\n\tp := 0\n\tif n % min != 0 {\n\t\tp= 1\n\n\t}\n\n\tfmt.Println(n/min + 4+p)\n\n\n}\n\n", "language": "Go", "metadata": {"date": 1600376318, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/Go/s732205837.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s732205837", "user_id": "u769765274"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmin := int(1e16)\n\tfor i := 0 ; i < 5; i++{\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tif min > a {\n\t\t\tmin = a\n\t\t}\n\t}\n\tp := 0\n\tif n % min != 0 {\n\t\tp= 1\n\n\t}\n\n\tfmt.Println(n/min + 4+p)\n\n\n}\n\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 248, "cpu_time_ms": 7, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s487115553", "group_id": "codeNet:p03077", "input_text": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n \"math\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() int64 {\n sc.Scan()\n data, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return data\n}\n\nfunc main() {\n var num = nextLine()\n args := []int64{nextLine(),nextLine(),nextLine(),nextLine(),nextLine()}\n\n var max = num / args[0]\n for _, arg := range args {\n var value = int64(math.Ceil(float64(num) / float64(arg)))\n if value > max {\n max = value\n }\n }\n fmt.Println(max + 4)\n}\n\n", "language": "Go", "metadata": {"date": 1558004591, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/Go/s487115553.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s487115553", "user_id": "u946433121"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n \"math\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() int64 {\n sc.Scan()\n data, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return data\n}\n\nfunc main() {\n var num = nextLine()\n args := []int64{nextLine(),nextLine(),nextLine(),nextLine(),nextLine()}\n\n var max = num / args[0]\n for _, arg := range args {\n var value = int64(math.Ceil(float64(num) / float64(arg)))\n if value > max {\n max = value\n }\n }\n fmt.Println(max + 4)\n}\n\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 515, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s533772814", "group_id": "codeNet:p03078", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tX := scanInt()\n\tY := scanInt()\n\tZ := scanInt()\n\tK := scanInt()\n\ta := scanInts(X)\n\tb := scanInts(Y)\n\tc := scanInts(Z)\n\n\tbc := make([]int, Y*Z)\n\tfor i := 0; i < Y; i++ {\n\t\tfor j := 0; j < Z; j++ {\n\t\t\tbc[i*Z+j] = b[i] + c[j]\n\t\t}\n\t}\n\n\tsort.Ints(bc)\n\n\tn := Y * Z\n\tl, r := 0, 1<<40\n\tfor l+1 < r {\n\t\tmid := (l + r) / 2\n\t\tcnt := 0\n\t\tfor i := 0; i < X; i++ {\n\t\t\tcnt += n - sort.Search(n, func(j int) bool {\n\t\t\t\treturn mid <= a[i]+bc[j]\n\t\t\t})\n\t\t}\n\n\t\tif cnt >= K {\n\t\t\tl = mid\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tarr := []int{}\n\n\tfor i := 0; i < X; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[i]+bc[n-1-j] < l {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tarr = append(arr, a[i]+bc[n-1-j])\n\t\t}\n\t}\n\n\tsort.Ints(arr)\n\n\tfor i := 0; i < K; i++ {\n\t\tfmt.Fprintln(wr, arr[K-1-i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586640062, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03078.html", "problem_id": "p03078", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03078/input.txt", "sample_output_relpath": "derived/input_output/data/p03078/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03078/Go/s533772814.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s533772814", "user_id": "u548992197"}, "prompt_components": {"gold_output": "19\n17\n15\n14\n13\n12\n10\n8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tX := scanInt()\n\tY := scanInt()\n\tZ := scanInt()\n\tK := scanInt()\n\ta := scanInts(X)\n\tb := scanInts(Y)\n\tc := scanInts(Z)\n\n\tbc := make([]int, Y*Z)\n\tfor i := 0; i < Y; i++ {\n\t\tfor j := 0; j < Z; j++ {\n\t\t\tbc[i*Z+j] = b[i] + c[j]\n\t\t}\n\t}\n\n\tsort.Ints(bc)\n\n\tn := Y * Z\n\tl, r := 0, 1<<40\n\tfor l+1 < r {\n\t\tmid := (l + r) / 2\n\t\tcnt := 0\n\t\tfor i := 0; i < X; i++ {\n\t\t\tcnt += n - sort.Search(n, func(j int) bool {\n\t\t\t\treturn mid <= a[i]+bc[j]\n\t\t\t})\n\t\t}\n\n\t\tif cnt >= K {\n\t\t\tl = mid\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tarr := []int{}\n\n\tfor i := 0; i < X; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[i]+bc[n-1-j] < l {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tarr = append(arr, a[i]+bc[n-1-j])\n\t\t}\n\t}\n\n\tsort.Ints(arr)\n\n\tfor i := 0; i < K; i++ {\n\t\tfmt.Fprintln(wr, arr[K-1-i])\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "2 2 2 8\n4 6\n1 5\n3 8\n"}, "reference_outputs": ["19\n17\n15\n14\n13\n12\n10\n8\n"], "source_document_id": "p03078", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1778, "cpu_time_ms": 354, "memory_kb": 270848}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s107799601", "group_id": "codeNet:p03078", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar x, y, z, k int\n\tfmt.Scan(&x, &y, &z, &k)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tas := make([]int, x)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(as)))\n\tbs := make([]int, y)\n\tfor i := range bs {\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(bs)))\n\tcs := make([]int, z)\n\tfor i := range cs {\n\t\tsc.Scan()\n\t\tcs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(cs)))\n\n\tans := make([]int, 0, x+y+z)\n\tfor ia, a := range as {\n\t\tfor ib, b := range bs {\n\t\t\tfor ic, c := range cs {\n\t\t\t\tif (ia+1)*(ib+1)*(ic+1) > k {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tans = append(ans, a+b+c)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ans)))\n\tfor _, v := range ans[:k] {\n\t\tfmt.Println(v)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1559890780, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03078.html", "problem_id": "p03078", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03078/input.txt", "sample_output_relpath": "derived/input_output/data/p03078/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03078/Go/s107799601.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s107799601", "user_id": "u461993794"}, "prompt_components": {"gold_output": "19\n17\n15\n14\n13\n12\n10\n8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar x, y, z, k int\n\tfmt.Scan(&x, &y, &z, &k)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tas := make([]int, x)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(as)))\n\tbs := make([]int, y)\n\tfor i := range bs {\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(bs)))\n\tcs := make([]int, z)\n\tfor i := range cs {\n\t\tsc.Scan()\n\t\tcs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(cs)))\n\n\tans := make([]int, 0, x+y+z)\n\tfor ia, a := range as {\n\t\tfor ib, b := range bs {\n\t\t\tfor ic, c := range cs {\n\t\t\t\tif (ia+1)*(ib+1)*(ic+1) > k {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tans = append(ans, a+b+c)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ans)))\n\tfor _, v := range ans[:k] {\n\t\tfmt.Println(v)\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "2 2 2 8\n4 6\n1 5\n3 8\n"}, "reference_outputs": ["19\n17\n15\n14\n13\n12\n10\n8\n"], "source_document_id": "p03078", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 902, "cpu_time_ms": 56, "memory_kb": 5376}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s658179905", "group_id": "codeNet:p03078", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, z, k int\n\tfmt.Scan(&x, &y, &z, &k)\n\tar := make([]int, x)\n\tbr := make([]int, y)\n\tcr := make([]int, z)\n\tfor i := range ar {\n\t\tfmt.Scan(&ar[i])\n\t}\n\tfor i := range br {\n\t\tfmt.Scan(&br[i])\n\t}\n\tfor i := range cr {\n\t\tfmt.Scan(&cr[i])\n\t}\n\tmr := make([]int, 0, x*y*z)\n\tfor _, a := range ar {\n\t\tfor _, b := range br {\n\t\t\tfor _, c := range cr {\n\t\t\t\tmr = append(mr, a+b+c)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(mr)\n\tfor i := len(mr) - 1; i >= len(mr)-k; i-- {\n\t\tfmt.Println(mr[i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1554579607, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03078.html", "problem_id": "p03078", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03078/input.txt", "sample_output_relpath": "derived/input_output/data/p03078/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03078/Go/s658179905.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s658179905", "user_id": "u375977529"}, "prompt_components": {"gold_output": "19\n17\n15\n14\n13\n12\n10\n8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, z, k int\n\tfmt.Scan(&x, &y, &z, &k)\n\tar := make([]int, x)\n\tbr := make([]int, y)\n\tcr := make([]int, z)\n\tfor i := range ar {\n\t\tfmt.Scan(&ar[i])\n\t}\n\tfor i := range br {\n\t\tfmt.Scan(&br[i])\n\t}\n\tfor i := range cr {\n\t\tfmt.Scan(&cr[i])\n\t}\n\tmr := make([]int, 0, x*y*z)\n\tfor _, a := range ar {\n\t\tfor _, b := range br {\n\t\t\tfor _, c := range cr {\n\t\t\t\tmr = append(mr, a+b+c)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(mr)\n\tfor i := len(mr) - 1; i >= len(mr)-k; i-- {\n\t\tfmt.Println(mr[i])\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "2 2 2 8\n4 6\n1 5\n3 8\n"}, "reference_outputs": ["19\n17\n15\n14\n13\n12\n10\n8\n"], "source_document_id": "p03078", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 525, "cpu_time_ms": 817, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s598355978", "group_id": "codeNet:p03079", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\n\tif a*b*c == a*a*a {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}", "language": "Go", "metadata": {"date": 1553980601, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03079.html", "problem_id": "p03079", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03079/input.txt", "sample_output_relpath": "derived/input_output/data/p03079/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03079/Go/s598355978.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s598355978", "user_id": "u643520570"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\n\tif a*b*c == a*a*a {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\n\nDetermine if there exists an equilateral triangle whose sides have lengths A, B and C.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A,B,C \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf there exists an equilateral triangle whose sides have lengths A, B and C, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 2 2\n\nSample Output 1\n\nYes\n\nThere exists an equilateral triangle whose sides have lengths 2, 2 and 2.\n\nSample Input 2\n\n3 4 5\n\nSample Output 2\n\nNo\n\nThere is no equilateral triangle whose sides have lengths 3, 4 and 5.", "sample_input": "2 2 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03079", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\n\nDetermine if there exists an equilateral triangle whose sides have lengths A, B and C.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A,B,C \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf there exists an equilateral triangle whose sides have lengths A, B and C, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 2 2\n\nSample Output 1\n\nYes\n\nThere exists an equilateral triangle whose sides have lengths 2, 2 and 2.\n\nSample Input 2\n\n3 4 5\n\nSample Output 2\n\nNo\n\nThere is no equilateral triangle whose sides have lengths 3, 4 and 5.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 366, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s167002500", "group_id": "codeNet:p03086", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar charSet = []string{\n\t\"A\", \"C\", \"G\", \"T\",\n}\n\nfunc main() {\n\tS := nextString()\n\tl := len(S)\n\tans := 0\n\tcur := 0\n\tfor i := 0; i < l; i++ {\n\t\tif match(string(S[i])) {\n\t\t\tcur += 1\n\t\t} else {\n\t\t\tans = MaxIn2Values(ans, cur)\n\t\t\tcur = 0\n\t\t}\n\t\tif i == l-1 {\n\t\t\tans = MaxIn2Values(ans, cur)\n\t\t}\n\t}\n\tfmt.Printf(\"%v\", ans)\n}\n\nfunc match(s string) bool {\n\tfor _, v := range charSet {\n\t\tif v == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\n\nfunc nextString() string {\n\treturn nextReader()\n}\n\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\n\nfunc Min(a int, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc MaxIn2Values(a int, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinIn2Values(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1553459488, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03086.html", "problem_id": "p03086", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03086/input.txt", "sample_output_relpath": "derived/input_output/data/p03086/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03086/Go/s167002500.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s167002500", "user_id": "u187430339"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar charSet = []string{\n\t\"A\", \"C\", \"G\", \"T\",\n}\n\nfunc main() {\n\tS := nextString()\n\tl := len(S)\n\tans := 0\n\tcur := 0\n\tfor i := 0; i < l; i++ {\n\t\tif match(string(S[i])) {\n\t\t\tcur += 1\n\t\t} else {\n\t\t\tans = MaxIn2Values(ans, cur)\n\t\t\tcur = 0\n\t\t}\n\t\tif i == l-1 {\n\t\t\tans = MaxIn2Values(ans, cur)\n\t\t}\n\t}\n\tfmt.Printf(\"%v\", ans)\n}\n\nfunc match(s string) bool {\n\tfor _, v := range charSet {\n\t\tif v == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\n\nfunc nextString() string {\n\treturn nextReader()\n}\n\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\n\nfunc Min(a int, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc MaxIn2Values(a int, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinIn2Values(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "sample_input": "ATCODER\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03086", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1274, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s445957038", "group_id": "codeNet:p03086", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n S := scanString()\n max_substr_len := 0\n for i := 0; i <= len(S) - 1; i++ {\n for j := i; j <= len(S); j++ {\n substr := S[i:j]\n is_acgt := true\n for k := 0; k < len(substr); k++ {\n if substr[k] != 'A' && substr[k] != 'C' && substr[k] != 'G' && substr[k] != 'T' {\n is_acgt = false\n break\n }\n }\n if is_acgt {\n if max_substr_len < len(substr) {\n max_substr_len = len(substr)\n }\n }\n }\n }\n fmt.Println(max_substr_len)\n}\n\nfunc scanInt() (num int) {\n fmt.Scan(&num)\n return\n}\n\nfunc scanInts(len int) (nums []int) {\n var num int\n for i := 0; i < len; i++ {\n fmt.Scan(&num)\n nums = append(nums, num)\n }\n return\n}\n\nfunc scanString() (str string) {\n fmt.Scan(&str)\n return\n}\n\nfunc scanStrings(len int) (strs []string) {\n var str string\n for i := 0; i < len; i++ {\n fmt.Scan(&str)\n strs = append(strs, str)\n }\n return\n}", "language": "Go", "metadata": {"date": 1553458432, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03086.html", "problem_id": "p03086", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03086/input.txt", "sample_output_relpath": "derived/input_output/data/p03086/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03086/Go/s445957038.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s445957038", "user_id": "u975073965"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n S := scanString()\n max_substr_len := 0\n for i := 0; i <= len(S) - 1; i++ {\n for j := i; j <= len(S); j++ {\n substr := S[i:j]\n is_acgt := true\n for k := 0; k < len(substr); k++ {\n if substr[k] != 'A' && substr[k] != 'C' && substr[k] != 'G' && substr[k] != 'T' {\n is_acgt = false\n break\n }\n }\n if is_acgt {\n if max_substr_len < len(substr) {\n max_substr_len = len(substr)\n }\n }\n }\n }\n fmt.Println(max_substr_len)\n}\n\nfunc scanInt() (num int) {\n fmt.Scan(&num)\n return\n}\n\nfunc scanInts(len int) (nums []int) {\n var num int\n for i := 0; i < len; i++ {\n fmt.Scan(&num)\n nums = append(nums, num)\n }\n return\n}\n\nfunc scanString() (str string) {\n fmt.Scan(&str)\n return\n}\n\nfunc scanStrings(len int) (strs []string) {\n var str string\n for i := 0; i < len; i++ {\n fmt.Scan(&str)\n strs = append(strs, str)\n }\n return\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "sample_input": "ATCODER\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03086", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1132, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s121096094", "group_id": "codeNet:p03087", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc countAC(s string) int {\n\ta := strings.Split(s, \"\")\n\tcount := 0\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tif a[i] == \"A\" {\n\t\t\tif a[i+1] == \"C\" {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main() {\n\tvar n, q int\n\tvar s string\n\tvar l, r []int\n\n\tfmt.Scan(&n, &q, &s)\n\tfor i := 0; i < q*2; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\tif i%2 == 0 {\n\t\t\tl = append(l, tmp)\n\t\t} else {\n\t\t\tr = append(r, tmp)\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\ttarget := s[l[i]-1 : r[i]]\n\t\tres := countAC(target)\n\t\tfmt.Println(res)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587025307, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03087.html", "problem_id": "p03087", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03087/input.txt", "sample_output_relpath": "derived/input_output/data/p03087/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03087/Go/s121096094.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s121096094", "user_id": "u620351704"}, "prompt_components": {"gold_output": "2\n0\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc countAC(s string) int {\n\ta := strings.Split(s, \"\")\n\tcount := 0\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tif a[i] == \"A\" {\n\t\t\tif a[i+1] == \"C\" {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main() {\n\tvar n, q int\n\tvar s string\n\tvar l, r []int\n\n\tfmt.Scan(&n, &q, &s)\n\tfor i := 0; i < q*2; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\tif i%2 == 0 {\n\t\t\tl = append(l, tmp)\n\t\t} else {\n\t\t\tr = append(r, tmp)\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\ttarget := s[l[i]-1 : r[i]]\n\t\tres := countAC(target)\n\t\tfmt.Println(res)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "sample_input": "8 3\nACACTACG\n3 7\n2 3\n1 8\n"}, "reference_outputs": ["2\n0\n3\n"], "source_document_id": "p03087", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 550, "cpu_time_ms": 2112, "memory_kb": 14612}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s852153537", "group_id": "codeNet:p03087", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() []string {\n\tsc.Scan()\n\treturn strings.Split(sc.Text(), \" \")\n}\n\nfunc main() {\n\ttmp := nextLine()\n\tQ, _ := strconv.ParseInt(tmp[1], 10, 64)\n\n\tsc.Scan()\n\tS := sc.Text()\n\n\tfor i := int64(0); i < Q; i++ {\n\t\tsubS := \"\"\n\t\ttmp = nextLine()\n\t\tif len(tmp) < 2 {\n\t\t\tsubS = S\n\t\t} else if len(tmp) < 1 {\n\t\t\tpanic(\"none\")\n\t\t} else {\n\t\t\tl, _ := strconv.ParseInt(tmp[0], 10, 64)\n\t\t\tr, _ := strconv.ParseInt(tmp[1], 10, 64)\n\t\t\tsubS = S[l-1 : r]\n\t\t}\n\t\tfmt.Println(strings.Count(subS, \"AC\"))\n\t}\n}", "language": "Go", "metadata": {"date": 1559905538, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03087.html", "problem_id": "p03087", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03087/input.txt", "sample_output_relpath": "derived/input_output/data/p03087/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03087/Go/s852153537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s852153537", "user_id": "u085196910"}, "prompt_components": {"gold_output": "2\n0\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() []string {\n\tsc.Scan()\n\treturn strings.Split(sc.Text(), \" \")\n}\n\nfunc main() {\n\ttmp := nextLine()\n\tQ, _ := strconv.ParseInt(tmp[1], 10, 64)\n\n\tsc.Scan()\n\tS := sc.Text()\n\n\tfor i := int64(0); i < Q; i++ {\n\t\tsubS := \"\"\n\t\ttmp = nextLine()\n\t\tif len(tmp) < 2 {\n\t\t\tsubS = S\n\t\t} else if len(tmp) < 1 {\n\t\t\tpanic(\"none\")\n\t\t} else {\n\t\t\tl, _ := strconv.ParseInt(tmp[0], 10, 64)\n\t\t\tr, _ := strconv.ParseInt(tmp[1], 10, 64)\n\t\t\tsubS = S[l-1 : r]\n\t\t}\n\t\tfmt.Println(strings.Count(subS, \"AC\"))\n\t}\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "sample_input": "8 3\nACACTACG\n3 7\n2 3\n1 8\n"}, "reference_outputs": ["2\n0\n3\n"], "source_document_id": "p03087", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 600, "cpu_time_ms": 245, "memory_kb": 3456}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s009510609", "group_id": "codeNet:p03087", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tio := NewIo()\n\t//defer io.Flush()\n\tn := io.NextInt()\n\tq := io.NextInt()\n\ts := io.Next()\n\tl := make([]int,q)\n\tr := make([]int,q)\n\tfor i:=0; i= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tio := NewIo()\n\t//defer io.Flush()\n\tn := io.NextInt()\n\tq := io.NextInt()\n\ts := io.Next()\n\tl := make([]int,q)\n\tr := make([]int,q)\n\tfor i:=0; i= l && idx < r {\n\t\t\t\ta++\n\t\t\t}\n\t\t}\n\t\tfmt.Println(a)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1553985202, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03087.html", "problem_id": "p03087", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03087/input.txt", "sample_output_relpath": "derived/input_output/data/p03087/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03087/Go/s419512353.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s419512353", "user_id": "u167355746"}, "prompt_components": {"gold_output": "2\n0\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, Q int\n\tfmt.Scanln(&N, &Q)\n\tvar S string\n\tfmt.Scanln(&S)\n\n\tindices := []int{}\n\n\tfor i := 0; i < len(S)-1; i++ {\n\t\tif S[i] == 'A' && S[i+1] == 'C' {\n\t\t\tindices = append(indices, i+1)\n\t\t}\n\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tvar l, r int\n\t\tfmt.Scanln(&l, &r)\n\n\t\ta := 0\n\t\tfor _, idx := range indices {\n\t\t\tif idx >= l && idx < r {\n\t\t\t\ta++\n\t\t\t}\n\t\t}\n\t\tfmt.Println(a)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "sample_input": "8 3\nACACTACG\n3 7\n2 3\n1 8\n"}, "reference_outputs": ["2\n0\n3\n"], "source_document_id": "p03087", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 416, "cpu_time_ms": 2108, "memory_kb": 5888}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s994728199", "group_id": "codeNet:p03087", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tin = bufio.NewReader(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tq := readIntSlice()\n\ts := readString()\n\t//sLen := q[0]\n\tans := make([]int, 0, q[1])\n\tfor i := 0; i < q[1]; i++ {\n\t\tranges := readIntSlice()\n\t\tsRange := s[ranges[0]-1 : ranges[1]]\n\t\tcnt := strings.Count(sRange, \"AC\")\n\t\tans = append(ans, cnt)\n\t}\n\tfor _, a := range ans {\n\t\tfmt.Printf(\"%d\\n\", a)\n\t}\n}\n\nfunc readIntSlice() []int {\n\tline := readStringSlice()\n\tslice := make([]int, 0, len(line))\n\tfor _, tmp := range line {\n\t\tval, err := strconv.Atoi(tmp)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tslice = append(slice, val)\n\n\t}\n\treturn slice\n}\n\nfunc readString() string {\n\ts, _, _ := in.ReadLine()\n\treturn string(s)\n}\nfunc readStringSlice() []string {\n\tline := readString()\n\ts := strings.Split(line, \" \")\n\treturn s\n}\nfunc dump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Printf(\"%#v\\n\", v)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1553664878, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03087.html", "problem_id": "p03087", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03087/input.txt", "sample_output_relpath": "derived/input_output/data/p03087/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03087/Go/s994728199.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s994728199", "user_id": "u909860700"}, "prompt_components": {"gold_output": "2\n0\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tin = bufio.NewReader(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tq := readIntSlice()\n\ts := readString()\n\t//sLen := q[0]\n\tans := make([]int, 0, q[1])\n\tfor i := 0; i < q[1]; i++ {\n\t\tranges := readIntSlice()\n\t\tsRange := s[ranges[0]-1 : ranges[1]]\n\t\tcnt := strings.Count(sRange, \"AC\")\n\t\tans = append(ans, cnt)\n\t}\n\tfor _, a := range ans {\n\t\tfmt.Printf(\"%d\\n\", a)\n\t}\n}\n\nfunc readIntSlice() []int {\n\tline := readStringSlice()\n\tslice := make([]int, 0, len(line))\n\tfor _, tmp := range line {\n\t\tval, err := strconv.Atoi(tmp)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tslice = append(slice, val)\n\n\t}\n\treturn slice\n}\n\nfunc readString() string {\n\ts, _, _ := in.ReadLine()\n\treturn string(s)\n}\nfunc readStringSlice() []string {\n\tline := readString()\n\ts := strings.Split(line, \" \")\n\treturn s\n}\nfunc dump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Printf(\"%#v\\n\", v)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "sample_input": "8 3\nACACTACG\n3 7\n2 3\n1 8\n"}, "reference_outputs": ["2\n0\n3\n"], "source_document_id": "p03087", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many times does AC occurs as a substring?\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\nS is a string of length N.\n\nEach character in S is A, C, G or T.\n\n1 \\leq l_i < r_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n8 3\nACACTACG\n3 7\n2 3\n1 8\n\nSample Output 1\n\n2\n0\n3\n\nQuery 1: the substring of S starting at index 3 and ending at index 7 is ACTAC. In this string, AC occurs twice as a substring.\n\nQuery 2: the substring of S starting at index 2 and ending at index 3 is CA. In this string, AC occurs zero times as a substring.\n\nQuery 3: the substring of S starting at index 1 and ending at index 8 is ACACTACG. In this string, AC occurs three times as a substring.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 980, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s091381508", "group_id": "codeNet:p03095", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\tval, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\n\n\n// 長い文字列を読み込む時に使う //\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := rdr.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}\n/////////////////////////////\n\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\treadLine()\n\txs := readLine()\n\n\tdic := make(map[rune]int)\n\n\tfor _, char := range xs {\n\t\tval, ok := dic[char]\n\t\tif !ok {\n\t\t\tval = 0\n\t\t}\n\t\tdic[char] = val + 1\n\t}\n\tprod := 1\n\tdiv := 1000000007\n\tfor _, val := range dic {\n\t\tprod = (prod * (val + 1)) % div\n\t}\n\tfmt.Println(prod - 1)\n}\n", "language": "Go", "metadata": {"date": 1552769923, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03095.html", "problem_id": "p03095", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03095/input.txt", "sample_output_relpath": "derived/input_output/data/p03095/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03095/Go/s091381508.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s091381508", "user_id": "u654127147"}, "prompt_components": {"gold_output": "15\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\tval, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\n\n\n// 長い文字列を読み込む時に使う //\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := rdr.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}\n/////////////////////////////\n\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\treadLine()\n\txs := readLine()\n\n\tdic := make(map[rune]int)\n\n\tfor _, char := range xs {\n\t\tval, ok := dic[char]\n\t\tif !ok {\n\t\t\tval = 0\n\t\t}\n\t\tdic[char] = val + 1\n\t}\n\tprod := 1\n\tdiv := 1000000007\n\tfor _, val := range dic {\n\t\tprod = (prod * (val + 1)) % div\n\t}\n\tfmt.Println(prod - 1)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N.\nAmong its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.\n\nHere, a subsequence of a string is a concatenation of one or more characters from the string without changing the order.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\nS consists of lowercase English letters.\n\n|S|=N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of the subsequences such that all characters are different, modulo 10^9+7.\n\nSample Input 1\n\n4\nabcd\n\nSample Output 1\n\n15\n\nSince all characters in S itself are different, all its subsequences satisfy the condition.\n\nSample Input 2\n\n3\nbaa\n\nSample Output 2\n\n5\n\nThe answer is five: b, two occurrences of a, two occurrences of ba. Note that we do not count baa, since it contains two as.\n\nSample Input 3\n\n5\nabcab\n\nSample Output 3\n\n17", "sample_input": "4\nabcd\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03095", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N.\nAmong its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.\n\nHere, a subsequence of a string is a concatenation of one or more characters from the string without changing the order.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\nS consists of lowercase English letters.\n\n|S|=N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of the subsequences such that all characters are different, modulo 10^9+7.\n\nSample Input 1\n\n4\nabcd\n\nSample Output 1\n\n15\n\nSince all characters in S itself are different, all its subsequences satisfy the condition.\n\nSample Input 2\n\n3\nbaa\n\nSample Output 2\n\n5\n\nThe answer is five: b, two occurrences of a, two occurrences of ba. Note that we do not count baa, since it contains two as.\n\nSample Input 3\n\n5\nabcab\n\nSample Output 3\n\n17", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 990, "cpu_time_ms": 9, "memory_kb": 2816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s095619042", "group_id": "codeNet:p03101", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var H,W int\n var h,w int\n fmt.Scan(&H,&W,&h,&w)\n \n fmt.Println(H*W-h*W-H*w)\n}", "language": "Go", "metadata": {"date": 1552161908, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03101.html", "problem_id": "p03101", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03101/input.txt", "sample_output_relpath": "derived/input_output/data/p03101/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03101/Go/s095619042.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s095619042", "user_id": "u370270364"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var H,W int\n var h,w int\n fmt.Scan(&H,&W,&h,&w)\n \n fmt.Println(H*W-h*W-H*w)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "sample_input": "3 2\n2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03101", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 125, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s127074220", "group_id": "codeNet:p03103", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tm := nextInt()\n\tp := make([]pair, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tp[i].a = nextInt()\n\t\tp[i].b = nextInt()\n\t}\n\n\tsortPairs(p)\n\n\tcost := 0\n\tnowM := 0\n\tfor i := 0; i < n; i++ {\n\t\tif nowM >= m {\n\t\t\tbreak\n\t\t}\n\n\t\tbuy := min(p[i].b, m-nowM)\n\t\tcost += p[i].a * buy\n\t\tnowM += buy\n\t}\n\tfmt.Println(cost)\n\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n// Pair ソート\n// s := make([]pair, n)\n// sortPairs(s)\ntype pair struct { // f=first, s=second\n\ta int\n\tb int\n}\n\n// []pair をf->sの順でソートする\nfunc sortPairs(s []pair) {\n\tsort.Slice(s, func(i, j int) bool {\n\t\tif s[i].a == s[j].a { // fが同じ場合はsを比較する\n\t\t\treturn s[i].b < s[j].b\n\t\t}\n\t\treturn s[i].a < s[j].a\n\t})\n\treturn\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1596657150, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/Go/s127074220.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s127074220", "user_id": "u756000295"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tm := nextInt()\n\tp := make([]pair, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tp[i].a = nextInt()\n\t\tp[i].b = nextInt()\n\t}\n\n\tsortPairs(p)\n\n\tcost := 0\n\tnowM := 0\n\tfor i := 0; i < n; i++ {\n\t\tif nowM >= m {\n\t\t\tbreak\n\t\t}\n\n\t\tbuy := min(p[i].b, m-nowM)\n\t\tcost += p[i].a * buy\n\t\tnowM += buy\n\t}\n\tfmt.Println(cost)\n\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n// Pair ソート\n// s := make([]pair, n)\n// sortPairs(s)\ntype pair struct { // f=first, s=second\n\ta int\n\tb int\n}\n\n// []pair をf->sの順でソートする\nfunc sortPairs(s []pair) {\n\tsort.Slice(s, func(i, j int) bool {\n\t\tif s[i].a == s[j].a { // fが同じ場合はsを比較する\n\t\t\treturn s[i].b < s[j].b\n\t\t}\n\t\treturn s[i].a < s[j].a\n\t})\n\treturn\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1182, "cpu_time_ms": 59, "memory_kb": 5300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s524051260", "group_id": "codeNet:p03103", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc ScanInt() (ret int) {\n\tvar err error\n\tif scanner.Scan() {\n\t\ttxt := scanner.Text()\n\t\tif ret, err = strconv.Atoi(txt); err != nil {\n\t\t\t_, _ = fmt.Fprintf(os.Stderr, err.Error())\n\t\t}\n\t}\n\treturn\n}\n\ntype Pair struct{ A, B int }\n\nfunc main() {\n\tn, m := ScanInt(), ScanInt()\n\n\tpairs := make([]Pair, n)\n\tfor i := 0; i < n; i++ {\n\t\tpairs[i].A, pairs[i].B = ScanInt(), ScanInt()\n\t}\n\tsort.Slice(pairs, func(i, j int) bool {\n\t\treturn pairs[i].A < pairs[j].A\n\t})\n\n\tmoney := 0\n\tfor i := 0; i < n; i++ {\n\t\tif m-pairs[i].B <= 0 {\n\t\t\tmoney += m * pairs[i].A\n\t\t\tbreak\n\t\t} else {\n\t\t\tmoney += pairs[i].A * pairs[i].B\n\t\t\tm -= pairs[i].B\n\t\t}\n\t}\n\tfmt.Println(money)\n}\n", "language": "Go", "metadata": {"date": 1593454365, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/Go/s524051260.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s524051260", "user_id": "u605983940"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc ScanInt() (ret int) {\n\tvar err error\n\tif scanner.Scan() {\n\t\ttxt := scanner.Text()\n\t\tif ret, err = strconv.Atoi(txt); err != nil {\n\t\t\t_, _ = fmt.Fprintf(os.Stderr, err.Error())\n\t\t}\n\t}\n\treturn\n}\n\ntype Pair struct{ A, B int }\n\nfunc main() {\n\tn, m := ScanInt(), ScanInt()\n\n\tpairs := make([]Pair, n)\n\tfor i := 0; i < n; i++ {\n\t\tpairs[i].A, pairs[i].B = ScanInt(), ScanInt()\n\t}\n\tsort.Slice(pairs, func(i, j int) bool {\n\t\treturn pairs[i].A < pairs[j].A\n\t})\n\n\tmoney := 0\n\tfor i := 0; i < n; i++ {\n\t\tif m-pairs[i].B <= 0 {\n\t\t\tmoney += m * pairs[i].A\n\t\t\tbreak\n\t\t} else {\n\t\t\tmoney += pairs[i].A * pairs[i].B\n\t\t\tm -= pairs[i].B\n\t\t}\n\t}\n\tfmt.Println(money)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 808, "cpu_time_ms": 63, "memory_kb": 5048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s353620383", "group_id": "codeNet:p03103", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\ntype A [][]int\n\nfunc (a A) Len() int { return len(a) }\nfunc (a A) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a A) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\nfunc main() {\n\tnm := strings.Split(readLine(), \" \")\n\tn, _ := strconv.Atoi(nm[0])\n\tm, _ := strconv.Atoi(nm[1])\n\tvar ab [][]int\n\tfor i := 0; i < n; i++ {\n\t\tabstr := strings.Split(readLine(), \" \")\n\t\ta, _ := strconv.Atoi(abstr[0])\n\t\tb, _ := strconv.Atoi(abstr[1])\n\t\tab = append(ab, []int{a, b})\n\t}\n\tsort.Sort(A(ab))\n\tvar cost int\n\tfor _, v := range ab {\n\t\tif m > v[1] {\n\t\t\tcost += v[0] * v[1]\n\t\t\tm -= v[1]\n\t\t} else {\n\t\t\tcost += v[0] * m\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(cost)\n}\n", "language": "Go", "metadata": {"date": 1554599507, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/Go/s353620383.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s353620383", "user_id": "u468482169"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\ntype A [][]int\n\nfunc (a A) Len() int { return len(a) }\nfunc (a A) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a A) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\nfunc main() {\n\tnm := strings.Split(readLine(), \" \")\n\tn, _ := strconv.Atoi(nm[0])\n\tm, _ := strconv.Atoi(nm[1])\n\tvar ab [][]int\n\tfor i := 0; i < n; i++ {\n\t\tabstr := strings.Split(readLine(), \" \")\n\t\ta, _ := strconv.Atoi(abstr[0])\n\t\tb, _ := strconv.Atoi(abstr[1])\n\t\tab = append(ab, []int{a, b})\n\t}\n\tsort.Sort(A(ab))\n\tvar cost int\n\tfor _, v := range ab {\n\t\tif m > v[1] {\n\t\t\tcost += v[0] * v[1]\n\t\t\tm -= v[1]\n\t\t} else {\n\t\t\tcost += v[0] * m\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(cost)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 983, "cpu_time_ms": 2108, "memory_kb": 11648}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s780369718", "group_id": "codeNet:p03106", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tline := nextLine()\n\tparts := strings.Split(line, \" \")\n\ta, _ := strconv.Atoi(parts[0])\n\tb, _ := strconv.Atoi(parts[1])\n\tk, _ := strconv.Atoi(parts[2])\n\n\tret := make([]int, 0)\n\tfor i := 1; i < 101; i++ {\n\t\tif a%i == 0 && b%i == 0 {\n\t\t\tret = append(ret, i)\n\t\t}\n\t}\n\n\tfmt.Println(ret[len(ret)-k])\n}\n", "language": "Go", "metadata": {"date": 1552402745, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03106.html", "problem_id": "p03106", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03106/input.txt", "sample_output_relpath": "derived/input_output/data/p03106/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03106/Go/s780369718.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s780369718", "user_id": "u295946532"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tline := nextLine()\n\tparts := strings.Split(line, \" \")\n\ta, _ := strconv.Atoi(parts[0])\n\tb, _ := strconv.Atoi(parts[1])\n\tk, _ := strconv.Atoi(parts[2])\n\n\tret := make([]int, 0)\n\tfor i := 1; i < 101; i++ {\n\t\tif a%i == 0 && b%i == 0 {\n\t\t\tret = append(ret, i)\n\t\t}\n\t}\n\n\tfmt.Println(ret[len(ret)-k])\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nFind the K-th largest positive integer that divides both A and B.\n\nThe input guarantees that there exists such a number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 100\n\nThe K-th largest positive integer that divides both A and B exists.\n\nK \\geq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the K-th largest positive integer that divides both A and B.\n\nSample Input 1\n\n8 12 2\n\nSample Output 1\n\n2\n\nThree positive integers divides both 8 and 12: 1, 2 and 4.\nAmong them, the second largest is 2.\n\nSample Input 2\n\n100 50 4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1 1\n\nSample Output 3\n\n1", "sample_input": "8 12 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03106", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nFind the K-th largest positive integer that divides both A and B.\n\nThe input guarantees that there exists such a number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 100\n\nThe K-th largest positive integer that divides both A and B exists.\n\nK \\geq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the K-th largest positive integer that divides both A and B.\n\nSample Input 1\n\n8 12 2\n\nSample Output 1\n\n2\n\nThree positive integers divides both 8 and 12: 1, 2 and 4.\nAmong them, the second largest is 2.\n\nSample Input 2\n\n100 50 4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1 1\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 473, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s048465163", "group_id": "codeNet:p03107", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(math.Min(float64(strings.Count(s, \"0\")), float64(strings.Count(s, \"1\"))) * 2)\n}\n", "language": "Go", "metadata": {"date": 1574686173, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03107.html", "problem_id": "p03107", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03107/input.txt", "sample_output_relpath": "derived/input_output/data/p03107/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03107/Go/s048465163.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s048465163", "user_id": "u550296200"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(math.Min(float64(strings.Count(s, \"0\")), float64(strings.Count(s, \"1\"))) * 2)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "0011\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03107", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 187, "cpu_time_ms": 55, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s586461429", "group_id": "codeNet:p03107", "input_text": "// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.\n// $ bundle -pkg main -prefix -dst github.com/mpppk/atcoder/abc120/c github.com/mpppk/atcoder/abc120/c\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar memo = map[string]int{}\n\nfunc solve(input *lib_Input) int {\n\ts := input.MustGetFirstValue(0)\n\tcubes := []rune(s)\n\treturn removeCube(cubes)\n}\n\nfunc removeCube(cubes []rune) int {\n\tif len(cubes) < 2 {\n\t\treturn 0\n\t}\n\n\tvar indices []int\n\tfor i := 0; i < len(cubes); i++ {\n\t\tif i < len(cubes)-1 && cubes[i] != cubes[i+1] {\n\t\t\tindices = append(indices, i)\n\t\t}\n\t}\n\tm := map[int]bool{}\n\tmaxRemovedCubesNum := 0\n\tfor _, index := range indices {\n\t\tif !m[index] {\n\t\t\tremovedCubesNum := 0\n\t\t\tnewCubes := lib_RuneRemoveFromSlice(cubes, index)\n\t\t\tnewCubes = lib_RuneRemoveFromSlice(newCubes, index)\n\t\t\tif cachedNum, ok := memo[string(newCubes)]; ok {\n\t\t\t\tremovedCubesNum = cachedNum\n\t\t\t} else {\n\t\t\t\tremovedCubesNum = removeCube(newCubes)\n\t\t\t\tmemo[string(newCubes)] = removedCubesNum\n\t\t\t}\n\t\t\tif maxRemovedCubesNum < removedCubesNum+2 {\n\t\t\t\tmaxRemovedCubesNum = removedCubesNum + 2\n\t\t\t}\n\t\t\tm[index] = true\n\t\t}\n\t}\n\n\treturn maxRemovedCubesNum\n}\n\nfunc main() {\n\tinput := lib_MustNewInputFromReader(bufio.NewReader(io.Reader(os.Stdin)))\n\tfmt.Println(solve(input))\n}\n\nfunc (i *lib_Input) GetIntLines() (newLines [][]int, err error) {\n\treturn i.GetIntLinesFrom(0)\n}\n\nfunc (i *lib_Input) GetIntLinesFrom(fromIndex int) (newLines [][]int, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetIntLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetIntLine(index int) ([]int, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToIntSlice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetIntValue(rowIndex, colIndex int) (int, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int(v), nil\n}\n\nfunc (i *lib_Input) GetFirstIntValue(rowIndex int) (int, error) {\n\treturn i.GetIntValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColIntLine(colIndex int) (newLine []int, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToIntSlice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Lines() (newLines [][]int8, err error) {\n\treturn i.GetInt8LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt8LinesFrom(fromIndex int) (newLines [][]int8, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt8Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Line(index int) ([]int8, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt8Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt8Value(rowIndex, colIndex int) (int8, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int8(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt8Value(rowIndex int) (int8, error) {\n\treturn i.GetInt8Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt8Line(colIndex int) (newLine []int8, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt8Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Lines() (newLines [][]int16, err error) {\n\treturn i.GetInt16LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt16LinesFrom(fromIndex int) (newLines [][]int16, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt16Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Line(index int) ([]int16, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt16Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt16Value(rowIndex, colIndex int) (int16, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int16(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt16Value(rowIndex int) (int16, error) {\n\treturn i.GetInt16Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt16Line(colIndex int) (newLine []int16, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt16Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Lines() (newLines [][]int32, err error) {\n\treturn i.GetInt32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt32LinesFrom(fromIndex int) (newLines [][]int32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Line(index int) ([]int32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt32Value(rowIndex, colIndex int) (int32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt32Value(rowIndex int) (int32, error) {\n\treturn i.GetInt32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt32Line(colIndex int) (newLine []int32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Lines() (newLines [][]int64, err error) {\n\treturn i.GetInt64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt64LinesFrom(fromIndex int) (newLines [][]int64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Line(index int) ([]int64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt64Value(rowIndex, colIndex int) (int64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt64Value(rowIndex int) (int64, error) {\n\treturn i.GetInt64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt64Line(colIndex int) (newLine []int64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Lines() (newLines [][]float32, err error) {\n\treturn i.GetFloat32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat32LinesFrom(fromIndex int) (newLines [][]float32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Line(index int) ([]float32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat32Value(rowIndex, colIndex int) (float32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat32Value(rowIndex int) (float32, error) {\n\treturn i.GetFloat32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat32Line(colIndex int) (newLine []float32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Lines() (newLines [][]float64, err error) {\n\treturn i.GetFloat64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat64LinesFrom(fromIndex int) (newLines [][]float64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Line(index int) ([]float64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat64Value(rowIndex, colIndex int) (float64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat64Value(rowIndex int) (float64, error) {\n\treturn i.GetFloat64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat64Line(colIndex int) (newLine []float64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc lib_IntToBits(value int, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int8ToBits(value int8, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int16ToBits(value int16, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int32ToBits(value int32, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int64ToBits(value int64, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_GetEachDigitSumInt(n int) (sum int) {\n\tfor _, digit := range lib_ToDigitSliceInt(n) {\n\t\tsum += int(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt(n int) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt(digits []int8) int {\n\tv := int(0)\n\tfor i, digit := range digits {\n\t\tv += int(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt8(n int8) (sum int8) {\n\tfor _, digit := range lib_ToDigitSliceInt8(n) {\n\t\tsum += int8(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt8(n int8) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt8(digits []int8) int8 {\n\tv := int8(0)\n\tfor i, digit := range digits {\n\t\tv += int8(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt16(n int16) (sum int16) {\n\tfor _, digit := range lib_ToDigitSliceInt16(n) {\n\t\tsum += int16(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt16(n int16) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt16(digits []int8) int16 {\n\tv := int16(0)\n\tfor i, digit := range digits {\n\t\tv += int16(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt32(n int32) (sum int32) {\n\tfor _, digit := range lib_ToDigitSliceInt32(n) {\n\t\tsum += int32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt32(n int32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt32(digits []int8) int32 {\n\tv := int32(0)\n\tfor i, digit := range digits {\n\t\tv += int32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt64(n int64) (sum int64) {\n\tfor _, digit := range lib_ToDigitSliceInt64(n) {\n\t\tsum += int64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt64(n int64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt64(digits []int8) int64 {\n\tv := int64(0)\n\tfor i, digit := range digits {\n\t\tv += int64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat32(n float32) (sum float32) {\n\tfor _, digit := range lib_ToDigitSliceFloat32(n) {\n\t\tsum += float32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat32(n float32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat32(digits []int8) float32 {\n\tv := float32(0)\n\tfor i, digit := range digits {\n\t\tv += float32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat64(n float64) (sum float64) {\n\tfor _, digit := range lib_ToDigitSliceFloat64(n) {\n\t\tsum += float64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat64(n float64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat64(digits []int8) float64 {\n\tv := float64(0)\n\tfor i, digit := range digits {\n\t\tv += float64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_SumInt(values []int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt(values []int, f func(v int) bool) (newValues []int) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt(values []int) (newValues []int) {\n\tm := map[int]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt(values1 []int, values2 []int) (newValues []int, err error) {\n\treturn lib_SubtractIntBy(values1, values2, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffIntBy(values []int, f func(v int) int) (newValues []int, err error) {\n\tdiffValues := append([]int{0}, values...)\n\tnewValues, err = lib_SubtractIntBy(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt(values []int) (newValues []int, err error) {\n\treturn lib_RDiffIntBy(values, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToIntSlice(s string) (ValueLine []int, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToIntSlice(line []string) (ValueLine []int, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt(values []int) (max int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt(values []int) (min int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewIntGridMap(grid [][]string, defaultValue int) (m [][]int) {\n\tfor _, line := range grid {\n\t\tvar newLine []int\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_IntRange(start, end, step int) []int {\n\tif end < start {\n\t\treturn []int{}\n\t}\n\ts := make([]int, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt8(values []int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt8(values []int8, f func(v int8) bool) (newValues []int8) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt8(values []int8) (newValues []int8) {\n\tm := map[int8]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt8(values1 []int8, values2 []int8) (newValues []int8, err error) {\n\treturn lib_SubtractInt8By(values1, values2, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tdiffValues := append([]int8{0}, values...)\n\tnewValues, err = lib_SubtractInt8By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt8(values []int8) (newValues []int8, err error) {\n\treturn lib_RDiffInt8By(values, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt8Slice(s string) (ValueLine []int8, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt8Slice(line []string) (ValueLine []int8, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8(values []int8) (max int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt8(values []int8) (min int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt8GridMap(grid [][]string, defaultValue int8) (m [][]int8) {\n\tfor _, line := range grid {\n\t\tvar newLine []int8\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int8Range(start, end, step int8) []int8 {\n\tif end < start {\n\t\treturn []int8{}\n\t}\n\ts := make([]int8, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt16(values []int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt16(values []int16, f func(v int16) bool) (newValues []int16) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt16(values []int16) (newValues []int16) {\n\tm := map[int16]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt16(values1 []int16, values2 []int16) (newValues []int16, err error) {\n\treturn lib_SubtractInt16By(values1, values2, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tdiffValues := append([]int16{0}, values...)\n\tnewValues, err = lib_SubtractInt16By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt16(values []int16) (newValues []int16, err error) {\n\treturn lib_RDiffInt16By(values, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt16Slice(s string) (ValueLine []int16, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt16Slice(line []string) (ValueLine []int16, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16(values []int16) (max int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt16(values []int16) (min int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt16GridMap(grid [][]string, defaultValue int16) (m [][]int16) {\n\tfor _, line := range grid {\n\t\tvar newLine []int16\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int16Range(start, end, step int16) []int16 {\n\tif end < start {\n\t\treturn []int16{}\n\t}\n\ts := make([]int16, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt32(values []int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt32(values []int32, f func(v int32) bool) (newValues []int32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt32(values []int32) (newValues []int32) {\n\tm := map[int32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt32(values1 []int32, values2 []int32) (newValues []int32, err error) {\n\treturn lib_SubtractInt32By(values1, values2, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tdiffValues := append([]int32{0}, values...)\n\tnewValues, err = lib_SubtractInt32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt32(values []int32) (newValues []int32, err error) {\n\treturn lib_RDiffInt32By(values, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt32Slice(s string) (ValueLine []int32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt32Slice(line []string) (ValueLine []int32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32(values []int32) (max int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt32(values []int32) (min int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt32GridMap(grid [][]string, defaultValue int32) (m [][]int32) {\n\tfor _, line := range grid {\n\t\tvar newLine []int32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int32Range(start, end, step int32) []int32 {\n\tif end < start {\n\t\treturn []int32{}\n\t}\n\ts := make([]int32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt64(values []int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt64(values []int64, f func(v int64) bool) (newValues []int64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt64(values []int64) (newValues []int64) {\n\tm := map[int64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt64(values1 []int64, values2 []int64) (newValues []int64, err error) {\n\treturn lib_SubtractInt64By(values1, values2, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tdiffValues := append([]int64{0}, values...)\n\tnewValues, err = lib_SubtractInt64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt64(values []int64) (newValues []int64, err error) {\n\treturn lib_RDiffInt64By(values, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt64Slice(s string) (ValueLine []int64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt64Slice(line []string) (ValueLine []int64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64(values []int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt64(values []int64) (min int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt64GridMap(grid [][]string, defaultValue int64) (m [][]int64) {\n\tfor _, line := range grid {\n\t\tvar newLine []int64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int64Range(start, end, step int64) []int64 {\n\tif end < start {\n\t\treturn []int64{}\n\t}\n\ts := make([]int64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat32(values []float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat32(values []float32, f func(v float32) bool) (newValues []float32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat32(values []float32) (newValues []float32) {\n\tm := map[float32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat32(values1 []float32, values2 []float32) (newValues []float32, err error) {\n\treturn lib_SubtractFloat32By(values1, values2, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tdiffValues := append([]float32{0}, values...)\n\tnewValues, err = lib_SubtractFloat32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat32(values []float32) (newValues []float32, err error) {\n\treturn lib_RDiffFloat32By(values, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat32Slice(s string) (ValueLine []float32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat32Slice(line []string) (ValueLine []float32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32(values []float32) (max float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat32(values []float32) (min float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat32GridMap(grid [][]string, defaultValue float32) (m [][]float32) {\n\tfor _, line := range grid {\n\t\tvar newLine []float32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float32Range(start, end, step float32) []float32 {\n\tif end < start {\n\t\treturn []float32{}\n\t}\n\ts := make([]float32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat64(values []float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat64(values []float64, f func(v float64) bool) (newValues []float64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat64(values []float64) (newValues []float64) {\n\tm := map[float64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat64(values1 []float64, values2 []float64) (newValues []float64, err error) {\n\treturn lib_SubtractFloat64By(values1, values2, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tdiffValues := append([]float64{0}, values...)\n\tnewValues, err = lib_SubtractFloat64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat64(values []float64) (newValues []float64, err error) {\n\treturn lib_RDiffFloat64By(values, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat64Slice(s string) (ValueLine []float64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat64Slice(line []string) (ValueLine []float64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64(values []float64) (max float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat64(values []float64) (min float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat64GridMap(grid [][]string, defaultValue float64) (m [][]float64) {\n\tfor _, line := range grid {\n\t\tvar newLine []float64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float64Range(start, end, step float64) []float64 {\n\tif end < start {\n\t\treturn []float64{}\n\t}\n\ts := make([]float64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumIntByInt(values []int, f func(v int) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToIntSlice(values []int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt(values [][][]int, f func(v [][]int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSliceToInt(values, f))\n}\n\nfunc lib_MaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSlice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt8(values []int, f func(v int) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt8Slice(values []int) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt(values [][]int8, f func(v []int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt(values [][][]int8, f func(v [][]int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt16(values []int, f func(v int) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt16Slice(values []int) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt(values [][]int16, f func(v []int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt(values [][][]int16, f func(v [][]int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt32(values []int, f func(v int) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt32Slice(values []int) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt(values [][]int32, f func(v []int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt(values [][][]int32, f func(v [][]int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt64(values []int, f func(v int) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt64Slice(values []int) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt(values [][]int64, f func(v []int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt(values [][][]int64, f func(v [][]int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByFloat32(values []int, f func(v int) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat32Slice(values []int) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt(values [][]float32, f func(v []float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt(values [][][]float32, f func(v [][]float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByFloat64(values []int, f func(v int) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat64Slice(values []int) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt(values [][]float64, f func(v []float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt(values [][][]float64, f func(v [][]float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64Slice2ToInt(values, f))\n}\n\nfunc lib_SumInt8ByInt(values []int8, f func(v int8) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToIntSlice(values []int8) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt8(values [][]int, f func(v []int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt8(values [][][]int, f func(v [][]int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSlice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt8(values []int8, f func(v int8) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt8Slice(values []int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt8(values [][][]int8, f func(v [][]int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt16(values []int8, f func(v int8) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt16Slice(values []int8) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt8(values [][]int16, f func(v []int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt8(values [][][]int16, f func(v [][]int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt32(values []int8, f func(v int8) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt32Slice(values []int8) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt8(values [][]int32, f func(v []int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt8(values [][][]int32, f func(v [][]int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt64(values []int8, f func(v int8) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt64Slice(values []int8) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt8(values [][]int64, f func(v []int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt8(values [][][]int64, f func(v [][]int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByFloat32(values []int8, f func(v int8) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat32Slice(values []int8) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt8(values [][]float32, f func(v []float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt8(values [][][]float32, f func(v [][]float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByFloat64(values []int8, f func(v int8) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat64Slice(values []int8) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt8(values [][]float64, f func(v []float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt8(values [][][]float64, f func(v [][]float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt16ByInt(values []int16, f func(v int16) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToIntSlice(values []int16) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt16(values [][]int, f func(v []int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt16(values [][][]int, f func(v [][]int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSlice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt8(values []int16, f func(v int16) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt8Slice(values []int16) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt16(values [][]int8, f func(v []int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt16(values [][][]int8, f func(v [][]int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt16(values []int16, f func(v int16) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt16Slice(values []int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt16(values [][][]int16, f func(v [][]int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt32(values []int16, f func(v int16) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt32Slice(values []int16) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt16(values [][]int32, f func(v []int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt16(values [][][]int32, f func(v [][]int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt64(values []int16, f func(v int16) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt64Slice(values []int16) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt16(values [][]int64, f func(v []int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt16(values [][][]int64, f func(v [][]int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByFloat32(values []int16, f func(v int16) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat32Slice(values []int16) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt16(values [][]float32, f func(v []float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt16(values [][][]float32, f func(v [][]float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByFloat64(values []int16, f func(v int16) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat64Slice(values []int16) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt16(values [][]float64, f func(v []float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt16(values [][][]float64, f func(v [][]float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt32ByInt(values []int32, f func(v int32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToIntSlice(values []int32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt32(values [][]int, f func(v []int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt32(values [][][]int, f func(v [][]int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSlice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt8(values []int32, f func(v int32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt8Slice(values []int32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt32(values [][]int8, f func(v []int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt32(values [][][]int8, f func(v [][]int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt16(values []int32, f func(v int32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt16Slice(values []int32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt32(values [][]int16, f func(v []int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt32(values [][][]int16, f func(v [][]int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt32(values []int32, f func(v int32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt32Slice(values []int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt32(values [][][]int32, f func(v [][]int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt64(values []int32, f func(v int32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt64Slice(values []int32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt32(values [][]int64, f func(v []int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt32(values [][][]int64, f func(v [][]int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByFloat32(values []int32, f func(v int32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat32Slice(values []int32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt32(values [][]float32, f func(v []float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt32(values [][][]float32, f func(v [][]float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByFloat64(values []int32, f func(v int32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat64Slice(values []int32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt32(values [][]float64, f func(v []float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt32(values [][][]float64, f func(v [][]float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt64ByInt(values []int64, f func(v int64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToIntSlice(values []int64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt64(values [][]int, f func(v []int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt64(values [][][]int, f func(v [][]int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSlice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt8(values []int64, f func(v int64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt8Slice(values []int64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt64(values [][]int8, f func(v []int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt64(values [][][]int8, f func(v [][]int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt16(values []int64, f func(v int64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt16Slice(values []int64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt64(values [][]int16, f func(v []int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt64(values [][][]int16, f func(v [][]int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt32(values []int64, f func(v int64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt32Slice(values []int64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt64(values [][]int32, f func(v []int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt64(values [][][]int32, f func(v [][]int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt64(values []int64, f func(v int64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt64Slice(values []int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt64(values [][][]int64, f func(v [][]int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByFloat32(values []int64, f func(v int64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat32Slice(values []int64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt64(values [][]float32, f func(v []float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt64(values [][][]float32, f func(v [][]float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByFloat64(values []int64, f func(v int64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat64Slice(values []int64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt64(values [][]float64, f func(v []float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt64(values [][][]float64, f func(v [][]float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64Slice2ToInt64(values, f))\n}\n\nfunc lib_SumFloat32ByInt(values []float32, f func(v float32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToIntSlice(values []float32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat32(values [][]int, f func(v []int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat32(values [][][]int, f func(v [][]int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSlice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt8(values []float32, f func(v float32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt8Slice(values []float32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat32(values [][]int8, f func(v []int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat32(values [][][]int8, f func(v [][]int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt16(values []float32, f func(v float32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt16Slice(values []float32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat32(values [][]int16, f func(v []int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat32(values [][][]int16, f func(v [][]int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt32(values []float32, f func(v float32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt32Slice(values []float32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat32(values [][]int32, f func(v []int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat32(values [][][]int32, f func(v [][]int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt64(values []float32, f func(v float32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt64Slice(values []float32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat32(values [][]int64, f func(v []int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat32(values [][][]int64, f func(v [][]int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByFloat32(values []float32, f func(v float32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat32Slice(values []float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat32(values [][][]float32, f func(v [][]float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByFloat64(values []float32, f func(v float32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat64Slice(values []float32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat32(values [][]float64, f func(v []float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat32(values [][][]float64, f func(v [][]float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat64ByInt(values []float64, f func(v float64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToIntSlice(values []float64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat64(values [][]int, f func(v []int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat64(values [][][]int, f func(v [][]int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSlice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt8(values []float64, f func(v float64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt8Slice(values []float64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat64(values [][]int8, f func(v []int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat64(values [][][]int8, f func(v [][]int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt16(values []float64, f func(v float64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt16Slice(values []float64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat64(values [][]int16, f func(v []int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat64(values [][][]int16, f func(v [][]int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt32(values []float64, f func(v float64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt32Slice(values []float64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat64(values [][]int32, f func(v []int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat64(values [][][]int32, f func(v [][]int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt64(values []float64, f func(v float64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt64Slice(values []float64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat64(values [][]int64, f func(v []int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat64(values [][][]int64, f func(v [][]int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByFloat32(values []float64, f func(v float64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat32Slice(values []float64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat64(values [][]float32, f func(v []float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat64(values [][][]float32, f func(v [][]float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByFloat64(values []float64, f func(v float64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat64Slice(values []float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat64(values [][][]float64, f func(v [][]float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64Slice2ToFloat64(values, f))\n}\n\nfunc lib_ReduceRune(values []rune, f func(acc, cur rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceRuneSlice(values [][]rune, f func(acc rune, cur []rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyRune(values []rune) []rune {\n\tdst := make([]rune, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseRune(values []rune) []rune {\n\tnewValues := lib_CopyRune(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapRune(values []rune, f func(v rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeRune(values [][]rune, f func(v []rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipRune(valuesList ...[]rune) (newValuesList [][]rune, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipRune\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipRune\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []rune\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []rune\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []rune{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetRune(values []rune, i int) ([]rune, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []rune{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]rune, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_RuneCombination(values []rune, r int) (combinations [][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_RuneCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RunePermutation(values []rune, r int) (permutations [][]rune) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_RuneRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_RunePermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneSliceCombination(values [][]rune, r int) (combinations [][][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_RuneSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneRemoveFromSlice(slice []rune, i int) []rune {\n\tn := make([]rune, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceString(values []string, f func(acc, cur string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceStringSlice(values [][]string, f func(acc string, cur []string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyString(values []string) []string {\n\tdst := make([]string, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseString(values []string) []string {\n\tnewValues := lib_CopyString(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapString(values []string, f func(v string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeString(values [][]string, f func(v []string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipString(valuesList ...[]string) (newValuesList [][]string, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipString\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipString\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []string\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkStringByBits(values []string, bits []bool) (newValues [][]string, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []string\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []string{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetString(values []string, i int) ([]string, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []string{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]string, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_StringCombination(values []string, r int) (combinations [][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_StringCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringPermutation(values []string, r int) (permutations [][]string) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_StringRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_StringPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringSliceCombination(values [][]string, r int) (combinations [][][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_StringSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringRemoveFromSlice(slice []string, i int) []string {\n\tn := make([]string, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt(values []int, f func(acc, cur int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceIntSlice(values [][]int, f func(acc int, cur []int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt(values []int) []int {\n\tdst := make([]int, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt(values []int) []int {\n\tnewValues := lib_CopyInt(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt(values []int, f func(v int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt(valuesList ...[]int) (newValuesList [][]int, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkIntByBits(values []int, bits []bool) (newValues [][]int, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt(values []int, i int) ([]int, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_IntCombination(values []int, r int) (combinations [][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_IntCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntPermutation(values []int, r int) (permutations [][]int) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_IntRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_IntPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntSliceCombination(values [][]int, r int) (combinations [][][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_IntSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntRemoveFromSlice(slice []int, i int) []int {\n\tn := make([]int, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt8(values []int8, f func(acc, cur int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt8Slice(values [][]int8, f func(acc int8, cur []int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt8(values []int8) []int8 {\n\tdst := make([]int8, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt8(values []int8) []int8 {\n\tnewValues := lib_CopyInt8(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt8(values []int8, f func(v int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt8(valuesList ...[]int8) (newValuesList [][]int8, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt8\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt8\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int8\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int8\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int8{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt8(values []int8, i int) ([]int8, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int8{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int8, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int8Combination(values []int8, r int) (combinations [][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int8Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8Permutation(values []int8, r int) (permutations [][]int8) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int8RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int8Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8SliceCombination(values [][]int8, r int) (combinations [][][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int8SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8RemoveFromSlice(slice []int8, i int) []int8 {\n\tn := make([]int8, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt16(values []int16, f func(acc, cur int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt16Slice(values [][]int16, f func(acc int16, cur []int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt16(values []int16) []int16 {\n\tdst := make([]int16, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt16(values []int16) []int16 {\n\tnewValues := lib_CopyInt16(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt16(values []int16, f func(v int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt16(valuesList ...[]int16) (newValuesList [][]int16, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt16\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt16\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int16\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int16\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int16{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt16(values []int16, i int) ([]int16, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int16{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int16, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int16Combination(values []int16, r int) (combinations [][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int16Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16Permutation(values []int16, r int) (permutations [][]int16) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int16RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int16Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16SliceCombination(values [][]int16, r int) (combinations [][][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int16SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16RemoveFromSlice(slice []int16, i int) []int16 {\n\tn := make([]int16, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt32(values []int32, f func(acc, cur int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt32Slice(values [][]int32, f func(acc int32, cur []int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt32(values []int32) []int32 {\n\tdst := make([]int32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt32(values []int32) []int32 {\n\tnewValues := lib_CopyInt32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt32(values []int32, f func(v int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt32(valuesList ...[]int32) (newValuesList [][]int32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt32(values []int32, i int) ([]int32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int32Combination(values []int32, r int) (combinations [][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32Permutation(values []int32, r int) (permutations [][]int32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32SliceCombination(values [][]int32, r int) (combinations [][][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32RemoveFromSlice(slice []int32, i int) []int32 {\n\tn := make([]int32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt64(values []int64, f func(acc, cur int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt64Slice(values [][]int64, f func(acc int64, cur []int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt64(values []int64) []int64 {\n\tdst := make([]int64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt64(values []int64) []int64 {\n\tnewValues := lib_CopyInt64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt64(values []int64, f func(v int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt64(valuesList ...[]int64) (newValuesList [][]int64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt64(values []int64, i int) ([]int64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int64Combination(values []int64, r int) (combinations [][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64Permutation(values []int64, r int) (permutations [][]int64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64SliceCombination(values [][]int64, r int) (combinations [][][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64RemoveFromSlice(slice []int64, i int) []int64 {\n\tn := make([]int64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceFloat32(values []float32, f func(acc, cur float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat32Slice(values [][]float32, f func(acc float32, cur []float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat32(values []float32) []float32 {\n\tdst := make([]float32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseFloat32(values []float32) []float32 {\n\tnewValues := lib_CopyFloat32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat32(values []float32, f func(v float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat32(valuesList ...[]float32) (newValuesList [][]float32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat32(values []float32, i int) ([]float32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float32Combination(values []float32, r int) (combinations [][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32Permutation(values []float32, r int) (permutations [][]float32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32SliceCombination(values [][]float32, r int) (combinations [][][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32RemoveFromSlice(slice []float32, i int) []float32 {\n\tn := make([]float32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceFloat64(values []float64, f func(acc, cur float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat64Slice(values [][]float64, f func(acc float64, cur []float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat64(values []float64) []float64 {\n\tdst := make([]float64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseFloat64(values []float64) []float64 {\n\tnewValues := lib_CopyFloat64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat64(values []float64, f func(v float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat64(valuesList ...[]float64) (newValuesList [][]float64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat64(values []float64, i int) ([]float64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float64Combination(values []float64, r int) (combinations [][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64Permutation(values []float64, r int) (permutations [][]float64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64SliceCombination(values [][]float64, r int) (combinations [][][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64RemoveFromSlice(slice []float64, i int) []float64 {\n\tn := make([]float64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_toLines(scanner *bufio.Scanner) [][]string {\n\tvar lines [][]string\n\tfor scanner.Scan() {\n\t\ttext := lib_TrimSpaceAndNewLineCodeAndTab(scanner.Text())\n\t\tif len(text) == 0 {\n\t\t\tlines = append(lines, []string{})\n\t\t\tcontinue\n\t\t}\n\t\tline := strings.Split(text, \" \")\n\t\tlines = append(lines, line)\n\t}\n\treturn lines\n}\n\nfunc lib_toLinesFromReader(reader *bufio.Reader) (lines [][]string, err error) {\n\tfor {\n\t\tchunks, err := lib_readLineAsChunks(reader)\n\t\tif err == io.EOF {\n\t\t\treturn lines, nil\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read line from reader: %v\", err)\n\t\t}\n\t\tlineStr := lib_TrimSpaceAndNewLineCodeAndTab(strings.Join(chunks, \"\"))\n\t\tline := strings.Split(lineStr, \" \")\n\t\tlines = append(lines, line)\n\t}\n}\n\nfunc lib_readLineAsChunks(reader *bufio.Reader) (chunks []string, err error) {\n\tfor {\n\t\tchunk, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tchunks = append(chunks, string(chunk))\n\t\tif !isPrefix {\n\t\t\treturn chunks, nil\n\t\t}\n\t}\n}\n\ntype lib_Input struct {\n\tlines [][]string\n}\n\nfunc (i *lib_Input) validateColIndex(index int) error {\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\n\treturn nil\n}\n\nfunc (i *lib_Input) validateRowIndex(index int) error {\n\tif index >= len(i.lines) {\n\t\treturn errors.New(fmt.Sprintf(\"index(%d) is larger than lines(%d)\", index, len(i.lines)))\n\t}\n\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\treturn nil\n}\n\nfunc (i *lib_Input) GetLines(startRowIndex, endRowIndex int) ([][]string, error) {\n\tif err := i.validateRowIndex(startRowIndex); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid start row index: %v\", err)\n\t}\n\tif err := i.validateRowIndex(endRowIndex - 1); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid end row index: %v\", err)\n\t}\n\treturn i.lines[startRowIndex:endRowIndex], nil\n}\n\nfunc (i *lib_Input) GetStringLinesFrom(fromIndex int) (newLines [][]string, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetValue(rowIndex, colIndex int) (string, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn \"\", fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\treturn line[colIndex], nil\n}\n\nfunc (i *lib_Input) GetFirstValue(rowIndex int) (string, error) {\n\treturn i.GetValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColLine(colIndex int) (newLine []string, err error) {\n\tif err := i.validateColIndex(colIndex); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i, line := range i.lines {\n\t\tif len(line) <= colIndex {\n\t\t\treturn nil, errors.New(fmt.Sprintf(\"col index(%d) is larger than %dth line length(%d)\", colIndex, i, len(line)))\n\t\t}\n\t\tnewLine = append(newLine, line[colIndex])\n\t}\n\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetLine(index int) ([]string, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\treturn i.lines[index], nil\n}\n\nfunc (i *lib_Input) ReadAsStringGridFrom(fromIndex int) ([][]string, error) {\n\tlines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar m [][]string\n\tfor _, line := range lines {\n\t\tif len(line) > 1 {\n\t\t\treturn nil, fmt.Errorf(\"unexpected length line: %v\", line)\n\t\t}\n\n\t\tvar mLine []string\n\t\tfor _, r := range line[0] {\n\t\t\tmLine = append(mLine, string(r))\n\t\t}\n\t\tm = append(m, mLine)\n\t}\n\treturn m, nil\n}\n\nfunc lib_NewInput(scanner *bufio.Scanner) *lib_Input {\n\treturn &lib_Input{\n\t\tlines: lib_toLines(scanner),\n\t}\n}\n\nfunc lib_NewInputFromReader(reader *bufio.Reader) (*lib_Input, error) {\n\tlines, err := lib_toLinesFromReader(reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create new Input from reader: %v\", err)\n\t}\n\treturn &lib_Input{\n\t\tlines: lines,\n\t}, nil\n}\n\nfunc (i *lib_Input) MustGetIntLines() (newLines [][]int) {\n\tnewLines, err := i.GetIntLines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLinesFrom(fromIndex int) (newLines [][]int) {\n\tnewLines, err := i.GetIntLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLine(index int) []int {\n\tv, err := i.GetIntLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetIntValue(rowIndex, colIndex int) int {\n\tv, err := i.GetIntValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstIntValue(rowIndex int) int {\n\tv, err := i.GetFirstIntValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColIntLine(colIndex int) (newLine []int) {\n\tnewLine, err := i.GetColIntLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt8Lines() (newLines [][]int8) {\n\tnewLines, err := i.GetInt8Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8LinesFrom(fromIndex int) (newLines [][]int8) {\n\tnewLines, err := i.GetInt8LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8Line(index int) []int8 {\n\tv, err := i.GetInt8Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt8Value(rowIndex, colIndex int) int8 {\n\tv, err := i.GetInt8Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt8Value(rowIndex int) int8 {\n\tv, err := i.GetFirstInt8Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt8Line(colIndex int) (newLine []int8) {\n\tnewLine, err := i.GetColInt8Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt16Lines() (newLines [][]int16) {\n\tnewLines, err := i.GetInt16Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16LinesFrom(fromIndex int) (newLines [][]int16) {\n\tnewLines, err := i.GetInt16LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16Line(index int) []int16 {\n\tv, err := i.GetInt16Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt16Value(rowIndex, colIndex int) int16 {\n\tv, err := i.GetInt16Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt16Value(rowIndex int) int16 {\n\tv, err := i.GetFirstInt16Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt16Line(colIndex int) (newLine []int16) {\n\tnewLine, err := i.GetColInt16Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt32Lines() (newLines [][]int32) {\n\tnewLines, err := i.GetInt32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32LinesFrom(fromIndex int) (newLines [][]int32) {\n\tnewLines, err := i.GetInt32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32Line(index int) []int32 {\n\tv, err := i.GetInt32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt32Value(rowIndex, colIndex int) int32 {\n\tv, err := i.GetInt32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt32Value(rowIndex int) int32 {\n\tv, err := i.GetFirstInt32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt32Line(colIndex int) (newLine []int32) {\n\tnewLine, err := i.GetColInt32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt64Lines() (newLines [][]int64) {\n\tnewLines, err := i.GetInt64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64LinesFrom(fromIndex int) (newLines [][]int64) {\n\tnewLines, err := i.GetInt64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64Line(index int) []int64 {\n\tv, err := i.GetInt64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt64Value(rowIndex, colIndex int) int64 {\n\tv, err := i.GetInt64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt64Value(rowIndex int) int64 {\n\tv, err := i.GetFirstInt64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt64Line(colIndex int) (newLine []int64) {\n\tnewLine, err := i.GetColInt64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat32Lines() (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32LinesFrom(fromIndex int) (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32Line(index int) []float32 {\n\tv, err := i.GetFloat32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat32Value(rowIndex, colIndex int) float32 {\n\tv, err := i.GetFloat32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat32Value(rowIndex int) float32 {\n\tv, err := i.GetFirstFloat32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat32Line(colIndex int) (newLine []float32) {\n\tnewLine, err := i.GetColFloat32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat64Lines() (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64LinesFrom(fromIndex int) (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64Line(index int) []float64 {\n\tv, err := i.GetFloat64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat64Value(rowIndex, colIndex int) float64 {\n\tv, err := i.GetFloat64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat64Value(rowIndex int) float64 {\n\tv, err := i.GetFirstFloat64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat64Line(colIndex int) (newLine []float64) {\n\tnewLine, err := i.GetColFloat64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc lib_MustSubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_SubtractIntBy(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt(values1 []int, values2 []int) (newValues []int) {\n\tnewValues, err := lib_SubtractInt(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffIntBy(values []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_RDiffIntBy(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt(values []int) (newValues []int) {\n\tnewValues, err := lib_RDiffInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToIntSlice(s string) (ValueLine []int) {\n\tValueLine, err := lib_StringToIntSlice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToIntSlice(line []string) (ValueLine []int) {\n\tValueLine, err := lib_StringSliceToIntSlice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt(values []int) (max int) {\n\tmax, err := lib_MaxInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt(values []int) (min int) {\n\tmin, err := lib_MinInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt8(values1 []int8, values2 []int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8(values []int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt8Slice(s string) (ValueLine []int8) {\n\tValueLine, err := lib_StringToInt8Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt8Slice(line []string) (ValueLine []int8) {\n\tValueLine, err := lib_StringSliceToInt8Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt8(values []int8) (max int8) {\n\tmax, err := lib_MaxInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt8(values []int8) (min int8) {\n\tmin, err := lib_MinInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt16(values1 []int16, values2 []int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16(values []int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt16Slice(s string) (ValueLine []int16) {\n\tValueLine, err := lib_StringToInt16Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt16Slice(line []string) (ValueLine []int16) {\n\tValueLine, err := lib_StringSliceToInt16Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt16(values []int16) (max int16) {\n\tmax, err := lib_MaxInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt16(values []int16) (min int16) {\n\tmin, err := lib_MinInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt32(values1 []int32, values2 []int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32(values []int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt32Slice(s string) (ValueLine []int32) {\n\tValueLine, err := lib_StringToInt32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt32Slice(line []string) (ValueLine []int32) {\n\tValueLine, err := lib_StringSliceToInt32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt32(values []int32) (max int32) {\n\tmax, err := lib_MaxInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt32(values []int32) (min int32) {\n\tmin, err := lib_MinInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt64(values1 []int64, values2 []int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64(values []int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt64Slice(s string) (ValueLine []int64) {\n\tValueLine, err := lib_StringToInt64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt64Slice(line []string) (ValueLine []int64) {\n\tValueLine, err := lib_StringSliceToInt64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt64(values []int64) (max int64) {\n\tmax, err := lib_MaxInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt64(values []int64) (min int64) {\n\tmin, err := lib_MinInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat32(values1 []float32, values2 []float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32(values []float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat32Slice(s string) (ValueLine []float32) {\n\tValueLine, err := lib_StringToFloat32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat32Slice(line []string) (ValueLine []float32) {\n\tValueLine, err := lib_StringSliceToFloat32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat32(values []float32) (max float32) {\n\tmax, err := lib_MaxFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat32(values []float32) (min float32) {\n\tmin, err := lib_MinFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat64(values1 []float64, values2 []float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64(values []float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat64Slice(s string) (ValueLine []float64) {\n\tValueLine, err := lib_StringToFloat64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat64Slice(line []string) (ValueLine []float64) {\n\tValueLine, err := lib_StringSliceToFloat64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat64(values []float64) (max float64) {\n\tmax, err := lib_MaxFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat64(values []float64) (min float64) {\n\tmin, err := lib_MinFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustMaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustZipRune(valuesList ...[]rune) (newValuesList [][]rune) {\n\tnewValuesList, err := lib_ZipRune(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune) {\n\tnewValues, err := lib_ChunkRuneByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetRune(values []rune, i int) []rune {\n\tv, err := lib_UnsetRune(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustRuneCombination(values []rune, r int) (combinations [][]rune) {\n\tcombinations, err := lib_RuneCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustRuneSliceCombination(values [][]rune, r int) (combinations [][][]rune) {\n\tcombinations, err := lib_RuneSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipString(valuesList ...[]string) (newValuesList [][]string) {\n\tnewValuesList, err := lib_ZipString(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkStringByBits(values []string, bits []bool) (newValues [][]string) {\n\tnewValues, err := lib_ChunkStringByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetString(values []string, i int) []string {\n\tv, err := lib_UnsetString(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustStringCombination(values []string, r int) (combinations [][]string) {\n\tcombinations, err := lib_StringCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustStringSliceCombination(values [][]string, r int) (combinations [][][]string) {\n\tcombinations, err := lib_StringSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt(valuesList ...[]int) (newValuesList [][]int) {\n\tnewValuesList, err := lib_ZipInt(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkIntByBits(values []int, bits []bool) (newValues [][]int) {\n\tnewValues, err := lib_ChunkIntByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt(values []int, i int) []int {\n\tv, err := lib_UnsetInt(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustIntCombination(values []int, r int) (combinations [][]int) {\n\tcombinations, err := lib_IntCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustIntSliceCombination(values [][]int, r int) (combinations [][][]int) {\n\tcombinations, err := lib_IntSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt8(valuesList ...[]int8) (newValuesList [][]int8) {\n\tnewValuesList, err := lib_ZipInt8(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8) {\n\tnewValues, err := lib_ChunkInt8ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt8(values []int8, i int) []int8 {\n\tv, err := lib_UnsetInt8(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt8Combination(values []int8, r int) (combinations [][]int8) {\n\tcombinations, err := lib_Int8Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt8SliceCombination(values [][]int8, r int) (combinations [][][]int8) {\n\tcombinations, err := lib_Int8SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt16(valuesList ...[]int16) (newValuesList [][]int16) {\n\tnewValuesList, err := lib_ZipInt16(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16) {\n\tnewValues, err := lib_ChunkInt16ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt16(values []int16, i int) []int16 {\n\tv, err := lib_UnsetInt16(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt16Combination(values []int16, r int) (combinations [][]int16) {\n\tcombinations, err := lib_Int16Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt16SliceCombination(values [][]int16, r int) (combinations [][][]int16) {\n\tcombinations, err := lib_Int16SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt32(valuesList ...[]int32) (newValuesList [][]int32) {\n\tnewValuesList, err := lib_ZipInt32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32) {\n\tnewValues, err := lib_ChunkInt32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt32(values []int32, i int) []int32 {\n\tv, err := lib_UnsetInt32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt32Combination(values []int32, r int) (combinations [][]int32) {\n\tcombinations, err := lib_Int32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt32SliceCombination(values [][]int32, r int) (combinations [][][]int32) {\n\tcombinations, err := lib_Int32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt64(valuesList ...[]int64) (newValuesList [][]int64) {\n\tnewValuesList, err := lib_ZipInt64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64) {\n\tnewValues, err := lib_ChunkInt64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt64(values []int64, i int) []int64 {\n\tv, err := lib_UnsetInt64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt64Combination(values []int64, r int) (combinations [][]int64) {\n\tcombinations, err := lib_Int64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt64SliceCombination(values [][]int64, r int) (combinations [][][]int64) {\n\tcombinations, err := lib_Int64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat32(valuesList ...[]float32) (newValuesList [][]float32) {\n\tnewValuesList, err := lib_ZipFloat32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32) {\n\tnewValues, err := lib_ChunkFloat32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat32(values []float32, i int) []float32 {\n\tv, err := lib_UnsetFloat32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat32Combination(values []float32, r int) (combinations [][]float32) {\n\tcombinations, err := lib_Float32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat32SliceCombination(values [][]float32, r int) (combinations [][][]float32) {\n\tcombinations, err := lib_Float32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat64(valuesList ...[]float64) (newValuesList [][]float64) {\n\tnewValuesList, err := lib_ZipFloat64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64) {\n\tnewValues, err := lib_ChunkFloat64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat64(values []float64, i int) []float64 {\n\tv, err := lib_UnsetFloat64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat64Combination(values []float64, r int) (combinations [][]float64) {\n\tcombinations, err := lib_Float64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat64SliceCombination(values [][]float64, r int) (combinations [][][]float64) {\n\tcombinations, err := lib_Float64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc (i *lib_Input) MustGetLines(startRowIndex, endRowIndex int) [][]string {\n\tv, err := i.GetLines(startRowIndex, endRowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetStringLinesFrom(fromIndex int) (newLines [][]string) {\n\tnewLines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetValue(rowIndex, colIndex int) string {\n\tv, err := i.GetValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstValue(rowIndex int) string {\n\tv, err := i.GetFirstValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColLine(colIndex int) (newLine []string) {\n\tnewLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetLine(index int) []string {\n\tv, err := i.GetLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustReadAsStringGridFrom(fromIndex int) [][]string {\n\tv, err := i.ReadAsStringGridFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustNewInputFromReader(reader *bufio.Reader) *lib_Input {\n\tv, err := lib_NewInputFromReader(reader)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_toSpecificBitIntLine(line []string, bitSize int) (intLine []int64, err error) {\n\tfor j, v := range line {\n\t\tintV, err := strconv.ParseInt(v, 10, bitSize)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(fmt.Sprintf(\"%dth value: %v\", j, err.Error()))\n\t\t}\n\t\tintLine = append(intLine, intV)\n\t}\n\treturn intLine, nil\n}\n\nfunc lib_BitEnumeration(digits uint) (enums [][]bool) {\n\tif digits == 0 {\n\t\treturn [][]bool{}\n\t}\n\n\tfor i := 0; i < 1<>d&1 == 1)\n\t\t}\n\t\tenums = append(enums, e)\n\t}\n\treturn\n}\n\nfunc lib_FindPosFromStringGrid(m [][]string, s string) (int, int) {\n\tfor rowIndex, row := range m {\n\t\tfor colIndex, p := range row {\n\t\t\tif p == s {\n\t\t\t\treturn rowIndex, colIndex\n\t\t\t}\n\t\t}\n\t}\n\tpanic(s + \" not found\")\n}\n\nfunc lib_PanicIfErrorExist(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc lib_TrimSpaceAndNewLineCodeAndTab(s string) string {\n\treturn strings.TrimFunc(s, func(r rune) bool {\n\t\treturn r == ' ' || r == '\\r' || r == '\\n' || r == '\\t'\n\t})\n}\n", "language": "Go", "metadata": {"date": 1551647818, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03107.html", "problem_id": "p03107", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03107/input.txt", "sample_output_relpath": "derived/input_output/data/p03107/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03107/Go/s586461429.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s586461429", "user_id": "u562039972"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.\n// $ bundle -pkg main -prefix -dst github.com/mpppk/atcoder/abc120/c github.com/mpppk/atcoder/abc120/c\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar memo = map[string]int{}\n\nfunc solve(input *lib_Input) int {\n\ts := input.MustGetFirstValue(0)\n\tcubes := []rune(s)\n\treturn removeCube(cubes)\n}\n\nfunc removeCube(cubes []rune) int {\n\tif len(cubes) < 2 {\n\t\treturn 0\n\t}\n\n\tvar indices []int\n\tfor i := 0; i < len(cubes); i++ {\n\t\tif i < len(cubes)-1 && cubes[i] != cubes[i+1] {\n\t\t\tindices = append(indices, i)\n\t\t}\n\t}\n\tm := map[int]bool{}\n\tmaxRemovedCubesNum := 0\n\tfor _, index := range indices {\n\t\tif !m[index] {\n\t\t\tremovedCubesNum := 0\n\t\t\tnewCubes := lib_RuneRemoveFromSlice(cubes, index)\n\t\t\tnewCubes = lib_RuneRemoveFromSlice(newCubes, index)\n\t\t\tif cachedNum, ok := memo[string(newCubes)]; ok {\n\t\t\t\tremovedCubesNum = cachedNum\n\t\t\t} else {\n\t\t\t\tremovedCubesNum = removeCube(newCubes)\n\t\t\t\tmemo[string(newCubes)] = removedCubesNum\n\t\t\t}\n\t\t\tif maxRemovedCubesNum < removedCubesNum+2 {\n\t\t\t\tmaxRemovedCubesNum = removedCubesNum + 2\n\t\t\t}\n\t\t\tm[index] = true\n\t\t}\n\t}\n\n\treturn maxRemovedCubesNum\n}\n\nfunc main() {\n\tinput := lib_MustNewInputFromReader(bufio.NewReader(io.Reader(os.Stdin)))\n\tfmt.Println(solve(input))\n}\n\nfunc (i *lib_Input) GetIntLines() (newLines [][]int, err error) {\n\treturn i.GetIntLinesFrom(0)\n}\n\nfunc (i *lib_Input) GetIntLinesFrom(fromIndex int) (newLines [][]int, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetIntLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetIntLine(index int) ([]int, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToIntSlice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetIntValue(rowIndex, colIndex int) (int, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int(v), nil\n}\n\nfunc (i *lib_Input) GetFirstIntValue(rowIndex int) (int, error) {\n\treturn i.GetIntValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColIntLine(colIndex int) (newLine []int, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToIntSlice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Lines() (newLines [][]int8, err error) {\n\treturn i.GetInt8LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt8LinesFrom(fromIndex int) (newLines [][]int8, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt8Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt8Line(index int) ([]int8, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt8Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt8Value(rowIndex, colIndex int) (int8, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int8(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt8Value(rowIndex int) (int8, error) {\n\treturn i.GetInt8Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt8Line(colIndex int) (newLine []int8, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt8Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Lines() (newLines [][]int16, err error) {\n\treturn i.GetInt16LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt16LinesFrom(fromIndex int) (newLines [][]int16, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt16Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt16Line(index int) ([]int16, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt16Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt16Value(rowIndex, colIndex int) (int16, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int16(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt16Value(rowIndex int) (int16, error) {\n\treturn i.GetInt16Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt16Line(colIndex int) (newLine []int16, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt16Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Lines() (newLines [][]int32, err error) {\n\treturn i.GetInt32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt32LinesFrom(fromIndex int) (newLines [][]int32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt32Line(index int) ([]int32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt32Value(rowIndex, colIndex int) (int32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt32Value(rowIndex int) (int32, error) {\n\treturn i.GetInt32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt32Line(colIndex int) (newLine []int32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Lines() (newLines [][]int64, err error) {\n\treturn i.GetInt64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetInt64LinesFrom(fromIndex int) (newLines [][]int64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetInt64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetInt64Line(index int) ([]int64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToInt64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetInt64Value(rowIndex, colIndex int) (int64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn int64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstInt64Value(rowIndex int) (int64, error) {\n\treturn i.GetInt64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColInt64Line(colIndex int) (newLine []int64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToInt64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Lines() (newLines [][]float32, err error) {\n\treturn i.GetFloat32LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat32LinesFrom(fromIndex int) (newLines [][]float32, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat32Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat32Line(index int) ([]float32, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat32Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat32Value(rowIndex, colIndex int) (float32, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float32(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat32Value(rowIndex int) (float32, error) {\n\treturn i.GetFloat32Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat32Line(colIndex int) (newLine []float32, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat32Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Lines() (newLines [][]float64, err error) {\n\treturn i.GetFloat64LinesFrom(0)\n}\n\nfunc (i *lib_Input) GetFloat64LinesFrom(fromIndex int) (newLines [][]float64, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetFloat64Line(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetFloat64Line(index int) ([]float64, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLine, err := lib_StringSliceToFloat64Slice(i.lines[index])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth index: %v\", index, err)\n\t}\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetFloat64Value(rowIndex, colIndex int) (float64, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn 0, fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\n\tv, err := strconv.ParseInt(line[colIndex], 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to convert string to int: %v, %v\", line[colIndex], err)\n\t}\n\n\treturn float64(v), nil\n}\n\nfunc (i *lib_Input) GetFirstFloat64Value(rowIndex int) (float64, error) {\n\treturn i.GetFloat64Value(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColFloat64Line(colIndex int) (newLine []float64, err error) {\n\tstrLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewLine, err = lib_StringSliceToFloat64Slice(strLine)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%dth col index: %v\", colIndex, err)\n\t}\n\treturn\n}\n\nfunc lib_IntToBits(value int, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int8ToBits(value int8, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int16ToBits(value int16, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int32ToBits(value int32, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_Int64ToBits(value int64, minDigits int) (bits []bool) {\n\tbin := fmt.Sprintf(\"%b\", int(value))\n\tdigits := 0\n\tfor _, b := range bin {\n\t\tdigits++\n\t\tif b == '0' {\n\t\t\tbits = append(bits, false)\n\t\t} else if b == '1' {\n\t\t\tbits = append(bits, true)\n\t\t} else {\n\t\t\tpanic(\"invalid bit:\" + string(b) + \", \" + string('0'))\n\t\t}\n\t}\n\n\tfor minDigits > digits {\n\t\tbits = append([]bool{false}, bits...)\n\t\tdigits++\n\t}\n\n\treturn\n}\n\nfunc lib_GetEachDigitSumInt(n int) (sum int) {\n\tfor _, digit := range lib_ToDigitSliceInt(n) {\n\t\tsum += int(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt(n int) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt(digits []int8) int {\n\tv := int(0)\n\tfor i, digit := range digits {\n\t\tv += int(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt8(n int8) (sum int8) {\n\tfor _, digit := range lib_ToDigitSliceInt8(n) {\n\t\tsum += int8(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt8(n int8) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt8(digits []int8) int8 {\n\tv := int8(0)\n\tfor i, digit := range digits {\n\t\tv += int8(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt16(n int16) (sum int16) {\n\tfor _, digit := range lib_ToDigitSliceInt16(n) {\n\t\tsum += int16(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt16(n int16) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt16(digits []int8) int16 {\n\tv := int16(0)\n\tfor i, digit := range digits {\n\t\tv += int16(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt32(n int32) (sum int32) {\n\tfor _, digit := range lib_ToDigitSliceInt32(n) {\n\t\tsum += int32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt32(n int32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt32(digits []int8) int32 {\n\tv := int32(0)\n\tfor i, digit := range digits {\n\t\tv += int32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumInt64(n int64) (sum int64) {\n\tfor _, digit := range lib_ToDigitSliceInt64(n) {\n\t\tsum += int64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceInt64(n int64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToInt64(digits []int8) int64 {\n\tv := int64(0)\n\tfor i, digit := range digits {\n\t\tv += int64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat32(n float32) (sum float32) {\n\tfor _, digit := range lib_ToDigitSliceFloat32(n) {\n\t\tsum += float32(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat32(n float32) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat32(digits []int8) float32 {\n\tv := float32(0)\n\tfor i, digit := range digits {\n\t\tv += float32(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_GetEachDigitSumFloat64(n float64) (sum float64) {\n\tfor _, digit := range lib_ToDigitSliceFloat64(n) {\n\t\tsum += float64(digit)\n\t}\n\treturn\n}\n\nfunc lib_ToDigitSliceFloat64(n float64) (digits []int8) {\n\tnn := int64(n)\n\tfor {\n\t\tif nn <= 0 {\n\t\t\treturn lib_ReverseInt8(digits)\n\t\t}\n\t\tdigit := int8(nn % 10) // FIXME\n\t\tdigits = append(digits, digit)\n\t\tnn /= 10\n\t}\n}\n\nfunc lib_DigitsToFloat64(digits []int8) float64 {\n\tv := float64(0)\n\tfor i, digit := range digits {\n\t\tv += float64(float64(digit) * math.Pow(10, float64(len(digits)-i-1)))\n\t}\n\treturn v\n}\n\nfunc lib_SumInt(values []int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt(values []int, f func(v int) bool) (newValues []int) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt(values []int) (newValues []int) {\n\tm := map[int]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt(values1 []int, values2 []int) (newValues []int, err error) {\n\treturn lib_SubtractIntBy(values1, values2, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffIntBy(values []int, f func(v int) int) (newValues []int, err error) {\n\tdiffValues := append([]int{0}, values...)\n\tnewValues, err = lib_SubtractIntBy(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt(values []int) (newValues []int, err error) {\n\treturn lib_RDiffIntBy(values, func(v int) int {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToIntSlice(s string) (ValueLine []int, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToIntSlice(line []string) (ValueLine []int, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt(values []int) (max int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt(values []int) (min int, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewIntGridMap(grid [][]string, defaultValue int) (m [][]int) {\n\tfor _, line := range grid {\n\t\tvar newLine []int\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_IntRange(start, end, step int) []int {\n\tif end < start {\n\t\treturn []int{}\n\t}\n\ts := make([]int, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt8(values []int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt8(values []int8, f func(v int8) bool) (newValues []int8) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt8(values []int8) (newValues []int8) {\n\tm := map[int8]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt8(values1 []int8, values2 []int8) (newValues []int8, err error) {\n\treturn lib_SubtractInt8By(values1, values2, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8, err error) {\n\tdiffValues := append([]int8{0}, values...)\n\tnewValues, err = lib_SubtractInt8By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt8(values []int8) (newValues []int8, err error) {\n\treturn lib_RDiffInt8By(values, func(v int8) int8 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt8Slice(s string) (ValueLine []int8, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt8Slice(line []string) (ValueLine []int8, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int8(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8(values []int8) (max int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt8(values []int8) (min int8, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt8GridMap(grid [][]string, defaultValue int8) (m [][]int8) {\n\tfor _, line := range grid {\n\t\tvar newLine []int8\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int8Range(start, end, step int8) []int8 {\n\tif end < start {\n\t\treturn []int8{}\n\t}\n\ts := make([]int8, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt16(values []int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt16(values []int16, f func(v int16) bool) (newValues []int16) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt16(values []int16) (newValues []int16) {\n\tm := map[int16]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt16(values1 []int16, values2 []int16) (newValues []int16, err error) {\n\treturn lib_SubtractInt16By(values1, values2, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16, err error) {\n\tdiffValues := append([]int16{0}, values...)\n\tnewValues, err = lib_SubtractInt16By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt16(values []int16) (newValues []int16, err error) {\n\treturn lib_RDiffInt16By(values, func(v int16) int16 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt16Slice(s string) (ValueLine []int16, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt16Slice(line []string) (ValueLine []int16, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int16(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16(values []int16) (max int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt16(values []int16) (min int16, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt16GridMap(grid [][]string, defaultValue int16) (m [][]int16) {\n\tfor _, line := range grid {\n\t\tvar newLine []int16\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int16Range(start, end, step int16) []int16 {\n\tif end < start {\n\t\treturn []int16{}\n\t}\n\ts := make([]int16, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt32(values []int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt32(values []int32, f func(v int32) bool) (newValues []int32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt32(values []int32) (newValues []int32) {\n\tm := map[int32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt32(values1 []int32, values2 []int32) (newValues []int32, err error) {\n\treturn lib_SubtractInt32By(values1, values2, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32, err error) {\n\tdiffValues := append([]int32{0}, values...)\n\tnewValues, err = lib_SubtractInt32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt32(values []int32) (newValues []int32, err error) {\n\treturn lib_RDiffInt32By(values, func(v int32) int32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt32Slice(s string) (ValueLine []int32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt32Slice(line []string) (ValueLine []int32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32(values []int32) (max int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt32(values []int32) (min int32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt32GridMap(grid [][]string, defaultValue int32) (m [][]int32) {\n\tfor _, line := range grid {\n\t\tvar newLine []int32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int32Range(start, end, step int32) []int32 {\n\tif end < start {\n\t\treturn []int32{}\n\t}\n\ts := make([]int32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumInt64(values []int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterInt64(values []int64, f func(v int64) bool) (newValues []int64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqInt64(values []int64) (newValues []int64) {\n\tm := map[int64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractInt64(values1 []int64, values2 []int64) (newValues []int64, err error) {\n\treturn lib_SubtractInt64By(values1, values2, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64, err error) {\n\tdiffValues := append([]int64{0}, values...)\n\tnewValues, err = lib_SubtractInt64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffInt64(values []int64) (newValues []int64, err error) {\n\treturn lib_RDiffInt64By(values, func(v int64) int64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToInt64Slice(s string) (ValueLine []int64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToInt64Slice(line []string) (ValueLine []int64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, int64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64(values []int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinInt64(values []int64) (min int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewInt64GridMap(grid [][]string, defaultValue int64) (m [][]int64) {\n\tfor _, line := range grid {\n\t\tvar newLine []int64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Int64Range(start, end, step int64) []int64 {\n\tif end < start {\n\t\treturn []int64{}\n\t}\n\ts := make([]int64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat32(values []float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat32(values []float32, f func(v float32) bool) (newValues []float32) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat32(values []float32) (newValues []float32) {\n\tm := map[float32]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat32(values1 []float32, values2 []float32) (newValues []float32, err error) {\n\treturn lib_SubtractFloat32By(values1, values2, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32, err error) {\n\tdiffValues := append([]float32{0}, values...)\n\tnewValues, err = lib_SubtractFloat32By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat32(values []float32) (newValues []float32, err error) {\n\treturn lib_RDiffFloat32By(values, func(v float32) float32 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat32Slice(s string) (ValueLine []float32, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat32Slice(line []string) (ValueLine []float32, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float32(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32(values []float32) (max float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat32(values []float32) (min float32, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat32GridMap(grid [][]string, defaultValue float32) (m [][]float32) {\n\tfor _, line := range grid {\n\t\tvar newLine []float32\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float32Range(start, end, step float32) []float32 {\n\tif end < start {\n\t\treturn []float32{}\n\t}\n\ts := make([]float32, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumFloat64(values []float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += value\n\t}\n\treturn sum\n}\n\nfunc lib_FilterFloat64(values []float64, f func(v float64) bool) (newValues []float64) {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\tnewValues = append(newValues, value)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_UniqFloat64(values []float64) (newValues []float64) {\n\tm := map[float64]bool{}\n\tfor _, value := range values {\n\t\tm[value] = true\n\t}\n\n\tfor key := range m {\n\t\tnewValues = append(newValues, key)\n\t}\n\treturn\n}\n\nfunc lib_SubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tif len(values1) != len(values2) {\n\t\treturn nil, errors.New(\"two values lengths are different\")\n\t}\n\n\tfor i := 0; i < len(values1); i++ {\n\t\tfValue1 := f(values1[i])\n\t\tfValue2 := f(values2[i])\n\t\tnewValues = append(newValues, fValue1-fValue2)\n\t}\n\treturn newValues, nil\n}\n\nfunc lib_SubtractFloat64(values1 []float64, values2 []float64) (newValues []float64, err error) {\n\treturn lib_SubtractFloat64By(values1, values2, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_RDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64, err error) {\n\tdiffValues := append([]float64{0}, values...)\n\tnewValues, err = lib_SubtractFloat64By(values, diffValues[:len(diffValues)-1], f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to RDiff: %v\", err)\n\t}\n\treturn newValues[1:], nil\n}\n\nfunc lib_RDiffFloat64(values []float64) (newValues []float64, err error) {\n\treturn lib_RDiffFloat64By(values, func(v float64) float64 {\n\t\treturn v\n\t})\n}\n\nfunc lib_StringToFloat64Slice(s string) (ValueLine []float64, err error) {\n\tfor _, r := range s {\n\t\tv, err := strconv.ParseInt(string(r), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_StringSliceToFloat64Slice(line []string) (ValueLine []float64, err error) {\n\tnewLine, err := lib_toSpecificBitIntLine(line, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v := range newLine {\n\t\tValueLine = append(ValueLine, float64(v))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64(values []float64) (max float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_MinFloat64(values []float64) (min float64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\n\tmin = values[0]\n\tfor _, value := range values {\n\t\tif min > value {\n\t\t\tmin = value\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_NewFloat64GridMap(grid [][]string, defaultValue float64) (m [][]float64) {\n\tfor _, line := range grid {\n\t\tvar newLine []float64\n\t\tfor range line {\n\t\t\tnewLine = append(newLine, defaultValue)\n\t\t}\n\t\tm = append(m, newLine)\n\t}\n\treturn\n}\n\nfunc lib_Float64Range(start, end, step float64) []float64 {\n\tif end < start {\n\t\treturn []float64{}\n\t}\n\ts := make([]float64, 0, int(1+(end-start)/step))\n\tfor start < end {\n\t\ts = append(s, start)\n\t\tstart += step\n\t}\n\treturn s\n}\n\nfunc lib_SumIntByInt(values []int, f func(v int) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToIntSlice(values []int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt(values [][][]int, f func(v [][]int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSliceToInt(values, f))\n}\n\nfunc lib_MaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapIntSlice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt8(values []int, f func(v int) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt8Slice(values []int) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt(values [][]int8, f func(v []int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt(values [][][]int8, f func(v [][]int8) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt8Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt16(values []int, f func(v int) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt16Slice(values []int) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt(values [][]int16, f func(v []int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt(values [][][]int16, f func(v [][]int16) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt16Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt32(values []int, f func(v int) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt32Slice(values []int) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt(values [][]int32, f func(v []int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt(values [][][]int32, f func(v [][]int32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt32Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByInt64(values []int, f func(v int) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToInt64Slice(values []int) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt(values [][]int64, f func(v []int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt(values [][][]int64, f func(v [][]int64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapInt64Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByFloat32(values []int, f func(v int) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat32Slice(values []int) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt(values [][]float32, f func(v []float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt(values [][][]float32, f func(v [][]float32) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat32Slice2ToInt(values, f))\n}\n\nfunc lib_SumIntByFloat64(values []int, f func(v int) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_IntSliceToFloat64Slice(values []int) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt(values [][]float64, f func(v []float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt(values [][][]float64, f func(v [][]float64) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64SliceToInt(values, f))\n}\n\nfunc lib_MaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int, err error) {\n\treturn lib_MaxInt(lib_MapFloat64Slice2ToInt(values, f))\n}\n\nfunc lib_SumInt8ByInt(values []int8, f func(v int8) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToIntSlice(values []int8) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt8(values [][]int, f func(v []int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt8(values [][][]int, f func(v [][]int) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapIntSlice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt8(values []int8, f func(v int8) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt8Slice(values []int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt8(values [][][]int8, f func(v [][]int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt8Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt16(values []int8, f func(v int8) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt16Slice(values []int8) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt8(values [][]int16, f func(v []int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt8(values [][][]int16, f func(v [][]int16) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt16Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt32(values []int8, f func(v int8) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt32Slice(values []int8) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt8(values [][]int32, f func(v []int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt8(values [][][]int32, f func(v [][]int32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt32Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByInt64(values []int8, f func(v int8) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToInt64Slice(values []int8) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt8(values [][]int64, f func(v []int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt8(values [][][]int64, f func(v [][]int64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapInt64Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByFloat32(values []int8, f func(v int8) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat32Slice(values []int8) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt8(values [][]float32, f func(v []float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt8(values [][][]float32, f func(v [][]float32) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat32Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt8ByFloat64(values []int8, f func(v int8) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int8SliceToFloat64Slice(values []int8) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt8(values [][]float64, f func(v []float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt8(values [][][]float64, f func(v [][]float64) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64SliceToInt8(values, f))\n}\n\nfunc lib_MaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8, err error) {\n\treturn lib_MaxInt8(lib_MapFloat64Slice2ToInt8(values, f))\n}\n\nfunc lib_SumInt16ByInt(values []int16, f func(v int16) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToIntSlice(values []int16) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt16(values [][]int, f func(v []int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt16(values [][][]int, f func(v [][]int) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapIntSlice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt8(values []int16, f func(v int16) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt8Slice(values []int16) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt16(values [][]int8, f func(v []int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt16(values [][][]int8, f func(v [][]int8) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt8Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt16(values []int16, f func(v int16) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt16Slice(values []int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt16(values [][][]int16, f func(v [][]int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt16Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt32(values []int16, f func(v int16) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt32Slice(values []int16) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt16(values [][]int32, f func(v []int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt16(values [][][]int32, f func(v [][]int32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt32Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByInt64(values []int16, f func(v int16) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToInt64Slice(values []int16) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt16(values [][]int64, f func(v []int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt16(values [][][]int64, f func(v [][]int64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapInt64Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByFloat32(values []int16, f func(v int16) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat32Slice(values []int16) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt16(values [][]float32, f func(v []float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt16(values [][][]float32, f func(v [][]float32) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat32Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt16ByFloat64(values []int16, f func(v int16) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int16SliceToFloat64Slice(values []int16) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt16(values [][]float64, f func(v []float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt16(values [][][]float64, f func(v [][]float64) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64SliceToInt16(values, f))\n}\n\nfunc lib_MaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16, err error) {\n\treturn lib_MaxInt16(lib_MapFloat64Slice2ToInt16(values, f))\n}\n\nfunc lib_SumInt32ByInt(values []int32, f func(v int32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToIntSlice(values []int32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt32(values [][]int, f func(v []int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt32(values [][][]int, f func(v [][]int) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapIntSlice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt8(values []int32, f func(v int32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt8Slice(values []int32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt32(values [][]int8, f func(v []int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt32(values [][][]int8, f func(v [][]int8) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt8Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt16(values []int32, f func(v int32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt16Slice(values []int32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt32(values [][]int16, f func(v []int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt32(values [][][]int16, f func(v [][]int16) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt16Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt32(values []int32, f func(v int32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt32Slice(values []int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt32(values [][][]int32, f func(v [][]int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt32Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByInt64(values []int32, f func(v int32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToInt64Slice(values []int32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt32(values [][]int64, f func(v []int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt32(values [][][]int64, f func(v [][]int64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapInt64Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByFloat32(values []int32, f func(v int32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat32Slice(values []int32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt32(values [][]float32, f func(v []float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt32(values [][][]float32, f func(v [][]float32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat32Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt32ByFloat64(values []int32, f func(v int32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int32SliceToFloat64Slice(values []int32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt32(values [][]float64, f func(v []float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt32(values [][][]float64, f func(v [][]float64) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64SliceToInt32(values, f))\n}\n\nfunc lib_MaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32, err error) {\n\treturn lib_MaxInt32(lib_MapFloat64Slice2ToInt32(values, f))\n}\n\nfunc lib_SumInt64ByInt(values []int64, f func(v int64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToIntSlice(values []int64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToInt64(values [][]int, f func(v []int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToInt64(values [][][]int, f func(v [][]int) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapIntSlice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt8(values []int64, f func(v int64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt8Slice(values []int64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToInt64(values [][]int8, f func(v []int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToInt64(values [][][]int8, f func(v [][]int8) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt8Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt16(values []int64, f func(v int64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt16Slice(values []int64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToInt64(values [][]int16, f func(v []int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToInt64(values [][][]int16, f func(v [][]int16) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt16Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt32(values []int64, f func(v int64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt32Slice(values []int64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToInt64(values [][]int32, f func(v []int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToInt64(values [][][]int32, f func(v [][]int32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt32Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByInt64(values []int64, f func(v int64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToInt64Slice(values []int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToInt64(values [][][]int64, f func(v [][]int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapInt64Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByFloat32(values []int64, f func(v int64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat32Slice(values []int64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToInt64(values [][]float32, f func(v []float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToInt64(values [][][]float32, f func(v [][]float32) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat32Slice2ToInt64(values, f))\n}\n\nfunc lib_SumInt64ByFloat64(values []int64, f func(v int64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Int64SliceToFloat64Slice(values []int64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToInt64(values [][]float64, f func(v []float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToInt64(values [][][]float64, f func(v [][]float64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64SliceToInt64(values, f))\n}\n\nfunc lib_MaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64, err error) {\n\treturn lib_MaxInt64(lib_MapFloat64Slice2ToInt64(values, f))\n}\n\nfunc lib_SumFloat32ByInt(values []float32, f func(v float32) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToIntSlice(values []float32) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat32(values [][]int, f func(v []int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat32(values [][][]int, f func(v [][]int) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapIntSlice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt8(values []float32, f func(v float32) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt8Slice(values []float32) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat32(values [][]int8, f func(v []int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat32(values [][][]int8, f func(v [][]int8) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt8Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt16(values []float32, f func(v float32) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt16Slice(values []float32) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat32(values [][]int16, f func(v []int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat32(values [][][]int16, f func(v [][]int16) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt16Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt32(values []float32, f func(v float32) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt32Slice(values []float32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat32(values [][]int32, f func(v []int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat32(values [][][]int32, f func(v [][]int32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt32Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByInt64(values []float32, f func(v float32) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToInt64Slice(values []float32) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat32(values [][]int64, f func(v []int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat32(values [][][]int64, f func(v [][]int64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapInt64Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByFloat32(values []float32, f func(v float32) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat32Slice(values []float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat32(values [][][]float32, f func(v [][]float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat32Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat32ByFloat64(values []float32, f func(v float32) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float32SliceToFloat64Slice(values []float32) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat32(values [][]float64, f func(v []float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat32(values [][][]float64, f func(v [][]float64) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64SliceToFloat32(values, f))\n}\n\nfunc lib_MaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32, err error) {\n\treturn lib_MaxFloat32(lib_MapFloat64Slice2ToFloat32(values, f))\n}\n\nfunc lib_SumFloat64ByInt(values []float64, f func(v float64) int) int {\n\tvar sum int = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToIntSlice(values []float64) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSliceToFloat64(values [][]int, f func(v []int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapIntSlice2ToFloat64(values [][][]int, f func(v [][]int) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapIntSlice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt8(values []float64, f func(v float64) int8) int8 {\n\tvar sum int8 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt8Slice(values []float64) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int8(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8SliceToFloat64(values [][]int8, f func(v []int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt8Slice2ToFloat64(values [][][]int8, f func(v [][]int8) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt8Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt16(values []float64, f func(v float64) int16) int16 {\n\tvar sum int16 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt16Slice(values []float64) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int16(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16SliceToFloat64(values [][]int16, f func(v []int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt16Slice2ToFloat64(values [][][]int16, f func(v [][]int16) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt16Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt32(values []float64, f func(v float64) int32) int32 {\n\tvar sum int32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt32Slice(values []float64) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32SliceToFloat64(values [][]int32, f func(v []int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt32Slice2ToFloat64(values [][][]int32, f func(v [][]int32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt32Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByInt64(values []float64, f func(v float64) int64) int64 {\n\tvar sum int64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToInt64Slice(values []float64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, int64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64SliceToFloat64(values [][]int64, f func(v []int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapInt64Slice2ToFloat64(values [][][]int64, f func(v [][]int64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapInt64Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByFloat32(values []float64, f func(v float64) float32) float32 {\n\tvar sum float32 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat32Slice(values []float64) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float32(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32SliceToFloat64(values [][]float32, f func(v []float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat32Slice2ToFloat64(values [][][]float32, f func(v [][]float32) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat32Slice2ToFloat64(values, f))\n}\n\nfunc lib_SumFloat64ByFloat64(values []float64, f func(v float64) float64) float64 {\n\tvar sum float64 = 0\n\tfor _, value := range values {\n\t\tsum += f(value)\n\t}\n\treturn sum\n}\n\nfunc lib_Float64SliceToFloat64Slice(values []float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, float64(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64SliceToFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapFloat64Slice2ToFloat64(values [][][]float64, f func(v [][]float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64SliceToFloat64(values, f))\n}\n\nfunc lib_MaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64, err error) {\n\treturn lib_MaxFloat64(lib_MapFloat64Slice2ToFloat64(values, f))\n}\n\nfunc lib_ReduceRune(values []rune, f func(acc, cur rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceRuneSlice(values [][]rune, f func(acc rune, cur []rune) rune, initial rune) (newValue rune) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyRune(values []rune) []rune {\n\tdst := make([]rune, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseRune(values []rune) []rune {\n\tnewValues := lib_CopyRune(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapRune(values []rune, f func(v rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeRune(values [][]rune, f func(v []rune) rune) (newValues []rune) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipRune(valuesList ...[]rune) (newValuesList [][]rune, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipRune\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipRune\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []rune\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryRune(values []rune, f func(v rune) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryRuneSlice(valuesList [][]rune, f func(v []rune) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []rune\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []rune{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetRune(values []rune, i int) ([]rune, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []rune{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]rune, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_RuneCombination(values []rune, r int) (combinations [][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_RuneCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RunePermutation(values []rune, r int) (permutations [][]rune) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []rune{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_RuneRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_RunePermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneSliceCombination(values [][]rune, r int) (combinations [][][]rune, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]rune{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_RuneSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_RuneRemoveFromSlice(slice []rune, i int) []rune {\n\tn := make([]rune, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceString(values []string, f func(acc, cur string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceStringSlice(values [][]string, f func(acc string, cur []string) string, initial string) (newValue string) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyString(values []string) []string {\n\tdst := make([]string, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseString(values []string) []string {\n\tnewValues := lib_CopyString(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapString(values []string, f func(v string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeString(values [][]string, f func(v []string) string) (newValues []string) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipString(valuesList ...[]string) (newValuesList [][]string, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipString\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipString\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []string\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryString(values []string, f func(v string) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryStringSlice(valuesList [][]string, f func(v []string) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkStringByBits(values []string, bits []bool) (newValues [][]string, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []string\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []string{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetString(values []string, i int) ([]string, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []string{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]string, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_StringCombination(values []string, r int) (combinations [][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_StringCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringPermutation(values []string, r int) (permutations [][]string) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []string{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_StringRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_StringPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringSliceCombination(values [][]string, r int) (combinations [][][]string, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]string{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_StringSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_StringRemoveFromSlice(slice []string, i int) []string {\n\tn := make([]string, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt(values []int, f func(acc, cur int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceIntSlice(values [][]int, f func(acc int, cur []int) int, initial int) (newValue int) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt(values []int) []int {\n\tdst := make([]int, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt(values []int) []int {\n\tnewValues := lib_CopyInt(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt(values []int, f func(v int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt(values [][]int, f func(v []int) int) (newValues []int) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt(valuesList ...[]int) (newValuesList [][]int, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt(values []int, f func(v int) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryIntSlice(valuesList [][]int, f func(v []int) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkIntByBits(values []int, bits []bool) (newValues [][]int, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt(values []int, i int) ([]int, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_IntCombination(values []int, r int) (combinations [][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_IntCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntPermutation(values []int, r int) (permutations [][]int) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_IntRemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_IntPermutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntSliceCombination(values [][]int, r int) (combinations [][][]int, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_IntSliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_IntRemoveFromSlice(slice []int, i int) []int {\n\tn := make([]int, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt8(values []int8, f func(acc, cur int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt8Slice(values [][]int8, f func(acc int8, cur []int8) int8, initial int8) (newValue int8) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt8(values []int8) []int8 {\n\tdst := make([]int8, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt8(values []int8) []int8 {\n\tnewValues := lib_CopyInt8(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt8(values []int8, f func(v int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt8(values [][]int8, f func(v []int8) int8) (newValues []int8) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt8(valuesList ...[]int8) (newValuesList [][]int8, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt8\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt8\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int8\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt8(values []int8, f func(v int8) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt8Slice(valuesList [][]int8, f func(v []int8) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int8\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int8{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt8(values []int8, i int) ([]int8, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int8{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int8, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int8Combination(values []int8, r int) (combinations [][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int8Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8Permutation(values []int8, r int) (permutations [][]int8) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int8{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int8RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int8Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8SliceCombination(values [][]int8, r int) (combinations [][][]int8, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int8{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int8SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int8RemoveFromSlice(slice []int8, i int) []int8 {\n\tn := make([]int8, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt16(values []int16, f func(acc, cur int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt16Slice(values [][]int16, f func(acc int16, cur []int16) int16, initial int16) (newValue int16) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt16(values []int16) []int16 {\n\tdst := make([]int16, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt16(values []int16) []int16 {\n\tnewValues := lib_CopyInt16(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt16(values []int16, f func(v int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt16(values [][]int16, f func(v []int16) int16) (newValues []int16) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt16(valuesList ...[]int16) (newValuesList [][]int16, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt16\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt16\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int16\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt16(values []int16, f func(v int16) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt16Slice(valuesList [][]int16, f func(v []int16) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int16\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int16{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt16(values []int16, i int) ([]int16, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int16{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int16, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int16Combination(values []int16, r int) (combinations [][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int16Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16Permutation(values []int16, r int) (permutations [][]int16) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int16{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int16RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int16Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16SliceCombination(values [][]int16, r int) (combinations [][][]int16, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int16{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int16SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int16RemoveFromSlice(slice []int16, i int) []int16 {\n\tn := make([]int16, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt32(values []int32, f func(acc, cur int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt32Slice(values [][]int32, f func(acc int32, cur []int32) int32, initial int32) (newValue int32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt32(values []int32) []int32 {\n\tdst := make([]int32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt32(values []int32) []int32 {\n\tnewValues := lib_CopyInt32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt32(values []int32, f func(v int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt32(values [][]int32, f func(v []int32) int32) (newValues []int32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt32(valuesList ...[]int32) (newValuesList [][]int32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt32(values []int32, f func(v int32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt32Slice(valuesList [][]int32, f func(v []int32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt32(values []int32, i int) ([]int32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int32Combination(values []int32, r int) (combinations [][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32Permutation(values []int32, r int) (permutations [][]int32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32SliceCombination(values [][]int32, r int) (combinations [][][]int32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int32RemoveFromSlice(slice []int32, i int) []int32 {\n\tn := make([]int32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceInt64(values []int64, f func(acc, cur int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceInt64Slice(values [][]int64, f func(acc int64, cur []int64) int64, initial int64) (newValue int64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyInt64(values []int64) []int64 {\n\tdst := make([]int64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseInt64(values []int64) []int64 {\n\tnewValues := lib_CopyInt64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapInt64(values []int64, f func(v int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeInt64(values [][]int64, f func(v []int64) int64) (newValues []int64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipInt64(valuesList ...[]int64) (newValuesList [][]int64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipInt64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipInt64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []int64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryInt64(values []int64, f func(v int64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryInt64Slice(valuesList [][]int64, f func(v []int64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []int64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []int64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetInt64(values []int64, i int) ([]int64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []int64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]int64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Int64Combination(values []int64, r int) (combinations [][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Int64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64Permutation(values []int64, r int) (permutations [][]int64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []int64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Int64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Int64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64SliceCombination(values [][]int64, r int) (combinations [][][]int64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]int64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Int64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Int64RemoveFromSlice(slice []int64, i int) []int64 {\n\tn := make([]int64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceFloat32(values []float32, f func(acc, cur float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat32Slice(values [][]float32, f func(acc float32, cur []float32) float32, initial float32) (newValue float32) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat32(values []float32) []float32 {\n\tdst := make([]float32, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseFloat32(values []float32) []float32 {\n\tnewValues := lib_CopyFloat32(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat32(values []float32, f func(v float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat32(values [][]float32, f func(v []float32) float32) (newValues []float32) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat32(valuesList ...[]float32) (newValuesList [][]float32, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat32\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat32\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float32\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat32(values []float32, f func(v float32) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat32Slice(valuesList [][]float32, f func(v []float32) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float32\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float32{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat32(values []float32, i int) ([]float32, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float32{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float32, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float32Combination(values []float32, r int) (combinations [][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float32Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32Permutation(values []float32, r int) (permutations [][]float32) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float32{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float32RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float32Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32SliceCombination(values [][]float32, r int) (combinations [][][]float32, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float32{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float32SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float32RemoveFromSlice(slice []float32, i int) []float32 {\n\tn := make([]float32, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_ReduceFloat64(values []float64, f func(acc, cur float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_ReduceFloat64Slice(values [][]float64, f func(acc float64, cur []float64) float64, initial float64) (newValue float64) {\n\tnewValue = initial\n\tfor _, value := range values {\n\t\tnewValue = f(newValue, value)\n\t}\n\treturn\n}\n\nfunc lib_CopyFloat64(values []float64) []float64 {\n\tdst := make([]float64, len(values))\n\tcopy(dst, values)\n\treturn dst\n}\n\nfunc lib_ReverseFloat64(values []float64) []float64 {\n\tnewValues := lib_CopyFloat64(values)\n\tfor i, j := 0, len(values)-1; i < j; i, j = i+1, j-1 {\n\t\tnewValues[i], newValues[j] = values[j], values[i]\n\t}\n\treturn newValues\n}\n\nfunc lib_MapFloat64(values []float64, f func(v float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_MapTypeFloat64(values [][]float64, f func(v []float64) float64) (newValues []float64) {\n\tfor _, value := range values {\n\t\tnewValues = append(newValues, f(value))\n\t}\n\treturn\n}\n\nfunc lib_ZipFloat64(valuesList ...[]float64) (newValuesList [][]float64, err error) {\n\tif len(valuesList) == 0 {\n\t\treturn nil, errors.New(\"empty values list are given to ZipFloat64\")\n\t}\n\tvaluesLen := len(valuesList[0])\n\tfor _, values := range valuesList {\n\t\tif (len(values)) != valuesLen {\n\t\t\treturn nil, errors.New(\"different lengths values are given to ZipFloat64\")\n\t\t}\n\t}\n\n\tfor i := 0; i < valuesLen; i++ {\n\t\tvar newValues []float64\n\t\tfor _, values := range valuesList {\n\t\t\tnewValues = append(newValues, values[i])\n\t\t}\n\t\tnewValuesList = append(newValuesList, newValues)\n\t}\n\treturn\n}\n\nfunc lib_SomeFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif f(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_SomeFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif f(values) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc lib_EveryFloat64(values []float64, f func(v float64) bool) bool {\n\tfor _, value := range values {\n\t\tif !f(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_EveryFloat64Slice(valuesList [][]float64, f func(v []float64) bool) bool {\n\tfor _, values := range valuesList {\n\t\tif !f(values) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc lib_ChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64, err error) {\n\tif len(values) != len(bits)+1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"there are different length between values(%d) and bits(%d)\", len(values), len(bits)))\n\t}\n\n\tvar chunk []float64\n\tfor i, bit := range bits {\n\t\tchunk = append(chunk, values[i])\n\t\tif bit {\n\t\t\tnewValues = append(newValues, chunk)\n\t\t\tchunk = []float64{}\n\t\t}\n\t}\n\tchunk = append(chunk, values[len(values)-1])\n\tnewValues = append(newValues, chunk)\n\treturn\n}\n\nfunc lib_UnsetFloat64(values []float64, i int) ([]float64, error) {\n\tif i < 0 {\n\t\treturn nil, fmt.Errorf(\"negative number index is given: %d\", i)\n\t}\n\n\tif i >= len(values) {\n\t\treturn nil, fmt.Errorf(\"index(%d) is larger than slice length(%d)\", i, len(values))\n\t}\n\n\tif len(values) == 1 {\n\t\treturn []float64{}, nil\n\t}\n\n\tif i == len(values)-1 {\n\t\treturn values[:len(values)-1], nil\n\t}\n\n\tnewValues := make([]float64, len(values))\n\tcopy(newValues, values)\n\treturn append(newValues[:i], newValues[i+1:]...), nil\n}\n\nfunc lib_Float64Combination(values []float64, r int) (combinations [][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t}\n\t\tpartialCombinations, err := lib_Float64Combination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64Permutation(values []float64, r int) (permutations [][]float64) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tpermutations = append(permutations, []float64{value})\n\t\t}\n\t\treturn\n\t}\n\tfor i := range values {\n\t\tnewValues := lib_Float64RemoveFromSlice(values, i)\n\t\tfor _, pc := range lib_Float64Permutation(newValues, r-1) {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tpermutations = append(permutations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64SliceCombination(values [][]float64, r int) (combinations [][][]float64, err error) {\n\tif r == 1 {\n\t\tfor _, value := range values {\n\t\t\tcombinations = append(combinations, [][]float64{value})\n\t\t}\n\t\treturn\n\t}\n\n\tfor i := range values {\n\t\tnewValues := values\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tnewValues = newValues[1:]\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpartialCombinations, err := lib_Float64SliceCombination(newValues, r-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, pc := range partialCombinations {\n\t\t\tnewC := append(pc, values[i])\n\t\t\tcombinations = append(combinations, newC)\n\t\t}\n\t}\n\treturn\n}\n\nfunc lib_Float64RemoveFromSlice(slice []float64, i int) []float64 {\n\tn := make([]float64, len(slice))\n\tcopy(n, slice)\n\treturn append(n[:i], n[i+1:]...)\n}\n\nfunc lib_toLines(scanner *bufio.Scanner) [][]string {\n\tvar lines [][]string\n\tfor scanner.Scan() {\n\t\ttext := lib_TrimSpaceAndNewLineCodeAndTab(scanner.Text())\n\t\tif len(text) == 0 {\n\t\t\tlines = append(lines, []string{})\n\t\t\tcontinue\n\t\t}\n\t\tline := strings.Split(text, \" \")\n\t\tlines = append(lines, line)\n\t}\n\treturn lines\n}\n\nfunc lib_toLinesFromReader(reader *bufio.Reader) (lines [][]string, err error) {\n\tfor {\n\t\tchunks, err := lib_readLineAsChunks(reader)\n\t\tif err == io.EOF {\n\t\t\treturn lines, nil\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read line from reader: %v\", err)\n\t\t}\n\t\tlineStr := lib_TrimSpaceAndNewLineCodeAndTab(strings.Join(chunks, \"\"))\n\t\tline := strings.Split(lineStr, \" \")\n\t\tlines = append(lines, line)\n\t}\n}\n\nfunc lib_readLineAsChunks(reader *bufio.Reader) (chunks []string, err error) {\n\tfor {\n\t\tchunk, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tchunks = append(chunks, string(chunk))\n\t\tif !isPrefix {\n\t\t\treturn chunks, nil\n\t\t}\n\t}\n}\n\ntype lib_Input struct {\n\tlines [][]string\n}\n\nfunc (i *lib_Input) validateColIndex(index int) error {\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\n\treturn nil\n}\n\nfunc (i *lib_Input) validateRowIndex(index int) error {\n\tif index >= len(i.lines) {\n\t\treturn errors.New(fmt.Sprintf(\"index(%d) is larger than lines(%d)\", index, len(i.lines)))\n\t}\n\n\tif index < 0 {\n\t\treturn errors.New(fmt.Sprintf(\"index is under zero: %d\", index))\n\t}\n\treturn nil\n}\n\nfunc (i *lib_Input) GetLines(startRowIndex, endRowIndex int) ([][]string, error) {\n\tif err := i.validateRowIndex(startRowIndex); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid start row index: %v\", err)\n\t}\n\tif err := i.validateRowIndex(endRowIndex - 1); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid end row index: %v\", err)\n\t}\n\treturn i.lines[startRowIndex:endRowIndex], nil\n}\n\nfunc (i *lib_Input) GetStringLinesFrom(fromIndex int) (newLines [][]string, err error) {\n\tfor index := range i.lines {\n\t\tif index < fromIndex {\n\t\t\tcontinue\n\t\t}\n\t\tnewLine, err := i.GetLine(index)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewLines = append(newLines, newLine)\n\t}\n\treturn\n}\n\nfunc (i *lib_Input) GetValue(rowIndex, colIndex int) (string, error) {\n\tline, err := i.GetLine(rowIndex)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif colIndex < 0 || colIndex >= len(line) {\n\t\treturn \"\", fmt.Errorf(\"Invalid col index: %v \", colIndex)\n\t}\n\treturn line[colIndex], nil\n}\n\nfunc (i *lib_Input) GetFirstValue(rowIndex int) (string, error) {\n\treturn i.GetValue(rowIndex, 0)\n}\n\nfunc (i *lib_Input) GetColLine(colIndex int) (newLine []string, err error) {\n\tif err := i.validateColIndex(colIndex); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i, line := range i.lines {\n\t\tif len(line) <= colIndex {\n\t\t\treturn nil, errors.New(fmt.Sprintf(\"col index(%d) is larger than %dth line length(%d)\", colIndex, i, len(line)))\n\t\t}\n\t\tnewLine = append(newLine, line[colIndex])\n\t}\n\n\treturn newLine, nil\n}\n\nfunc (i *lib_Input) GetLine(index int) ([]string, error) {\n\tif err := i.validateRowIndex(index); err != nil {\n\t\treturn nil, err\n\t}\n\treturn i.lines[index], nil\n}\n\nfunc (i *lib_Input) ReadAsStringGridFrom(fromIndex int) ([][]string, error) {\n\tlines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar m [][]string\n\tfor _, line := range lines {\n\t\tif len(line) > 1 {\n\t\t\treturn nil, fmt.Errorf(\"unexpected length line: %v\", line)\n\t\t}\n\n\t\tvar mLine []string\n\t\tfor _, r := range line[0] {\n\t\t\tmLine = append(mLine, string(r))\n\t\t}\n\t\tm = append(m, mLine)\n\t}\n\treturn m, nil\n}\n\nfunc lib_NewInput(scanner *bufio.Scanner) *lib_Input {\n\treturn &lib_Input{\n\t\tlines: lib_toLines(scanner),\n\t}\n}\n\nfunc lib_NewInputFromReader(reader *bufio.Reader) (*lib_Input, error) {\n\tlines, err := lib_toLinesFromReader(reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create new Input from reader: %v\", err)\n\t}\n\treturn &lib_Input{\n\t\tlines: lines,\n\t}, nil\n}\n\nfunc (i *lib_Input) MustGetIntLines() (newLines [][]int) {\n\tnewLines, err := i.GetIntLines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLinesFrom(fromIndex int) (newLines [][]int) {\n\tnewLines, err := i.GetIntLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetIntLine(index int) []int {\n\tv, err := i.GetIntLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetIntValue(rowIndex, colIndex int) int {\n\tv, err := i.GetIntValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstIntValue(rowIndex int) int {\n\tv, err := i.GetFirstIntValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColIntLine(colIndex int) (newLine []int) {\n\tnewLine, err := i.GetColIntLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt8Lines() (newLines [][]int8) {\n\tnewLines, err := i.GetInt8Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8LinesFrom(fromIndex int) (newLines [][]int8) {\n\tnewLines, err := i.GetInt8LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt8Line(index int) []int8 {\n\tv, err := i.GetInt8Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt8Value(rowIndex, colIndex int) int8 {\n\tv, err := i.GetInt8Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt8Value(rowIndex int) int8 {\n\tv, err := i.GetFirstInt8Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt8Line(colIndex int) (newLine []int8) {\n\tnewLine, err := i.GetColInt8Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt16Lines() (newLines [][]int16) {\n\tnewLines, err := i.GetInt16Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16LinesFrom(fromIndex int) (newLines [][]int16) {\n\tnewLines, err := i.GetInt16LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt16Line(index int) []int16 {\n\tv, err := i.GetInt16Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt16Value(rowIndex, colIndex int) int16 {\n\tv, err := i.GetInt16Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt16Value(rowIndex int) int16 {\n\tv, err := i.GetFirstInt16Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt16Line(colIndex int) (newLine []int16) {\n\tnewLine, err := i.GetColInt16Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt32Lines() (newLines [][]int32) {\n\tnewLines, err := i.GetInt32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32LinesFrom(fromIndex int) (newLines [][]int32) {\n\tnewLines, err := i.GetInt32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt32Line(index int) []int32 {\n\tv, err := i.GetInt32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt32Value(rowIndex, colIndex int) int32 {\n\tv, err := i.GetInt32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt32Value(rowIndex int) int32 {\n\tv, err := i.GetFirstInt32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt32Line(colIndex int) (newLine []int32) {\n\tnewLine, err := i.GetColInt32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetInt64Lines() (newLines [][]int64) {\n\tnewLines, err := i.GetInt64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64LinesFrom(fromIndex int) (newLines [][]int64) {\n\tnewLines, err := i.GetInt64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetInt64Line(index int) []int64 {\n\tv, err := i.GetInt64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetInt64Value(rowIndex, colIndex int) int64 {\n\tv, err := i.GetInt64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstInt64Value(rowIndex int) int64 {\n\tv, err := i.GetFirstInt64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColInt64Line(colIndex int) (newLine []int64) {\n\tnewLine, err := i.GetColInt64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat32Lines() (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32LinesFrom(fromIndex int) (newLines [][]float32) {\n\tnewLines, err := i.GetFloat32LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat32Line(index int) []float32 {\n\tv, err := i.GetFloat32Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat32Value(rowIndex, colIndex int) float32 {\n\tv, err := i.GetFloat32Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat32Value(rowIndex int) float32 {\n\tv, err := i.GetFirstFloat32Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat32Line(colIndex int) (newLine []float32) {\n\tnewLine, err := i.GetColFloat32Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetFloat64Lines() (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64Lines()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64LinesFrom(fromIndex int) (newLines [][]float64) {\n\tnewLines, err := i.GetFloat64LinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetFloat64Line(index int) []float64 {\n\tv, err := i.GetFloat64Line(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFloat64Value(rowIndex, colIndex int) float64 {\n\tv, err := i.GetFloat64Value(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstFloat64Value(rowIndex int) float64 {\n\tv, err := i.GetFirstFloat64Value(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColFloat64Line(colIndex int) (newLine []float64) {\n\tnewLine, err := i.GetColFloat64Line(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc lib_MustSubtractIntBy(values1 []int, values2 []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_SubtractIntBy(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt(values1 []int, values2 []int) (newValues []int) {\n\tnewValues, err := lib_SubtractInt(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffIntBy(values []int, f func(v int) int) (newValues []int) {\n\tnewValues, err := lib_RDiffIntBy(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt(values []int) (newValues []int) {\n\tnewValues, err := lib_RDiffInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToIntSlice(s string) (ValueLine []int) {\n\tValueLine, err := lib_StringToIntSlice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToIntSlice(line []string) (ValueLine []int) {\n\tValueLine, err := lib_StringSliceToIntSlice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt(values []int) (max int) {\n\tmax, err := lib_MaxInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt(values []int) (min int) {\n\tmin, err := lib_MinInt(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt8By(values1 []int8, values2 []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt8(values1 []int8, values2 []int8) (newValues []int8) {\n\tnewValues, err := lib_SubtractInt8(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8By(values []int8, f func(v int8) int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt8(values []int8) (newValues []int8) {\n\tnewValues, err := lib_RDiffInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt8Slice(s string) (ValueLine []int8) {\n\tValueLine, err := lib_StringToInt8Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt8Slice(line []string) (ValueLine []int8) {\n\tValueLine, err := lib_StringSliceToInt8Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt8(values []int8) (max int8) {\n\tmax, err := lib_MaxInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt8(values []int8) (min int8) {\n\tmin, err := lib_MinInt8(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt16By(values1 []int16, values2 []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt16(values1 []int16, values2 []int16) (newValues []int16) {\n\tnewValues, err := lib_SubtractInt16(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16By(values []int16, f func(v int16) int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt16(values []int16) (newValues []int16) {\n\tnewValues, err := lib_RDiffInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt16Slice(s string) (ValueLine []int16) {\n\tValueLine, err := lib_StringToInt16Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt16Slice(line []string) (ValueLine []int16) {\n\tValueLine, err := lib_StringSliceToInt16Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt16(values []int16) (max int16) {\n\tmax, err := lib_MaxInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt16(values []int16) (min int16) {\n\tmin, err := lib_MinInt16(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt32By(values1 []int32, values2 []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt32(values1 []int32, values2 []int32) (newValues []int32) {\n\tnewValues, err := lib_SubtractInt32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32By(values []int32, f func(v int32) int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt32(values []int32) (newValues []int32) {\n\tnewValues, err := lib_RDiffInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt32Slice(s string) (ValueLine []int32) {\n\tValueLine, err := lib_StringToInt32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt32Slice(line []string) (ValueLine []int32) {\n\tValueLine, err := lib_StringSliceToInt32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt32(values []int32) (max int32) {\n\tmax, err := lib_MaxInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt32(values []int32) (min int32) {\n\tmin, err := lib_MinInt32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractInt64By(values1 []int64, values2 []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractInt64(values1 []int64, values2 []int64) (newValues []int64) {\n\tnewValues, err := lib_SubtractInt64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64By(values []int64, f func(v int64) int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffInt64(values []int64) (newValues []int64) {\n\tnewValues, err := lib_RDiffInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToInt64Slice(s string) (ValueLine []int64) {\n\tValueLine, err := lib_StringToInt64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToInt64Slice(line []string) (ValueLine []int64) {\n\tValueLine, err := lib_StringSliceToInt64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxInt64(values []int64) (max int64) {\n\tmax, err := lib_MaxInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinInt64(values []int64) (min int64) {\n\tmin, err := lib_MinInt64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat32By(values1 []float32, values2 []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat32(values1 []float32, values2 []float32) (newValues []float32) {\n\tnewValues, err := lib_SubtractFloat32(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32By(values []float32, f func(v float32) float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat32(values []float32) (newValues []float32) {\n\tnewValues, err := lib_RDiffFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat32Slice(s string) (ValueLine []float32) {\n\tValueLine, err := lib_StringToFloat32Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat32Slice(line []string) (ValueLine []float32) {\n\tValueLine, err := lib_StringSliceToFloat32Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat32(values []float32) (max float32) {\n\tmax, err := lib_MaxFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat32(values []float32) (min float32) {\n\tmin, err := lib_MinFloat32(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustSubtractFloat64By(values1 []float64, values2 []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64By(values1, values2, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustSubtractFloat64(values1 []float64, values2 []float64) (newValues []float64) {\n\tnewValues, err := lib_SubtractFloat64(values1, values2)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64By(values []float64, f func(v float64) float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64By(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustRDiffFloat64(values []float64) (newValues []float64) {\n\tnewValues, err := lib_RDiffFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustStringToFloat64Slice(s string) (ValueLine []float64) {\n\tValueLine, err := lib_StringToFloat64Slice(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustStringSliceToFloat64Slice(line []string) (ValueLine []float64) {\n\tValueLine, err := lib_StringSliceToFloat64Slice(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ValueLine\n}\n\nfunc lib_MustMaxFloat64(values []float64) (max float64) {\n\tmax, err := lib_MaxFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMinFloat64(values []float64) (min float64) {\n\tmin, err := lib_MinFloat64(values)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn min\n}\n\nfunc lib_MustMaxIntByIntSlice(values [][]int, f func(vs []int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByIntSlice2(values [][][]int, f func(vs [][]int) int) (max int) {\n\tmax, err := lib_MaxIntByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice(values [][]int8, f func(vs []int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt8Slice2(values [][][]int8, f func(vs [][]int8) int) (max int) {\n\tmax, err := lib_MaxIntByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice(values [][]int16, f func(vs []int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt16Slice2(values [][][]int16, f func(vs [][]int16) int) (max int) {\n\tmax, err := lib_MaxIntByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice(values [][]int32, f func(vs []int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt32Slice2(values [][][]int32, f func(vs [][]int32) int) (max int) {\n\tmax, err := lib_MaxIntByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice(values [][]int64, f func(vs []int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByInt64Slice2(values [][][]int64, f func(vs [][]int64) int) (max int) {\n\tmax, err := lib_MaxIntByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice(values [][]float32, f func(vs []float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int) (max int) {\n\tmax, err := lib_MaxIntByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice(values [][]float64, f func(vs []float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxIntByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int) (max int) {\n\tmax, err := lib_MaxIntByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice(values [][]int, f func(vs []int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByIntSlice2(values [][][]int, f func(vs [][]int) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice(values [][]int8, f func(vs []int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice(values [][]int16, f func(vs []int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice(values [][]int32, f func(vs []int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice(values [][]int64, f func(vs []int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice(values [][]float32, f func(vs []float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice(values [][]float64, f func(vs []float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt8ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int8) (max int8) {\n\tmax, err := lib_MaxInt8ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice(values [][]int, f func(vs []int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByIntSlice2(values [][][]int, f func(vs [][]int) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice(values [][]int8, f func(vs []int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice(values [][]int16, f func(vs []int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice(values [][]int32, f func(vs []int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice(values [][]int64, f func(vs []int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice(values [][]float32, f func(vs []float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice(values [][]float64, f func(vs []float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt16ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int16) (max int16) {\n\tmax, err := lib_MaxInt16ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice(values [][]int, f func(vs []int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByIntSlice2(values [][][]int, f func(vs [][]int) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice(values [][]int8, f func(vs []int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice(values [][]int16, f func(vs []int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice(values [][]int32, f func(vs []int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice(values [][]int64, f func(vs []int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice(values [][]float32, f func(vs []float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice(values [][]float64, f func(vs []float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int32) (max int32) {\n\tmax, err := lib_MaxInt32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice(values [][]int, f func(vs []int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByIntSlice2(values [][][]int, f func(vs [][]int) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice(values [][]int8, f func(vs []int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice(values [][]int16, f func(vs []int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice(values [][]int32, f func(vs []int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice(values [][]int64, f func(vs []int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice(values [][]float32, f func(vs []float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice(values [][]float64, f func(vs []float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxInt64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) int64) (max int64) {\n\tmax, err := lib_MaxInt64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice(values [][]int, f func(vs []int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByIntSlice2(values [][][]int, f func(vs [][]int) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice(values [][]int8, f func(vs []int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice(values [][]int16, f func(vs []int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice(values [][]int32, f func(vs []int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice(values [][]int64, f func(vs []int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice(values [][]float32, f func(vs []float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice(values [][]float64, f func(vs []float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat32ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float32) (max float32) {\n\tmax, err := lib_MaxFloat32ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice(values [][]int, f func(vs []int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByIntSlice2(values [][][]int, f func(vs [][]int) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByIntSlice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice(values [][]int8, f func(vs []int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt8Slice2(values [][][]int8, f func(vs [][]int8) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt8Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice(values [][]int16, f func(vs []int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt16Slice2(values [][][]int16, f func(vs [][]int16) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt16Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice(values [][]int32, f func(vs []int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt32Slice2(values [][][]int32, f func(vs [][]int32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice(values [][]int64, f func(vs []int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByInt64Slice2(values [][][]int64, f func(vs [][]int64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByInt64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice(values [][]float32, f func(vs []float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat32Slice2(values [][][]float32, f func(vs [][]float32) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat32Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice(values [][]float64, f func(vs []float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustMaxFloat64ByFloat64Slice2(values [][][]float64, f func(vs [][]float64) float64) (max float64) {\n\tmax, err := lib_MaxFloat64ByFloat64Slice2(values, f)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\n\nfunc lib_MustZipRune(valuesList ...[]rune) (newValuesList [][]rune) {\n\tnewValuesList, err := lib_ZipRune(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkRuneByBits(values []rune, bits []bool) (newValues [][]rune) {\n\tnewValues, err := lib_ChunkRuneByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetRune(values []rune, i int) []rune {\n\tv, err := lib_UnsetRune(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustRuneCombination(values []rune, r int) (combinations [][]rune) {\n\tcombinations, err := lib_RuneCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustRuneSliceCombination(values [][]rune, r int) (combinations [][][]rune) {\n\tcombinations, err := lib_RuneSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipString(valuesList ...[]string) (newValuesList [][]string) {\n\tnewValuesList, err := lib_ZipString(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkStringByBits(values []string, bits []bool) (newValues [][]string) {\n\tnewValues, err := lib_ChunkStringByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetString(values []string, i int) []string {\n\tv, err := lib_UnsetString(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustStringCombination(values []string, r int) (combinations [][]string) {\n\tcombinations, err := lib_StringCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustStringSliceCombination(values [][]string, r int) (combinations [][][]string) {\n\tcombinations, err := lib_StringSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt(valuesList ...[]int) (newValuesList [][]int) {\n\tnewValuesList, err := lib_ZipInt(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkIntByBits(values []int, bits []bool) (newValues [][]int) {\n\tnewValues, err := lib_ChunkIntByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt(values []int, i int) []int {\n\tv, err := lib_UnsetInt(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustIntCombination(values []int, r int) (combinations [][]int) {\n\tcombinations, err := lib_IntCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustIntSliceCombination(values [][]int, r int) (combinations [][][]int) {\n\tcombinations, err := lib_IntSliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt8(valuesList ...[]int8) (newValuesList [][]int8) {\n\tnewValuesList, err := lib_ZipInt8(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt8ByBits(values []int8, bits []bool) (newValues [][]int8) {\n\tnewValues, err := lib_ChunkInt8ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt8(values []int8, i int) []int8 {\n\tv, err := lib_UnsetInt8(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt8Combination(values []int8, r int) (combinations [][]int8) {\n\tcombinations, err := lib_Int8Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt8SliceCombination(values [][]int8, r int) (combinations [][][]int8) {\n\tcombinations, err := lib_Int8SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt16(valuesList ...[]int16) (newValuesList [][]int16) {\n\tnewValuesList, err := lib_ZipInt16(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt16ByBits(values []int16, bits []bool) (newValues [][]int16) {\n\tnewValues, err := lib_ChunkInt16ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt16(values []int16, i int) []int16 {\n\tv, err := lib_UnsetInt16(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt16Combination(values []int16, r int) (combinations [][]int16) {\n\tcombinations, err := lib_Int16Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt16SliceCombination(values [][]int16, r int) (combinations [][][]int16) {\n\tcombinations, err := lib_Int16SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt32(valuesList ...[]int32) (newValuesList [][]int32) {\n\tnewValuesList, err := lib_ZipInt32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt32ByBits(values []int32, bits []bool) (newValues [][]int32) {\n\tnewValues, err := lib_ChunkInt32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt32(values []int32, i int) []int32 {\n\tv, err := lib_UnsetInt32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt32Combination(values []int32, r int) (combinations [][]int32) {\n\tcombinations, err := lib_Int32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt32SliceCombination(values [][]int32, r int) (combinations [][][]int32) {\n\tcombinations, err := lib_Int32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipInt64(valuesList ...[]int64) (newValuesList [][]int64) {\n\tnewValuesList, err := lib_ZipInt64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkInt64ByBits(values []int64, bits []bool) (newValues [][]int64) {\n\tnewValues, err := lib_ChunkInt64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetInt64(values []int64, i int) []int64 {\n\tv, err := lib_UnsetInt64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustInt64Combination(values []int64, r int) (combinations [][]int64) {\n\tcombinations, err := lib_Int64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustInt64SliceCombination(values [][]int64, r int) (combinations [][][]int64) {\n\tcombinations, err := lib_Int64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat32(valuesList ...[]float32) (newValuesList [][]float32) {\n\tnewValuesList, err := lib_ZipFloat32(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat32ByBits(values []float32, bits []bool) (newValues [][]float32) {\n\tnewValues, err := lib_ChunkFloat32ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat32(values []float32, i int) []float32 {\n\tv, err := lib_UnsetFloat32(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat32Combination(values []float32, r int) (combinations [][]float32) {\n\tcombinations, err := lib_Float32Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat32SliceCombination(values [][]float32, r int) (combinations [][][]float32) {\n\tcombinations, err := lib_Float32SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustZipFloat64(valuesList ...[]float64) (newValuesList [][]float64) {\n\tnewValuesList, err := lib_ZipFloat64(valuesList...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValuesList\n}\n\nfunc lib_MustChunkFloat64ByBits(values []float64, bits []bool) (newValues [][]float64) {\n\tnewValues, err := lib_ChunkFloat64ByBits(values, bits)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newValues\n}\n\nfunc lib_MustUnsetFloat64(values []float64, i int) []float64 {\n\tv, err := lib_UnsetFloat64(values, i)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustFloat64Combination(values []float64, r int) (combinations [][]float64) {\n\tcombinations, err := lib_Float64Combination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc lib_MustFloat64SliceCombination(values [][]float64, r int) (combinations [][][]float64) {\n\tcombinations, err := lib_Float64SliceCombination(values, r)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn combinations\n}\n\nfunc (i *lib_Input) MustGetLines(startRowIndex, endRowIndex int) [][]string {\n\tv, err := i.GetLines(startRowIndex, endRowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetStringLinesFrom(fromIndex int) (newLines [][]string) {\n\tnewLines, err := i.GetStringLinesFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLines\n}\n\nfunc (i *lib_Input) MustGetValue(rowIndex, colIndex int) string {\n\tv, err := i.GetValue(rowIndex, colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetFirstValue(rowIndex int) string {\n\tv, err := i.GetFirstValue(rowIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustGetColLine(colIndex int) (newLine []string) {\n\tnewLine, err := i.GetColLine(colIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn newLine\n}\n\nfunc (i *lib_Input) MustGetLine(index int) []string {\n\tv, err := i.GetLine(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc (i *lib_Input) MustReadAsStringGridFrom(fromIndex int) [][]string {\n\tv, err := i.ReadAsStringGridFrom(fromIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_MustNewInputFromReader(reader *bufio.Reader) *lib_Input {\n\tv, err := lib_NewInputFromReader(reader)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\nfunc lib_toSpecificBitIntLine(line []string, bitSize int) (intLine []int64, err error) {\n\tfor j, v := range line {\n\t\tintV, err := strconv.ParseInt(v, 10, bitSize)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(fmt.Sprintf(\"%dth value: %v\", j, err.Error()))\n\t\t}\n\t\tintLine = append(intLine, intV)\n\t}\n\treturn intLine, nil\n}\n\nfunc lib_BitEnumeration(digits uint) (enums [][]bool) {\n\tif digits == 0 {\n\t\treturn [][]bool{}\n\t}\n\n\tfor i := 0; i < 1<>d&1 == 1)\n\t\t}\n\t\tenums = append(enums, e)\n\t}\n\treturn\n}\n\nfunc lib_FindPosFromStringGrid(m [][]string, s string) (int, int) {\n\tfor rowIndex, row := range m {\n\t\tfor colIndex, p := range row {\n\t\t\tif p == s {\n\t\t\t\treturn rowIndex, colIndex\n\t\t\t}\n\t\t}\n\t}\n\tpanic(s + \" not found\")\n}\n\nfunc lib_PanicIfErrorExist(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc lib_TrimSpaceAndNewLineCodeAndTab(s string) string {\n\treturn strings.TrimFunc(s, func(r rune) bool {\n\t\treturn r == ' ' || r == '\\r' || r == '\\n' || r == '\\t'\n\t})\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "0011\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03107", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 184283, "cpu_time_ms": 2204, "memory_kb": 1629184}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s335187920", "group_id": "codeNet:p03108", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc120/tasks/abc120_d\n// ---------------------------------------------\npackage main\n\nimport \"fmt\"\n\ntype djSet struct{ p []int }\n\nfunc newDj(size int) *djSet {\n\tdj := &djSet{}\n\tdj.initDjSet(size)\n\treturn dj\n}\nfunc (dj *djSet) initDjSet(size int) {\n\tdj.p = make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tdj.p[i] = -1\n\t}\n\treturn\n}\nfunc (dj *djSet) unite(x, y int) bool {\n\txr, yr := dj.find(x), dj.find(y)\n\tif xr != yr {\n\t\tif dj.p[yr] < dj.p[xr] {\n\t\t\tx, y = y, x\n\t\t\txr, yr = yr, xr\n\t\t}\n\t\tdj.p[xr] += dj.p[yr]\n\t\tdj.p[yr] = x\n\t}\n\treturn xr != yr\n}\nfunc (dj *djSet) find(x int) int {\n\tif dj.p[x] < 0 {\n\t\treturn x\n\t}\n\tdj.p[x] = dj.find(dj.p[x])\n\treturn dj.p[x]\n}\nfunc (dj *djSet) isSame(x, y int) bool { return dj.find(x) == dj.find(y) }\nfunc (dj *djSet) size(x int) int { return -dj.p[dj.find(x)] }\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tas := make([]int, m)\n\tbs := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&as[i], &bs[i])\n\t\tas[i]--\n\t\tbs[i]--\n\t}\n\n\tconvenience := 0\n\tconveniences := make([]int, m)\n\tdj := newDj(n)\n\tfor i := m - 1; i >= 0; i-- {\n\t\tif !dj.isSame(as[i], bs[i]) {\n\t\t\tconvenience += dj.size(as[i]) * dj.size(bs[i])\n\t\t\tdj.unite(as[i], bs[i])\n\t\t}\n\t\tconveniences[i] = convenience\n\t}\n\n\tconveniences = append(conveniences, 0)\n\tinconvenience := 0\n\tfor i := 1; i < len(conveniences); i++ {\n\t\tinconvenience += conveniences[i-1] - conveniences[i]\n\t\tfmt.Println(inconvenience)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1572348514, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03108.html", "problem_id": "p03108", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03108/input.txt", "sample_output_relpath": "derived/input_output/data/p03108/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03108/Go/s335187920.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s335187920", "user_id": "u554269352"}, "prompt_components": {"gold_output": "0\n0\n4\n5\n6\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc120/tasks/abc120_d\n// ---------------------------------------------\npackage main\n\nimport \"fmt\"\n\ntype djSet struct{ p []int }\n\nfunc newDj(size int) *djSet {\n\tdj := &djSet{}\n\tdj.initDjSet(size)\n\treturn dj\n}\nfunc (dj *djSet) initDjSet(size int) {\n\tdj.p = make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tdj.p[i] = -1\n\t}\n\treturn\n}\nfunc (dj *djSet) unite(x, y int) bool {\n\txr, yr := dj.find(x), dj.find(y)\n\tif xr != yr {\n\t\tif dj.p[yr] < dj.p[xr] {\n\t\t\tx, y = y, x\n\t\t\txr, yr = yr, xr\n\t\t}\n\t\tdj.p[xr] += dj.p[yr]\n\t\tdj.p[yr] = x\n\t}\n\treturn xr != yr\n}\nfunc (dj *djSet) find(x int) int {\n\tif dj.p[x] < 0 {\n\t\treturn x\n\t}\n\tdj.p[x] = dj.find(dj.p[x])\n\treturn dj.p[x]\n}\nfunc (dj *djSet) isSame(x, y int) bool { return dj.find(x) == dj.find(y) }\nfunc (dj *djSet) size(x int) int { return -dj.p[dj.find(x)] }\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tas := make([]int, m)\n\tbs := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&as[i], &bs[i])\n\t\tas[i]--\n\t\tbs[i]--\n\t}\n\n\tconvenience := 0\n\tconveniences := make([]int, m)\n\tdj := newDj(n)\n\tfor i := m - 1; i >= 0; i-- {\n\t\tif !dj.isSame(as[i], bs[i]) {\n\t\t\tconvenience += dj.size(as[i]) * dj.size(bs[i])\n\t\t\tdj.unite(as[i], bs[i])\n\t\t}\n\t\tconveniences[i] = convenience\n\t}\n\n\tconveniences = append(conveniences, 0)\n\tinconvenience := 0\n\tfor i := 1; i < len(conveniences); i++ {\n\t\tinconvenience += conveniences[i-1] - conveniences[i]\n\t\tfmt.Println(inconvenience)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "sample_input": "4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n"}, "reference_outputs": ["0\n0\n4\n5\n6\n"], "source_document_id": "p03108", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1448, "cpu_time_ms": 1091, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s564971392", "group_id": "codeNet:p03109", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\t// Code for A - Still TBD\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tyyyy, _ := strconv.Atoi(S[0:4])\n\tmm, _ := strconv.Atoi(S[5:7])\n\tif yyyy <= 2018 {\n\t\tfmt.Println(\"Heisei\")\n\t} else if yyyy == 2019 && mm <= 4 {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1596580891, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/Go/s564971392.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s564971392", "user_id": "u128015095"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\t// Code for A - Still TBD\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tyyyy, _ := strconv.Atoi(S[0:4])\n\tmm, _ := strconv.Atoi(S[5:7])\n\tif yyyy <= 2018 {\n\t\tfmt.Println(\"Heisei\")\n\t} else if yyyy == 2019 && mm <= 4 {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 325, "cpu_time_ms": 8, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s896532335", "group_id": "codeNet:p03109", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := strings.Split(next(), \"/\")\n\ty, _ := strconv.Atoi(s[0])\n\tm, _ := strconv.Atoi(s[1])\n\td, _ := strconv.Atoi(s[2])\n\th := false\n\tif y < 2019 {\n\t\th = true\n\t} else if y == 2019 && m < 4 {\n\t\th = true\n\t} else if y == 2019 && m == 4 && d <= 30 {\n\t\th = true\n\t}\n\tif h {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1577920699, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/Go/s896532335.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s896532335", "user_id": "u502813058"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := strings.Split(next(), \"/\")\n\ty, _ := strconv.Atoi(s[0])\n\tm, _ := strconv.Atoi(s[1])\n\td, _ := strconv.Atoi(s[2])\n\th := false\n\tif y < 2019 {\n\t\th = true\n\t} else if y == 2019 && m < 4 {\n\t\th = true\n\t} else if y == 2019 && m == 4 && d <= 30 {\n\t\th = true\n\t}\n\tif h {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 808, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s168112627", "group_id": "codeNet:p03109", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\n\tfmt.Println(logic(s))\n}\n\nfunc logic(s string) string {\n\ta := strings.Replace(s, \"/\", \"\", -1)\n\tb, _ := strconv.Atoi(a)\n\n\tif b < 20190501 {\n\t\treturn \"Heisei\"\n\t}\n\treturn \"TBD\"\n}\n", "language": "Go", "metadata": {"date": 1574027281, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/Go/s168112627.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s168112627", "user_id": "u434868408"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\n\tfmt.Println(logic(s))\n}\n\nfunc logic(s string) string {\n\ta := strings.Replace(s, \"/\", \"\", -1)\n\tb, _ := strconv.Atoi(a)\n\n\tif b < 20190501 {\n\t\treturn \"Heisei\"\n\t}\n\treturn \"TBD\"\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 276, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s126066886", "group_id": "codeNet:p03110", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsumJPY := 0\n\tsumBTC := 0.0\n\tvar (\n\t\tx float64\n\t\tu string\n\t)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x, &u)\n\t\tif u == \"JPY\" {\n\t\t\tsumJPY += int(x)\n\t\t} else {\n\t\t\tsumBTC += x\n\t\t}\n\t}\n\n\tfmt.Println(float64(sumJPY) + sumBTC*380000.0)\n}\n", "language": "Go", "metadata": {"date": 1556685933, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03110.html", "problem_id": "p03110", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03110/input.txt", "sample_output_relpath": "derived/input_output/data/p03110/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03110/Go/s126066886.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s126066886", "user_id": "u461993794"}, "prompt_components": {"gold_output": "48000.0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsumJPY := 0\n\tsumBTC := 0.0\n\tvar (\n\t\tx float64\n\t\tu string\n\t)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x, &u)\n\t\tif u == \"JPY\" {\n\t\t\tsumJPY += int(x)\n\t\t} else {\n\t\t\tsumBTC += x\n\t\t}\n\t}\n\n\tfmt.Println(float64(sumJPY) + sumBTC*380000.0)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi received otoshidama (New Year's money gifts) from N of his relatives.\n\nYou are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.\n\nFor example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.\n\nIf we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?\n\nConstraints\n\n2 \\leq N \\leq 10\n\nu_i = JPY or BTC.\n\nIf u_i = JPY, x_i is an integer such that 1 \\leq x_i \\leq 10^8.\n\nIf u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \\leq x_i \\leq 100.00000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 u_1\nx_2 u_2\n:\nx_N u_N\n\nOutput\n\nIf the gifts are worth Y yen in total, print the value Y (not necessarily an integer).\n\nOutput will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10000 JPY\n0.10000000 BTC\n\nSample Output 1\n\n48000.0\n\nThe otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.\n\nOutputs such as 48000 and 48000.1 will also be judged correct.\n\nSample Input 2\n\n3\n100000000 JPY\n100.00000000 BTC\n0.00000001 BTC\n\nSample Output 2\n\n138000000.0038\n\nIn this case, outputs such as 138001000 and 1.38e8 will also be judged correct.", "sample_input": "2\n10000 JPY\n0.10000000 BTC\n"}, "reference_outputs": ["48000.0\n"], "source_document_id": "p03110", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi received otoshidama (New Year's money gifts) from N of his relatives.\n\nYou are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.\n\nFor example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.\n\nIf we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?\n\nConstraints\n\n2 \\leq N \\leq 10\n\nu_i = JPY or BTC.\n\nIf u_i = JPY, x_i is an integer such that 1 \\leq x_i \\leq 10^8.\n\nIf u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \\leq x_i \\leq 100.00000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 u_1\nx_2 u_2\n:\nx_N u_N\n\nOutput\n\nIf the gifts are worth Y yen in total, print the value Y (not necessarily an integer).\n\nOutput will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n10000 JPY\n0.10000000 BTC\n\nSample Output 1\n\n48000.0\n\nThe otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.\n\nOutputs such as 48000 and 48000.1 will also be judged correct.\n\nSample Input 2\n\n3\n100000000 JPY\n100.00000000 BTC\n0.00000001 BTC\n\nSample Output 2\n\n138000000.0038\n\nIn this case, outputs such as 138001000 and 1.38e8 will also be judged correct.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 296, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497565427", "group_id": "codeNet:p03111", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -1 * x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc min(a ...int) int {\n\tmin := 1000000000\n\tfor _, x := range a {\n\t\tif min > x {\n\t\t\tmin = x\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, A, B, C := nextInt(), nextInt(), nextInt(), nextInt()\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tl[i] = nextInt()\n\t}\n\n\tvar dfs func(cur, a, b, c int) int\n\tdfs = func(cur, a, b, c int) int {\n\t\tif cur == n {\n\t\t\tif min(a, b, c) == 0 {\n\t\t\t\treturn 1000000000\n\t\t\t}\n\t\t\treturn abs(A-a) + abs(B-b) + abs(C-c) - 30\n\t\t}\n\n\t\tcand1 := dfs(cur+1, a, b, c)\n\t\tcand2 := dfs(cur+1, a+l[cur], b, c) + 10\n\t\tcand3 := dfs(cur+1, a, b+l[cur], c) + 10\n\t\tcand4 := dfs(cur+1, a, b, c+l[cur]) + 10\n\t\treturn min(cand1, cand2, cand3, cand4)\n\t}\n\n\tfmt.Println(dfs(0, 0, 0, 0))\n}", "language": "Go", "metadata": {"date": 1562189531, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03111.html", "problem_id": "p03111", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03111/input.txt", "sample_output_relpath": "derived/input_output/data/p03111/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03111/Go/s497565427.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s497565427", "user_id": "u703739962"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -1 * x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc min(a ...int) int {\n\tmin := 1000000000\n\tfor _, x := range a {\n\t\tif min > x {\n\t\t\tmin = x\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, A, B, C := nextInt(), nextInt(), nextInt(), nextInt()\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tl[i] = nextInt()\n\t}\n\n\tvar dfs func(cur, a, b, c int) int\n\tdfs = func(cur, a, b, c int) int {\n\t\tif cur == n {\n\t\t\tif min(a, b, c) == 0 {\n\t\t\t\treturn 1000000000\n\t\t\t}\n\t\t\treturn abs(A-a) + abs(B-b) + abs(C-c) - 30\n\t\t}\n\n\t\tcand1 := dfs(cur+1, a, b, c)\n\t\tcand2 := dfs(cur+1, a+l[cur], b, c) + 10\n\t\tcand3 := dfs(cur+1, a, b+l[cur], c) + 10\n\t\tcand4 := dfs(cur+1, a, b, c+l[cur]) + 10\n\t\treturn min(cand1, cand2, cand3, cand4)\n\t}\n\n\tfmt.Println(dfs(0, 0, 0, 0))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "sample_input": "5 100 90 80\n98\n40\n30\n21\n80\n"}, "reference_outputs": ["23\n"], "source_document_id": "p03111", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1046, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s991814562", "group_id": "codeNet:p03111", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar N, A, B, C int\nvar Flag []int\nvar MP []int\n\nfunc longer(i int, x int) {\n\tMP[i] += int(math.Abs(float64(x)))\n}\n\nfunc main() {\n\n\tfmt.Scan(&N, &A, &B, &C)\n\tKadomatsu := []int{A, B, C}\n\tL := make([]int, N)\n\tKFlag := []int{0, 0, 0}\n\tTFlag := make([]int, N)\n\tfor j := 0; j < N; j++ {\n\t\tTFlag[j] = 0\n\t}\n\tMP = []int{0, 0, 0}\n\n\tfor j := 0; j < N; j++ {\n\t\tfmt.Scan(&L[j])\n\t\t// 竹が、門松の長さを満たしていないかチェック\n\t\t// 竹と門松の差分が10以内の場合、延長短縮を用いてアジャストさせる\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tif math.Abs(float64(L[j]-Kadomatsu[i])) < 10 && KFlag[i] == 0 {\n\t\t\t\tKFlag[i] = 1\n\t\t\t\tTFlag[j] = 1\n\t\t\t\tMP[i] += int(math.Abs(float64(L[j] - Kadomatsu[i])))\n\t\t\t}\n\t\t}\n\t}\n\t// 長さを満たしていない門松に対して\n\t//for i := 0; i < 3; i++ {\n\t//\tif Flag[i] == 0 {\n\n\t//\t}\n\t//}\n\tfmt.Println(MP[0] + MP[1] + MP[2])\n\n}", "language": "Go", "metadata": {"date": 1551043617, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03111.html", "problem_id": "p03111", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03111/input.txt", "sample_output_relpath": "derived/input_output/data/p03111/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03111/Go/s991814562.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s991814562", "user_id": "u110892638"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar N, A, B, C int\nvar Flag []int\nvar MP []int\n\nfunc longer(i int, x int) {\n\tMP[i] += int(math.Abs(float64(x)))\n}\n\nfunc main() {\n\n\tfmt.Scan(&N, &A, &B, &C)\n\tKadomatsu := []int{A, B, C}\n\tL := make([]int, N)\n\tKFlag := []int{0, 0, 0}\n\tTFlag := make([]int, N)\n\tfor j := 0; j < N; j++ {\n\t\tTFlag[j] = 0\n\t}\n\tMP = []int{0, 0, 0}\n\n\tfor j := 0; j < N; j++ {\n\t\tfmt.Scan(&L[j])\n\t\t// 竹が、門松の長さを満たしていないかチェック\n\t\t// 竹と門松の差分が10以内の場合、延長短縮を用いてアジャストさせる\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tif math.Abs(float64(L[j]-Kadomatsu[i])) < 10 && KFlag[i] == 0 {\n\t\t\t\tKFlag[i] = 1\n\t\t\t\tTFlag[j] = 1\n\t\t\t\tMP[i] += int(math.Abs(float64(L[j] - Kadomatsu[i])))\n\t\t\t}\n\t\t}\n\t}\n\t// 長さを満たしていない門松に対して\n\t//for i := 0; i < 3; i++ {\n\t//\tif Flag[i] == 0 {\n\n\t//\t}\n\t//}\n\tfmt.Println(MP[0] + MP[1] + MP[2])\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "sample_input": "5 100 90 80\n98\n40\n30\n21\n80\n"}, "reference_outputs": ["23\n"], "source_document_id": "p03111", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 928, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s615784686", "group_id": "codeNet:p03112", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc scanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc get_int(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar a, b, q int\n\tfmt.Scan(&a, &b, &q)\n\n\tss := make([]int, a)\n\tts := make([]int, b)\n\txs := make([]int, q)\n\n\tsc := scanner()\n\tfor i := range ss {\n\t\tss[i] = get_int(sc)\n\t}\n\tss = append(ss, -100000000000)\n\tss = append(ss, 100000000000)\n\tfor i := range ts {\n\t\tts[i] = get_int(sc)\n\t}\n\tts = append(ts, -100000000000)\n\tts = append(ts, 100000000000)\n\tfor i := range xs {\n\t\txs[i] = get_int(sc)\n\t}\n\n\tsort.Ints(ss)\n\tsort.Ints(ts)\n\n\tfor _, x := range xs {\n\t\tsi := sort.SearchInts(ss, x)\n\t\tti := sort.SearchInts(ts, x)\n\t\tv0 := s1(ss[si], ts[ti], x)\n\t\tv1 := s1(ss[si-1], ts[ti-1], x)\n\t\tv2 := s2(ss[si-1], ts[ti], x)\n\t\tv3 := s2(ss[si], ts[ti-1], x)\n\n\t\tmin := 100000000000\n\t\tfor _, v := range []int{v0, v1, v2, v3} {\n\t\t\tif min > v {\n\t\t\t\tmin = v\n\t\t\t}\n\t\t}\n\t\tfmt.Println(min)\n\t}\n}\n\nfunc diff(a, b int) int {\n\tif a < b {\n\t\treturn b - a\n\t}\n\treturn a - b\n}\n\nfunc s1(a, b, x int) int {\n\treturn max(diff(a, x), diff(b, x))\n}\n\nfunc s2(a, b, x int) int {\n\td1 := diff(a, x)\n\td2 := diff(x, b)\n\treturn d1 + d2 + min(d1, d2)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1551043905, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03112.html", "problem_id": "p03112", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03112/input.txt", "sample_output_relpath": "derived/input_output/data/p03112/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03112/Go/s615784686.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s615784686", "user_id": "u113872560"}, "prompt_components": {"gold_output": "350\n1400\n301\n399\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc scanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc get_int(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar a, b, q int\n\tfmt.Scan(&a, &b, &q)\n\n\tss := make([]int, a)\n\tts := make([]int, b)\n\txs := make([]int, q)\n\n\tsc := scanner()\n\tfor i := range ss {\n\t\tss[i] = get_int(sc)\n\t}\n\tss = append(ss, -100000000000)\n\tss = append(ss, 100000000000)\n\tfor i := range ts {\n\t\tts[i] = get_int(sc)\n\t}\n\tts = append(ts, -100000000000)\n\tts = append(ts, 100000000000)\n\tfor i := range xs {\n\t\txs[i] = get_int(sc)\n\t}\n\n\tsort.Ints(ss)\n\tsort.Ints(ts)\n\n\tfor _, x := range xs {\n\t\tsi := sort.SearchInts(ss, x)\n\t\tti := sort.SearchInts(ts, x)\n\t\tv0 := s1(ss[si], ts[ti], x)\n\t\tv1 := s1(ss[si-1], ts[ti-1], x)\n\t\tv2 := s2(ss[si-1], ts[ti], x)\n\t\tv3 := s2(ss[si], ts[ti-1], x)\n\n\t\tmin := 100000000000\n\t\tfor _, v := range []int{v0, v1, v2, v3} {\n\t\t\tif min > v {\n\t\t\t\tmin = v\n\t\t\t}\n\t\t}\n\t\tfmt.Println(min)\n\t}\n}\n\nfunc diff(a, b int) int {\n\tif a < b {\n\t\treturn b - a\n\t}\n\treturn a - b\n}\n\nfunc s1(a, b, x int) int {\n\treturn max(diff(a, x), diff(b, x))\n}\n\nfunc s2(a, b, x int) int {\n\td1 := diff(a, x)\n\td2 := diff(x, b)\n\treturn d1 + d2 + min(d1, d2)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "sample_input": "2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n"}, "reference_outputs": ["350\n1400\n301\n399\n"], "source_document_id": "p03112", "source_text": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1443, "cpu_time_ms": 359, "memory_kb": 8704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s902261982", "group_id": "codeNet:p03125", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n \n if b%a == 0 {\n fmt.Println(a+b)\n } else {\n fmt.Println(b-a)\n }\n}", "language": "Go", "metadata": {"date": 1550369036, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03125.html", "problem_id": "p03125", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03125/input.txt", "sample_output_relpath": "derived/input_output/data/p03125/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03125/Go/s902261982.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s902261982", "user_id": "u552730117"}, "prompt_components": {"gold_output": "16\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n \n if b%a == 0 {\n fmt.Println(a+b)\n } else {\n fmt.Println(b-a)\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nSample Input 1\n\n4 12\n\nSample Output 1\n\n16\n\nAs 4 is a divisor of 12, 4 + 12 = 16 should be printed.\n\nSample Input 2\n\n8 20\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n2\n\n1 is a divisor of 1.", "sample_input": "4 12\n"}, "reference_outputs": ["16\n"], "source_document_id": "p03125", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\nSample Input 1\n\n4 12\n\nSample Output 1\n\n16\n\nAs 4 is a divisor of 12, 4 + 12 = 16 should be printed.\n\nSample Input 2\n\n8 20\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n2\n\n1 is a divisor of 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 153, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s739964908", "group_id": "codeNet:p03126", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio, flush := NewIO()\n\tdefer flush()\n\n\tn, _ := io.ScanInt2()\n\tlikedFoodCountMap := map[int]int{}\n\tfor i := 0; i < n; i++ {\n\t\tk := io.ScanInt()\n\t\tlikedFoods := io.ScanInts(k)\n\t\tfor _, food := range likedFoods {\n\t\t\tlikedFoodCountMap[food] += 1\n\t\t}\n\t}\n\n\tvar allLikedFoodNum int\n\tfor _, count := range likedFoodCountMap {\n\t\tif count == n {\n\t\t\tallLikedFoodNum++\n\t\t}\n\t}\n\tfmt.Println(allLikedFoodNum)\n}\n\ntype IO struct {\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n}\n\nfunc NewIO() (*IO, func()) {\n\tio := &IO{\n\t\tscanner: newScanner(),\n\t\twriter: newWriter(),\n\t}\n\treturn io, func() { io.writer.Flush() }\n}\n\nfunc newScanner() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Buffer(make([]byte, 10000000), 10000000)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc newWriter() *bufio.Writer {\n\treturn bufio.NewWriter(os.Stdout)\n}\n\nfunc (io *IO) ScanBytes() []byte {\n\tif !io.scanner.Scan() {\n\t\tpanic(\"scan string failed\")\n\t}\n\treturn io.scanner.Bytes()\n}\n\nfunc (io *IO) ScanString() string {\n\tif !io.scanner.Scan() {\n\t\tpanic(\"scan string failed\")\n\t}\n\treturn io.scanner.Text()\n}\n\nfunc (io *IO) ScanStrings(n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tstrs[i] = io.ScanString()\n\t}\n\treturn strs\n}\n\nfunc (io *IO) Scan2DStrings(y, x int) [][]string {\n\tstrings := make([][]string, y)\n\tfor i := 0; i < y; i++ {\n\t\tstrings[i] = io.ScanStrings(x)\n\t}\n\treturn strings\n}\n\nfunc (io *IO) Scan2DGraph(y int) [][]string {\n\tstrs := make([][]string, y)\n\tfor i := 0; i < y; i++ {\n\t\tstrs[i] = strings.Split(io.ScanString(), \"\")\n\t}\n\treturn strs\n}\n\nfunc (io *IO) ScanInt() int {\n\treturn int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInt2() (int, int) {\n\treturn int(io.ScanInt64()), int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInt3() (int, int, int) {\n\treturn int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInt4() (int, int, int, int) {\n\treturn int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = io.ScanInt()\n\t}\n\treturn ints\n}\n\nfunc (io *IO) Scan2DInts(y, x int) [][]int {\n\tints := make([][]int, y)\n\tfor i := 0; i < y; i++ {\n\t\tints[i] = io.ScanInts(x)\n\t}\n\treturn ints\n}\n\nfunc (io *IO) ScanInt64() int64 {\n\ti, err := strconv.ParseInt(io.ScanString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *IO) ScanFloat64() float64 {\n\ti, _ := strconv.ParseFloat(io.ScanString(), 64)\n\treturn i\n}\n\nfunc (io *IO) ScanFloat64s(n int) []float64 {\n\tfloats := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfloats[i] = io.ScanFloat64()\n\t}\n\treturn floats\n}\n\nfunc (io *IO) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "language": "Go", "metadata": {"date": 1592525450, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03126.html", "problem_id": "p03126", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03126/input.txt", "sample_output_relpath": "derived/input_output/data/p03126/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03126/Go/s739964908.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s739964908", "user_id": "u717943620"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio, flush := NewIO()\n\tdefer flush()\n\n\tn, _ := io.ScanInt2()\n\tlikedFoodCountMap := map[int]int{}\n\tfor i := 0; i < n; i++ {\n\t\tk := io.ScanInt()\n\t\tlikedFoods := io.ScanInts(k)\n\t\tfor _, food := range likedFoods {\n\t\t\tlikedFoodCountMap[food] += 1\n\t\t}\n\t}\n\n\tvar allLikedFoodNum int\n\tfor _, count := range likedFoodCountMap {\n\t\tif count == n {\n\t\t\tallLikedFoodNum++\n\t\t}\n\t}\n\tfmt.Println(allLikedFoodNum)\n}\n\ntype IO struct {\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n}\n\nfunc NewIO() (*IO, func()) {\n\tio := &IO{\n\t\tscanner: newScanner(),\n\t\twriter: newWriter(),\n\t}\n\treturn io, func() { io.writer.Flush() }\n}\n\nfunc newScanner() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Buffer(make([]byte, 10000000), 10000000)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc newWriter() *bufio.Writer {\n\treturn bufio.NewWriter(os.Stdout)\n}\n\nfunc (io *IO) ScanBytes() []byte {\n\tif !io.scanner.Scan() {\n\t\tpanic(\"scan string failed\")\n\t}\n\treturn io.scanner.Bytes()\n}\n\nfunc (io *IO) ScanString() string {\n\tif !io.scanner.Scan() {\n\t\tpanic(\"scan string failed\")\n\t}\n\treturn io.scanner.Text()\n}\n\nfunc (io *IO) ScanStrings(n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tstrs[i] = io.ScanString()\n\t}\n\treturn strs\n}\n\nfunc (io *IO) Scan2DStrings(y, x int) [][]string {\n\tstrings := make([][]string, y)\n\tfor i := 0; i < y; i++ {\n\t\tstrings[i] = io.ScanStrings(x)\n\t}\n\treturn strings\n}\n\nfunc (io *IO) Scan2DGraph(y int) [][]string {\n\tstrs := make([][]string, y)\n\tfor i := 0; i < y; i++ {\n\t\tstrs[i] = strings.Split(io.ScanString(), \"\")\n\t}\n\treturn strs\n}\n\nfunc (io *IO) ScanInt() int {\n\treturn int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInt2() (int, int) {\n\treturn int(io.ScanInt64()), int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInt3() (int, int, int) {\n\treturn int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInt4() (int, int, int, int) {\n\treturn int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())\n}\n\nfunc (io *IO) ScanInts(n int) []int {\n\tints := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tints[i] = io.ScanInt()\n\t}\n\treturn ints\n}\n\nfunc (io *IO) Scan2DInts(y, x int) [][]int {\n\tints := make([][]int, y)\n\tfor i := 0; i < y; i++ {\n\t\tints[i] = io.ScanInts(x)\n\t}\n\treturn ints\n}\n\nfunc (io *IO) ScanInt64() int64 {\n\ti, err := strconv.ParseInt(io.ScanString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *IO) ScanFloat64() float64 {\n\ti, _ := strconv.ParseFloat(io.ScanString(), 64)\n\treturn i\n}\n\nfunc (io *IO) ScanFloat64s(n int) []float64 {\n\tfloats := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfloats[i] = io.ScanFloat64()\n\t}\n\treturn floats\n}\n\nfunc (io *IO) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "sample_input": "3 4\n2 1 3\n3 1 2 3\n2 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03126", "source_text": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2774, "cpu_time_ms": 8, "memory_kb": 2216}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448107241", "group_id": "codeNet:p03126", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, k, a, ans int\n\tfmt.Scan(&n, &m)\n\tf := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&k)\n\t\tfor j := 0; j < k; j++ {\n\t\t\tfmt.Scan(&a)\n\t\t\tf[a]++\n\t\t}\n\t}\n\tfor _, v := range f {\n\t\tif v == n {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1569273570, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03126.html", "problem_id": "p03126", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03126/input.txt", "sample_output_relpath": "derived/input_output/data/p03126/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03126/Go/s448107241.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448107241", "user_id": "u937220467"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, k, a, ans int\n\tfmt.Scan(&n, &m)\n\tf := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&k)\n\t\tfor j := 0; j < k; j++ {\n\t\t\tfmt.Scan(&a)\n\t\t\tf[a]++\n\t\t}\n\t}\n\tfor _, v := range f {\n\t\tif v == n {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "sample_input": "3 4\n2 1 3\n3 1 2 3\n2 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03126", "source_text": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 283, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s518505099", "group_id": "codeNet:p03126", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tmp := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tvar k int\n\t\tfmt.Scan(&k)\n\t\tfor i := 0; i < k; i++ {\n\t\t\tvar tmp int\n\t\t\tfmt.Scan(&tmp)\n\t\t\tv, ok := mp[tmp]\n\t\t\tif ok {\n\t\t\t\tmp[tmp] = v + 1\n\t\t\t} else {\n\t\t\t\tmp[tmp] = 1\n\t\t\t}\n\t\t}\n\t}\n\tcount := 0\n\tfor _, v := range mp {\n\t\tif v == n {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1555184839, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03126.html", "problem_id": "p03126", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03126/input.txt", "sample_output_relpath": "derived/input_output/data/p03126/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03126/Go/s518505099.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s518505099", "user_id": "u857510905"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tmp := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tvar k int\n\t\tfmt.Scan(&k)\n\t\tfor i := 0; i < k; i++ {\n\t\t\tvar tmp int\n\t\t\tfmt.Scan(&tmp)\n\t\t\tv, ok := mp[tmp]\n\t\t\tif ok {\n\t\t\t\tmp[tmp] = v + 1\n\t\t\t} else {\n\t\t\t\tmp[tmp] = 1\n\t\t\t}\n\t\t}\n\t}\n\tcount := 0\n\tfor _, v := range mp {\n\t\tif v == n {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "sample_input": "3 4\n2 1 3\n3 1 2 3\n2 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03126", "source_text": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s157572415", "group_id": "codeNet:p03126", "input_text": "package main\nimport \"fmt\"\n\nfunc main() {\n ints := scanNums(2)\n N := ints[0]\n M := ints[1]\n var popularities [30]int\n for i := 0; i < N; i++ {\n K := scanNum()\n for j := 0; j < K; j++ {\n A := scanNum()\n popularities[A - 1] += 1\n }\n }\n var result int\n for i := 0; i < M; i++ {\n if popularities[i] == N {\n result += 1\n }\n }\n fmt.Println(result)\n}\n\nfunc scanNum() (num int) {\n fmt.Scan(&num)\n return\n}\n\nfunc scanString() (str string) {\n fmt.Scanf(\"%s\", str)\n return\n}\n\nfunc scanNums(len int) (nums []int) {\n var num int\n for i := 0; i < len; i++ {\n fmt.Scan(&num)\n nums = append(nums, num)\n }\n return\n}\n\nfunc scanStrings(len int) (strings []string) {\n var str string\n for i := 0; i < len; i++ {\n fmt.Scanf(\"%s\", str)\n strings = append(strings, str)\n }\n return\n}", "language": "Go", "metadata": {"date": 1550369687, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03126.html", "problem_id": "p03126", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03126/input.txt", "sample_output_relpath": "derived/input_output/data/p03126/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03126/Go/s157572415.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s157572415", "user_id": "u975073965"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\nfunc main() {\n ints := scanNums(2)\n N := ints[0]\n M := ints[1]\n var popularities [30]int\n for i := 0; i < N; i++ {\n K := scanNum()\n for j := 0; j < K; j++ {\n A := scanNum()\n popularities[A - 1] += 1\n }\n }\n var result int\n for i := 0; i < M; i++ {\n if popularities[i] == N {\n result += 1\n }\n }\n fmt.Println(result)\n}\n\nfunc scanNum() (num int) {\n fmt.Scan(&num)\n return\n}\n\nfunc scanString() (str string) {\n fmt.Scanf(\"%s\", str)\n return\n}\n\nfunc scanNums(len int) (nums []int) {\n var num int\n for i := 0; i < len; i++ {\n fmt.Scan(&num)\n nums = append(nums, num)\n }\n return\n}\n\nfunc scanStrings(len int) (strings []string) {\n var str string\n for i := 0; i < len; i++ {\n fmt.Scanf(\"%s\", str)\n strings = append(strings, str)\n }\n return\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "sample_input": "3 4\n2 1 3\n3 1 2 3\n2 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03126", "source_text": "Score : 200 points\n\nProblem Statement\n\nKatsusando loves omelette rice.\n\nBesides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.\n\nTo prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.\n\nThe i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.\n\nFind the number of the foods liked by all the N people.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 30\n\n1 \\leq K_i \\leq M\n\n1 \\leq A_{ij} \\leq M\n\nFor each i (1 \\leq i \\leq N), A_{i1}, A_{i2}, ..., A_{iK_i} are distinct.\n\nConstraints\n\nInput is given from Standard Input in the following format:\n\nN M\nK_1 A_{11} A_{12} ... A_{1K_1}\nK_2 A_{21} A_{22} ... A_{2K_2}\n:\nK_N A_{N1} A_{N2} ... A_{NK_N}\n\nOutput\n\nPrint the number of the foods liked by all the N people.\n\nSample Input 1\n\n3 4\n2 1 3\n3 1 2 3\n2 3 2\n\nSample Output 1\n\n1\n\nAs only the third food is liked by all the three people, 1 should be printed.\n\nSample Input 2\n\n5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4\n\nSample Output 2\n\n0\n\nKatsusando's hypothesis turned out to be wrong.\n\nSample Input 3\n\n1 30\n3 5 10 30\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 918, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s532240459", "group_id": "codeNet:p03127", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\taSlice := make([]int, n)\n\tfor i := range aSlice {\n\t\tfmt.Scan(&aSlice[i])\n\t}\n\n\tsort.Ints(aSlice)\n\n\ta := aSlice[0]\n\tfor i := 1; i < n; i++ {\n\t\tb := aSlice[i]\n\t\tr := b % a\n\t\tfor r != 0 {\n\t\t\tb = a\n\t\t\ta = r\n\t\t\tr = b % a\n\t\t}\n\t}\n\tfmt.Println(a)\n}", "language": "Go", "metadata": {"date": 1554929751, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03127.html", "problem_id": "p03127", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03127/input.txt", "sample_output_relpath": "derived/input_output/data/p03127/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03127/Go/s532240459.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s532240459", "user_id": "u543933043"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\taSlice := make([]int, n)\n\tfor i := range aSlice {\n\t\tfmt.Scan(&aSlice[i])\n\t}\n\n\tsort.Ints(aSlice)\n\n\ta := aSlice[0]\n\tfor i := 1; i < n; i++ {\n\t\tb := aSlice[i]\n\t\tr := b % a\n\t\tfor r != 0 {\n\t\t\tb = a\n\t\t\ta = r\n\t\t\tr = b % a\n\t\t}\n\t}\n\tfmt.Println(a)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "sample_input": "4\n2 10 8 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03127", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 321, "cpu_time_ms": 704, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s687615000", "group_id": "codeNet:p03128", "input_text": "package main\n \nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc max(A string, B string) string {\n if len(A) > len(B) || (len(A) == len(B) && A > B){\n return A\n }\n return B\n}\n\nfunc main() {\n var N, M int\n fmt.Scan(&N, &M)\n A := make([][]int, M)\n B := []int{0, 2, 5, 5, 4, 5, 6, 3, 7, 6}\n DP := make([]string, N + 1)\n var x int\n for i, _ := range A {\n fmt.Scan(&x)\n A[i] = []int{B[x], x}\n if B[x] <= N {\n DP[B[x]] = max(DP[B[x]], strconv.Itoa(x))\n }\n }\n for i, _ := range DP {\n for _, a := range A {\n if i > a[0] && len(DP[i - a[0]]) >= 1 {\n b := DP[i - a[0]] + strconv.Itoa(a[1])\n DP[i] = max(DP[i], b)\n }\n }\n }\n fmt.Println(DP[N])\n}\n", "language": "Go", "metadata": {"date": 1550384614, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03128.html", "problem_id": "p03128", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03128/input.txt", "sample_output_relpath": "derived/input_output/data/p03128/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03128/Go/s687615000.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s687615000", "user_id": "u415905784"}, "prompt_components": {"gold_output": "777773\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc max(A string, B string) string {\n if len(A) > len(B) || (len(A) == len(B) && A > B){\n return A\n }\n return B\n}\n\nfunc main() {\n var N, M int\n fmt.Scan(&N, &M)\n A := make([][]int, M)\n B := []int{0, 2, 5, 5, 4, 5, 6, 3, 7, 6}\n DP := make([]string, N + 1)\n var x int\n for i, _ := range A {\n fmt.Scan(&x)\n A[i] = []int{B[x], x}\n if B[x] <= N {\n DP[B[x]] = max(DP[B[x]], strconv.Itoa(x))\n }\n }\n for i, _ := range DP {\n for _, a := range A {\n if i > a[0] && len(DP[i - a[0]]) >= 1 {\n b := DP[i - a[0]] + strconv.Itoa(a[1])\n DP[i] = max(DP[i], b)\n }\n }\n }\n fmt.Println(DP[N])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFind the largest integer that can be formed with exactly N matchsticks, under the following conditions:\n\nEvery digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \\leq A_i \\leq 9).\n\nThe number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^4\n\n1 \\leq M \\leq 9\n\n1 \\leq A_i \\leq 9\n\nA_i are all different.\n\nThere exists an integer that can be formed by exactly N matchsticks under the conditions.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_M\n\nOutput\n\nPrint the largest integer that can be formed with exactly N matchsticks under the conditions in the problem statement.\n\nSample Input 1\n\n20 4\n3 7 8 4\n\nSample Output 1\n\n777773\n\nThe integer 777773 can be formed with 3 + 3 + 3 + 3 + 3 + 5 = 20 matchsticks, and this is the largest integer that can be formed by 20 matchsticks under the conditions.\n\nSample Input 2\n\n101 9\n9 8 7 6 5 4 3 2 1\n\nSample Output 2\n\n71111111111111111111111111111111111111111111111111\n\nThe output may not fit into a 64-bit integer type.\n\nSample Input 3\n\n15 3\n5 4 6\n\nSample Output 3\n\n654", "sample_input": "20 4\n3 7 8 4\n"}, "reference_outputs": ["777773\n"], "source_document_id": "p03128", "source_text": "Score : 400 points\n\nProblem Statement\n\nFind the largest integer that can be formed with exactly N matchsticks, under the following conditions:\n\nEvery digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \\leq A_i \\leq 9).\n\nThe number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^4\n\n1 \\leq M \\leq 9\n\n1 \\leq A_i \\leq 9\n\nA_i are all different.\n\nThere exists an integer that can be formed by exactly N matchsticks under the conditions.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_M\n\nOutput\n\nPrint the largest integer that can be formed with exactly N matchsticks under the conditions in the problem statement.\n\nSample Input 1\n\n20 4\n3 7 8 4\n\nSample Output 1\n\n777773\n\nThe integer 777773 can be formed with 3 + 3 + 3 + 3 + 3 + 5 = 20 matchsticks, and this is the largest integer that can be formed by 20 matchsticks under the conditions.\n\nSample Input 2\n\n101 9\n9 8 7 6 5 4 3 2 1\n\nSample Output 2\n\n71111111111111111111111111111111111111111111111111\n\nThe output may not fit into a 64-bit integer type.\n\nSample Input 3\n\n15 3\n5 4 6\n\nSample Output 3\n\n654", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 685, "cpu_time_ms": 143, "memory_kb": 113348}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s364088052", "group_id": "codeNet:p03131", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar k, a, b int\n\tfmt.Scan(&k, &a, &b)\n\n\tvar bis int\n\tif b%a != 0 {\n\t\tif k-(a-2)%3 == 0 {\n\t\t\tfmt.Println(\"A\")\n\t\t\tbis = ((k - a + 2) / 3 * b)\n\t\t} else {\n\t\t\tfmt.Println(\"B\")\n\t\t\tbis = (k-a+2)/3*b + ((k - a + 2) % 3)\n\t\t}\n\t} else {\n\t\tif (k-a+2)%2 == 0 {\n\t\t\tfmt.Println(\"C\")\n\t\t\tbis = (k-a+2)/3*b + 1\n\t\t} else {\n\t\t\tfmt.Println(\"D\")\n\t\t\t//bis = ((k-a+2)/3 + 1) * b\n\t\t\tbis = a * int(math.Pow(float64(3), float64((k-a+2)/3+1)))\n\t\t}\n\t}\n\tfmt.Println(bis)\n}", "language": "Go", "metadata": {"date": 1549770894, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03131.html", "problem_id": "p03131", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03131/input.txt", "sample_output_relpath": "derived/input_output/data/p03131/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03131/Go/s364088052.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s364088052", "user_id": "u370270364"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar k, a, b int\n\tfmt.Scan(&k, &a, &b)\n\n\tvar bis int\n\tif b%a != 0 {\n\t\tif k-(a-2)%3 == 0 {\n\t\t\tfmt.Println(\"A\")\n\t\t\tbis = ((k - a + 2) / 3 * b)\n\t\t} else {\n\t\t\tfmt.Println(\"B\")\n\t\t\tbis = (k-a+2)/3*b + ((k - a + 2) % 3)\n\t\t}\n\t} else {\n\t\tif (k-a+2)%2 == 0 {\n\t\t\tfmt.Println(\"C\")\n\t\t\tbis = (k-a+2)/3*b + 1\n\t\t} else {\n\t\t\tfmt.Println(\"D\")\n\t\t\t//bis = ((k-a+2)/3 + 1) * b\n\t\t\tbis = a * int(math.Pow(float64(3), float64((k-a+2)/3+1)))\n\t\t}\n\t}\n\tfmt.Println(bis)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has one biscuit and zero Japanese yen (the currency) in his pocket.\nHe will perform the following operations exactly K times in total, in the order he likes:\n\nHit his pocket, which magically increases the number of biscuits by one.\n\nExchange A biscuits to 1 yen.\n\nExchange 1 yen to B biscuits.\n\nFind the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nConstraints\n\n1 \\leq K,A,B \\leq 10^9\n\nK,A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nPrint the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nSample Input 1\n\n4 2 6\n\nSample Output 1\n\n7\n\nThe number of biscuits in Snuke's pocket after K operations is maximized as follows:\n\nHit his pocket. Now he has 2 biscuits and 0 yen.\n\nExchange 2 biscuits to 1 yen. his pocket. Now he has 0 biscuits and 1 yen.\n\nHit his pocket. Now he has 1 biscuits and 1 yen.\n\nExchange 1 yen to 6 biscuits. his pocket. Now he has 7 biscuits and 0 yen.\n\nSample Input 2\n\n7 3 4\n\nSample Output 2\n\n8\n\nSample Input 3\n\n314159265 35897932 384626433\n\nSample Output 3\n\n48518828981938099", "sample_input": "4 2 6\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03131", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has one biscuit and zero Japanese yen (the currency) in his pocket.\nHe will perform the following operations exactly K times in total, in the order he likes:\n\nHit his pocket, which magically increases the number of biscuits by one.\n\nExchange A biscuits to 1 yen.\n\nExchange 1 yen to B biscuits.\n\nFind the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nConstraints\n\n1 \\leq K,A,B \\leq 10^9\n\nK,A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nPrint the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nSample Input 1\n\n4 2 6\n\nSample Output 1\n\n7\n\nThe number of biscuits in Snuke's pocket after K operations is maximized as follows:\n\nHit his pocket. Now he has 2 biscuits and 0 yen.\n\nExchange 2 biscuits to 1 yen. his pocket. Now he has 0 biscuits and 1 yen.\n\nHit his pocket. Now he has 1 biscuits and 1 yen.\n\nExchange 1 yen to 6 biscuits. his pocket. Now he has 7 biscuits and 0 yen.\n\nSample Input 2\n\n7 3 4\n\nSample Output 2\n\n8\n\nSample Input 3\n\n314159265 35897932 384626433\n\nSample Output 3\n\n48518828981938099", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 498, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s553489820", "group_id": "codeNet:p03131", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, a, b int\n\tfmt.Scan(&k, &a, &b)\n\n\tc := b / a\n\tbis := 1\n\tfor i := 1; i <= k; i++ {\n\t\tif c == 0 || c == 1 {\n\t\t\tbis++\n\t\t} else if c > 0 {\n\t\t\tif i == k {\n\t\t\t\tbis++\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif bis%a == 0 {\n\t\t\t\tbis *= c\n\t\t\t\ti++\n\t\t\t} else {\n\t\t\t\tbis++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bis)\n}", "language": "Go", "metadata": {"date": 1549766883, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03131.html", "problem_id": "p03131", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03131/input.txt", "sample_output_relpath": "derived/input_output/data/p03131/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03131/Go/s553489820.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s553489820", "user_id": "u370270364"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, a, b int\n\tfmt.Scan(&k, &a, &b)\n\n\tc := b / a\n\tbis := 1\n\tfor i := 1; i <= k; i++ {\n\t\tif c == 0 || c == 1 {\n\t\t\tbis++\n\t\t} else if c > 0 {\n\t\t\tif i == k {\n\t\t\t\tbis++\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif bis%a == 0 {\n\t\t\t\tbis *= c\n\t\t\t\ti++\n\t\t\t} else {\n\t\t\t\tbis++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bis)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has one biscuit and zero Japanese yen (the currency) in his pocket.\nHe will perform the following operations exactly K times in total, in the order he likes:\n\nHit his pocket, which magically increases the number of biscuits by one.\n\nExchange A biscuits to 1 yen.\n\nExchange 1 yen to B biscuits.\n\nFind the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nConstraints\n\n1 \\leq K,A,B \\leq 10^9\n\nK,A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nPrint the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nSample Input 1\n\n4 2 6\n\nSample Output 1\n\n7\n\nThe number of biscuits in Snuke's pocket after K operations is maximized as follows:\n\nHit his pocket. Now he has 2 biscuits and 0 yen.\n\nExchange 2 biscuits to 1 yen. his pocket. Now he has 0 biscuits and 1 yen.\n\nHit his pocket. Now he has 1 biscuits and 1 yen.\n\nExchange 1 yen to 6 biscuits. his pocket. Now he has 7 biscuits and 0 yen.\n\nSample Input 2\n\n7 3 4\n\nSample Output 2\n\n8\n\nSample Input 3\n\n314159265 35897932 384626433\n\nSample Output 3\n\n48518828981938099", "sample_input": "4 2 6\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03131", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has one biscuit and zero Japanese yen (the currency) in his pocket.\nHe will perform the following operations exactly K times in total, in the order he likes:\n\nHit his pocket, which magically increases the number of biscuits by one.\n\nExchange A biscuits to 1 yen.\n\nExchange 1 yen to B biscuits.\n\nFind the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nConstraints\n\n1 \\leq K,A,B \\leq 10^9\n\nK,A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK A B\n\nOutput\n\nPrint the maximum possible number of biscuits in Snuke's pocket after K operations.\n\nSample Input 1\n\n4 2 6\n\nSample Output 1\n\n7\n\nThe number of biscuits in Snuke's pocket after K operations is maximized as follows:\n\nHit his pocket. Now he has 2 biscuits and 0 yen.\n\nExchange 2 biscuits to 1 yen. his pocket. Now he has 0 biscuits and 1 yen.\n\nHit his pocket. Now he has 1 biscuits and 1 yen.\n\nExchange 1 yen to 6 biscuits. his pocket. Now he has 7 biscuits and 0 yen.\n\nSample Input 2\n\n7 3 4\n\nSample Output 2\n\n8\n\nSample Input 3\n\n314159265 35897932 384626433\n\nSample Output 3\n\n48518828981938099", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 317, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s127052707", "group_id": "codeNet:p03136", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(nums []int) int {\n\tmax := nums[0]\n\tfor _, v := range nums {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc sum(nums []int) int {\n\tsum := 0\n\tfor _, v := range nums {\n\t\tsum += v\n\t}\n\treturn sum\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tnums := make([]int, n)\n\tfor i := range nums {\n\t\tfmt.Scan(&nums[i])\n\t}\n\n\tmax := max(nums)\n\tsum := sum(nums) - max\n\n\tif max < sum {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1555511082, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03136.html", "problem_id": "p03136", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03136/input.txt", "sample_output_relpath": "derived/input_output/data/p03136/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03136/Go/s127052707.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s127052707", "user_id": "u102310764"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(nums []int) int {\n\tmax := nums[0]\n\tfor _, v := range nums {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc sum(nums []int) int {\n\tsum := 0\n\tfor _, v := range nums {\n\t\tsum += v\n\t}\n\treturn sum\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tnums := make([]int, n)\n\tfor i := range nums {\n\t\tfmt.Scan(&nums[i])\n\t}\n\n\tmax := max(nums)\n\tsum := sum(nums) - max\n\n\tif max < sum {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "sample_input": "4\n3 8 5 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03136", "source_text": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 469, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s177102571", "group_id": "codeNet:p03137", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N, M, answer, jumpLimit int\n\tfmt.Scan(&N, &M)\n\tnumList := make([]int, M)\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&numList[i])\n\t}\n\tsort.Sort(sort.IntSlice(numList))\n\n\tif M <= N {\n\t\tfmt.Println(0)\n\t} else {\n\t\tdList := make([]int, M-1)\n\t\tfor i := 0; i < M-1; i++ {\n\t\t\tdList[i] = numList[i+1] - numList[i]\n\t\t}\n\t\tsort.Sort(sort.IntSlice(dList))\n\n\t\tjumpLimit = N - 1\n\t\tif jumpLimit != 0 {\n\t\t\tfor i := 0; i < jumpLimit; i++ {\n\t\t\t\tdList[M-2-i] = 0\n\t\t\t}\n\t\t}\n\t\tanswer = Sum(dList)\n\t\tfmt.Println(answer)\n\t}\n\n}\n\nfunc Sum(a []int) int {\n\ts := 0\n\tfor _, n := range a {\n\t\ts = s + n\n\t}\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1550273433, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03137.html", "problem_id": "p03137", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03137/input.txt", "sample_output_relpath": "derived/input_output/data/p03137/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03137/Go/s177102571.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s177102571", "user_id": "u752406400"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N, M, answer, jumpLimit int\n\tfmt.Scan(&N, &M)\n\tnumList := make([]int, M)\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&numList[i])\n\t}\n\tsort.Sort(sort.IntSlice(numList))\n\n\tif M <= N {\n\t\tfmt.Println(0)\n\t} else {\n\t\tdList := make([]int, M-1)\n\t\tfor i := 0; i < M-1; i++ {\n\t\t\tdList[i] = numList[i+1] - numList[i]\n\t\t}\n\t\tsort.Sort(sort.IntSlice(dList))\n\n\t\tjumpLimit = N - 1\n\t\tif jumpLimit != 0 {\n\t\t\tfor i := 0; i < jumpLimit; i++ {\n\t\t\t\tdList[M-2-i] = 0\n\t\t\t}\n\t\t}\n\t\tanswer = Sum(dList)\n\t\tfmt.Println(answer)\n\t}\n\n}\n\nfunc Sum(a []int) int {\n\ts := 0\n\tfor _, n := range a {\n\t\ts = s + n\n\t}\n\treturn s\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "sample_input": "2 5\n10 12 1 2 14\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03137", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 639, "cpu_time_ms": 491, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s946466483", "group_id": "codeNet:p03137", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\n\nfunc NextSlice(n int) []int {\n\tvar mat []int\n\tin.Scan()\n\ttemp := strings.Split(in.Text(), \" \")\n\tfor i := 0; i < n; i++ {\n\t\tli, _ := strconv.Atoi(temp[i])\n\t\tmat = append(mat, li)\n\t}\n\treturn mat\n}\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\n\trep := NextSlice(m)\n\tsort.Ints(rep)\n\n\tvar deff []int\n\tfor i := 0; i < len(rep)-1; i++ {\n\t\tdeff = append(deff, int(math.Abs(float64(rep[i]-rep[i+1]))))\n\t}\n\tsort.Ints(deff)\n\n\tans := 0\n\tfor i := 0; i <= len(deff)-n; i++ {\n\t\tans += deff[i]\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1549249405, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03137.html", "problem_id": "p03137", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03137/input.txt", "sample_output_relpath": "derived/input_output/data/p03137/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03137/Go/s946466483.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s946466483", "user_id": "u370270364"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\n\nfunc NextSlice(n int) []int {\n\tvar mat []int\n\tin.Scan()\n\ttemp := strings.Split(in.Text(), \" \")\n\tfor i := 0; i < n; i++ {\n\t\tli, _ := strconv.Atoi(temp[i])\n\t\tmat = append(mat, li)\n\t}\n\treturn mat\n}\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\n\trep := NextSlice(m)\n\tsort.Ints(rep)\n\n\tvar deff []int\n\tfor i := 0; i < len(rep)-1; i++ {\n\t\tdeff = append(deff, int(math.Abs(float64(rep[i]-rep[i+1]))))\n\t}\n\tsort.Ints(deff)\n\n\tans := 0\n\tfor i := 0; i <= len(deff)-n; i++ {\n\t\tans += deff[i]\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "sample_input": "2 5\n10 12 1 2 14\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03137", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 636, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s517555937", "group_id": "codeNet:p03141", "input_text": "package main\n\nimport(\n \"fmt\"\n \"bufio\"\n \"os\"\n \"sort\"\n \"strings\"\n \"strconv\"\n)\n\n\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := scanPairs(n)\n By(cmp).Sort(a)\n ans := int64(0)\n for i:=0;i p2.first+p2.second\n}\n// end\n\nfunc scanPairs(len int) []Pair{\n Pairs := make([]Pair, len)\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd64(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd64(b, a%b)\n }\n}\n\nfunc lcm64(a, b int64) int64 {\n return a / gcd64(a, b) * b\n}\n\n// 入力処理\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc readLineNums(len int) (nums []int){\n for i:=0; i=0 && h=0 && w p2.first+p2.second\n}\n// end\n\nfunc scanPairs(len int) []Pair{\n Pairs := make([]Pair, len)\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd64(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd64(b, a%b)\n }\n}\n\nfunc lcm64(a, b int64) int64 {\n return a / gcd64(a, b) * b\n}\n\n// 入力処理\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc readLineNums(len int) (nums []int){\n for i:=0; i=0 && h=0 && w ps[i].a+ps[i].b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt()\n\n\tps := make(pairs, N)\n\tfor i := range ps {\n\t\tfmt.Scan(&ps[i].a, &ps[i].b)\n\t}\n\tsort.Sort(ps)\n\n\ttakahashi := 0\n\taoki := 0\n\tfor i := range ps {\n\t\tif i%2 == 0 {\n\t\t\ttakahashi += ps[i].a\n\t\t} else {\n\t\t\taoki += ps[i].b\n\t\t}\n\t}\n\tfmt.Println(takahashi - aoki)\n}\n", "language": "Go", "metadata": {"date": 1548747072, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03141.html", "problem_id": "p03141", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03141/input.txt", "sample_output_relpath": "derived/input_output/data/p03141/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03141/Go/s755490148.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s755490148", "user_id": "u802614675"}, "prompt_components": {"gold_output": "20\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Jan 27 21:06:32 2019\n//\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype pair struct {\n\ta, b int\n}\n\ntype pairs []pair\n\nfunc (ps pairs) Len() int {\n\treturn len(ps)\n}\nfunc (ps pairs) Swap(i, j int) {\n\tps[i], ps[j] = ps[j], ps[i]\n}\n\nfunc (ps pairs) Less(i, j int) bool {\n\treturn ps[i].a+ps[i].b > ps[i].a+ps[i].b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt()\n\n\tps := make(pairs, N)\n\tfor i := range ps {\n\t\tfmt.Scan(&ps[i].a, &ps[i].b)\n\t}\n\tsort.Sort(ps)\n\n\ttakahashi := 0\n\taoki := 0\n\tfor i := range ps {\n\t\tif i%2 == 0 {\n\t\t\ttakahashi += ps[i].a\n\t\t} else {\n\t\t\taoki += ps[i].b\n\t\t}\n\t}\n\tfmt.Println(takahashi - aoki)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N dishes of cuisine placed in front of Takahashi and Aoki.\nFor convenience, we call these dishes Dish 1, Dish 2, ..., Dish N.\n\nWhen Takahashi eats Dish i, he earns A_i points of happiness; when Aoki eats Dish i, she earns B_i points of happiness.\n\nStarting from Takahashi, they alternately choose one dish and eat it, until there is no more dish to eat.\nHere, both of them choose dishes so that the following value is maximized: \"the sum of the happiness he/she will earn in the end\" minus \"the sum of the happiness the other person will earn in the end\".\n\nFind the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nSample Input 1\n\n3\n10 10\n20 20\n30 30\n\nSample Output 1\n\n20\n\nIn this sample, both of them earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since Takahashi and Aoki have the same \"taste\", each time they will choose the dish with which they can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (30 + 10) - 20 = 20.\n\nSample Input 2\n\n3\n20 10\n20 20\n20 30\n\nSample Output 2\n\n20\n\nIn this sample, Takahashi earns 20 points of happiness by eating any one of the dishes 1, 2 and 3, but Aoki earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since only Aoki has likes and dislikes, each time they will choose the dish with which Aoki can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (20 + 20) - 20 = 20.\n\nSample Input 3\n\n6\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 3\n\n-2999999997\n\nNote that the answer may not fit into a 32-bit integer.", "sample_input": "3\n10 10\n20 20\n30 30\n"}, "reference_outputs": ["20\n"], "source_document_id": "p03141", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N dishes of cuisine placed in front of Takahashi and Aoki.\nFor convenience, we call these dishes Dish 1, Dish 2, ..., Dish N.\n\nWhen Takahashi eats Dish i, he earns A_i points of happiness; when Aoki eats Dish i, she earns B_i points of happiness.\n\nStarting from Takahashi, they alternately choose one dish and eat it, until there is no more dish to eat.\nHere, both of them choose dishes so that the following value is maximized: \"the sum of the happiness he/she will earn in the end\" minus \"the sum of the happiness the other person will earn in the end\".\n\nFind the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nSample Input 1\n\n3\n10 10\n20 20\n30 30\n\nSample Output 1\n\n20\n\nIn this sample, both of them earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since Takahashi and Aoki have the same \"taste\", each time they will choose the dish with which they can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (30 + 10) - 20 = 20.\n\nSample Input 2\n\n3\n20 10\n20 20\n20 30\n\nSample Output 2\n\n20\n\nIn this sample, Takahashi earns 20 points of happiness by eating any one of the dishes 1, 2 and 3, but Aoki earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since only Aoki has likes and dislikes, each time they will choose the dish with which Aoki can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (20 + 20) - 20 = 20.\n\nSample Input 3\n\n6\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 3\n\n-2999999997\n\nNote that the answer may not fit into a 32-bit integer.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 874, "cpu_time_ms": 1367, "memory_kb": 4992}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s977894750", "group_id": "codeNet:p03141", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\tA := make([]int, N)\n\tB := make([]int, N)\n\tac := make([]pair, N)\n\tbc := make([]pair, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\tB[i] = nextInt()\n\t\tac[i] = pair{A[i] - B[i], i}\n\t\tbc[i] = pair{B[i] - A[i], i}\n\t}\n\t// sort.Sort(pairs(C))\n\tsort.Sort(pairs(ac))\n\tsort.Sort(pairs(bc))\n\t// log.Println(ac)\n\t// log.Println(bc)\n\tacIdx := 0\n\tbcIdx := 0\n\tused := make([]bool, N)\n\tt := 0\n\ta := 0\n\tfor i := 0; i < N; i++ {\n\t\tif i%2 == 0 {\n\t\t\tfor used[acIdx] {\n\t\t\t\tacIdx++\n\t\t\t}\n\t\t\t// log.Println(\"takahasi selected \", ac[acIdx].b)\n\t\t\tt += A[ac[acIdx].b]\n\t\t\tused[ac[acIdx].b] = true\n\t\t} else {\n\t\t\tfor used[bcIdx] {\n\t\t\t\tbcIdx++\n\t\t\t}\n\t\t\t// log.Println(\"aoki selected \", bc[acIdx].b)\n\t\t\ta += B[bc[bcIdx].b]\n\t\t\tused[bc[bcIdx].b] = true\n\t\t}\n\t}\n\tfmt.Println(t - a)\n\t// var dp [100000][100000]int\n\t// dp[0][0]=A[0]\n\t// dp[0][1]=B[0]\n\t// for i := 0; i < N; i++ {\n\t// \tdp[\n\t// }\n}\n\nvar dy = []int{1, 0, -1, 0, 0}\nvar dx = []int{0, 1, 0, -1, 0}\nvar intmax = int(1e9)\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype pair struct {\n\ta, b int\n}\n\ntype pairs []pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\treturn p[i].a > p[j].a\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1548643406, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03141.html", "problem_id": "p03141", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03141/input.txt", "sample_output_relpath": "derived/input_output/data/p03141/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03141/Go/s977894750.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s977894750", "user_id": "u696272993"}, "prompt_components": {"gold_output": "20\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tN := nextInt()\n\tA := make([]int, N)\n\tB := make([]int, N)\n\tac := make([]pair, N)\n\tbc := make([]pair, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\tB[i] = nextInt()\n\t\tac[i] = pair{A[i] - B[i], i}\n\t\tbc[i] = pair{B[i] - A[i], i}\n\t}\n\t// sort.Sort(pairs(C))\n\tsort.Sort(pairs(ac))\n\tsort.Sort(pairs(bc))\n\t// log.Println(ac)\n\t// log.Println(bc)\n\tacIdx := 0\n\tbcIdx := 0\n\tused := make([]bool, N)\n\tt := 0\n\ta := 0\n\tfor i := 0; i < N; i++ {\n\t\tif i%2 == 0 {\n\t\t\tfor used[acIdx] {\n\t\t\t\tacIdx++\n\t\t\t}\n\t\t\t// log.Println(\"takahasi selected \", ac[acIdx].b)\n\t\t\tt += A[ac[acIdx].b]\n\t\t\tused[ac[acIdx].b] = true\n\t\t} else {\n\t\t\tfor used[bcIdx] {\n\t\t\t\tbcIdx++\n\t\t\t}\n\t\t\t// log.Println(\"aoki selected \", bc[acIdx].b)\n\t\t\ta += B[bc[bcIdx].b]\n\t\t\tused[bc[bcIdx].b] = true\n\t\t}\n\t}\n\tfmt.Println(t - a)\n\t// var dp [100000][100000]int\n\t// dp[0][0]=A[0]\n\t// dp[0][1]=B[0]\n\t// for i := 0; i < N; i++ {\n\t// \tdp[\n\t// }\n}\n\nvar dy = []int{1, 0, -1, 0, 0}\nvar dx = []int{0, 1, 0, -1, 0}\nvar intmax = int(1e9)\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype pair struct {\n\ta, b int\n}\n\ntype pairs []pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\treturn p[i].a > p[j].a\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N dishes of cuisine placed in front of Takahashi and Aoki.\nFor convenience, we call these dishes Dish 1, Dish 2, ..., Dish N.\n\nWhen Takahashi eats Dish i, he earns A_i points of happiness; when Aoki eats Dish i, she earns B_i points of happiness.\n\nStarting from Takahashi, they alternately choose one dish and eat it, until there is no more dish to eat.\nHere, both of them choose dishes so that the following value is maximized: \"the sum of the happiness he/she will earn in the end\" minus \"the sum of the happiness the other person will earn in the end\".\n\nFind the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nSample Input 1\n\n3\n10 10\n20 20\n30 30\n\nSample Output 1\n\n20\n\nIn this sample, both of them earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since Takahashi and Aoki have the same \"taste\", each time they will choose the dish with which they can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (30 + 10) - 20 = 20.\n\nSample Input 2\n\n3\n20 10\n20 20\n20 30\n\nSample Output 2\n\n20\n\nIn this sample, Takahashi earns 20 points of happiness by eating any one of the dishes 1, 2 and 3, but Aoki earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since only Aoki has likes and dislikes, each time they will choose the dish with which Aoki can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (20 + 20) - 20 = 20.\n\nSample Input 3\n\n6\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 3\n\n-2999999997\n\nNote that the answer may not fit into a 32-bit integer.", "sample_input": "3\n10 10\n20 20\n30 30\n"}, "reference_outputs": ["20\n"], "source_document_id": "p03141", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N dishes of cuisine placed in front of Takahashi and Aoki.\nFor convenience, we call these dishes Dish 1, Dish 2, ..., Dish N.\n\nWhen Takahashi eats Dish i, he earns A_i points of happiness; when Aoki eats Dish i, she earns B_i points of happiness.\n\nStarting from Takahashi, they alternately choose one dish and eat it, until there is no more dish to eat.\nHere, both of them choose dishes so that the following value is maximized: \"the sum of the happiness he/she will earn in the end\" minus \"the sum of the happiness the other person will earn in the end\".\n\nFind the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the value: \"the sum of the happiness Takahashi earns in the end\" minus \"the sum of the happiness Aoki earns in the end\".\n\nSample Input 1\n\n3\n10 10\n20 20\n30 30\n\nSample Output 1\n\n20\n\nIn this sample, both of them earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since Takahashi and Aoki have the same \"taste\", each time they will choose the dish with which they can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (30 + 10) - 20 = 20.\n\nSample Input 2\n\n3\n20 10\n20 20\n20 30\n\nSample Output 2\n\n20\n\nIn this sample, Takahashi earns 20 points of happiness by eating any one of the dishes 1, 2 and 3, but Aoki earns 10 points of happiness by eating Dish 1, 20 points by eating Dish 2, and 30 points by eating Dish 3.\n\nIn this case, since only Aoki has likes and dislikes, each time they will choose the dish with which Aoki can earn the greatest happiness. Thus, first Takahashi will choose Dish 3, then Aoki will choose Dish 2, and finally Takahashi will choose Dish 1, so the answer is (20 + 20) - 20 = 20.\n\nSample Input 3\n\n6\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 3\n\n-2999999997\n\nNote that the answer may not fit into a 32-bit integer.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2569, "cpu_time_ms": 108, "memory_kb": 8704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s478686670", "group_id": "codeNet:p03142", "input_text": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Sun Jan 27 21:14:46 2019\n//\npackage main\n\nimport \"fmt\"\n\ntype graph [][]int\n\nfunc (g graph) dfs(n int, visited []bool) {\n\tfor i := range g[n] {\n\t\tvisited[g[n][i]] = true\n\t\tg.dfs(g[n][i], visited)\n\t}\n}\n\nfunc (g graph) root() int {\n\troots := make([]bool, len(g))\n\tfor i := range g {\n\t\tg.dfs(i, roots)\n\t}\n\n\tfor i := range roots {\n\t\tif !roots[i] {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc (g graph) depthDFS(n int, d int, depths []int) {\n\tif depths[n] < d {\n\t\tdepths[n] = d\n\t}\n\n\tfor i := range g[n] {\n\t\tg.depthDFS(g[n][i], d+1, depths)\n\t}\n}\n\nfunc (g graph) depth(n int) []int {\n\tdep := make([]int, len(g))\n\tdep[n] = 0\n\tfor i := range g[n] {\n\t\tto := g[n][i]\n\t\tg.depthDFS(to, 1, dep)\n\t}\n\treturn dep\n}\n\nfunc (g graph) parentsDFS(parent int, parents []int) {\n\tfor i := range g[parent] {\n\t\tto := g[parent][i]\n\t\tif to != -1 {\n\t\t\tparents[to] = parent + 1\n\t\t\tg.parentsDFS(to, parents)\n\t\t}\n\t}\n}\n\nfunc (g graph) parents(root int) []int {\n\tparents := make([]int, len(g))\n\tparents[root] = 0\n\tg.parentsDFS(root, parents)\n\treturn parents\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tg := make(graph, N)\n\tfor i := 0; i < N+M-1; i++ {\n\t\tvar A, B int\n\t\tfmt.Scan(&A, &B)\n\t\tg[A-1] = append(g[A-1], B-1)\n\t}\n\n\troot := g.root()\n\tdepths := g.depth(root)\n\tfor i := range g {\n\t\tfor j := range g[i] {\n\t\t\tif depths[i]+1 != depths[g[i][j]] {\n\t\t\t\tg[i][j] = -1\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, p := range g.parents(root) {\n\t\tfmt.Println(p)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1548643043, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03142.html", "problem_id": "p03142", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03142/input.txt", "sample_output_relpath": "derived/input_output/data/p03142/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03142/Go/s478686670.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s478686670", "user_id": "u802614675"}, "prompt_components": {"gold_output": "0\n1\n2\n", "input_to_evaluate": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Sun Jan 27 21:14:46 2019\n//\npackage main\n\nimport \"fmt\"\n\ntype graph [][]int\n\nfunc (g graph) dfs(n int, visited []bool) {\n\tfor i := range g[n] {\n\t\tvisited[g[n][i]] = true\n\t\tg.dfs(g[n][i], visited)\n\t}\n}\n\nfunc (g graph) root() int {\n\troots := make([]bool, len(g))\n\tfor i := range g {\n\t\tg.dfs(i, roots)\n\t}\n\n\tfor i := range roots {\n\t\tif !roots[i] {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc (g graph) depthDFS(n int, d int, depths []int) {\n\tif depths[n] < d {\n\t\tdepths[n] = d\n\t}\n\n\tfor i := range g[n] {\n\t\tg.depthDFS(g[n][i], d+1, depths)\n\t}\n}\n\nfunc (g graph) depth(n int) []int {\n\tdep := make([]int, len(g))\n\tdep[n] = 0\n\tfor i := range g[n] {\n\t\tto := g[n][i]\n\t\tg.depthDFS(to, 1, dep)\n\t}\n\treturn dep\n}\n\nfunc (g graph) parentsDFS(parent int, parents []int) {\n\tfor i := range g[parent] {\n\t\tto := g[parent][i]\n\t\tif to != -1 {\n\t\t\tparents[to] = parent + 1\n\t\t\tg.parentsDFS(to, parents)\n\t\t}\n\t}\n}\n\nfunc (g graph) parents(root int) []int {\n\tparents := make([]int, len(g))\n\tparents[root] = 0\n\tg.parentsDFS(root, parents)\n\treturn parents\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tg := make(graph, N)\n\tfor i := 0; i < N+M-1; i++ {\n\t\tvar A, B int\n\t\tfmt.Scan(&A, &B)\n\t\tg[A-1] = append(g[A-1], B-1)\n\t}\n\n\troot := g.root()\n\tdepths := g.depth(root)\n\tfor i := range g {\n\t\tfor j := range g[i] {\n\t\t\tif depths[i]+1 != depths[g[i][j]] {\n\t\t\t\tg[i][j] = -1\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, p := range g.parents(root) {\n\t\tfmt.Println(p)\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is a rooted tree (see Notes) with N vertices numbered 1 to N.\nEach of the vertices, except the root, has a directed edge coming from its parent.\nNote that the root may not be Vertex 1.\n\nTakahashi has added M new directed edges to this graph.\nEach of these M edges, u \\rightarrow v, extends from some vertex u to its descendant v.\n\nYou are given the directed graph with N vertices and N-1+M edges after Takahashi added edges.\nMore specifically, you are given N-1+M pairs of integers, (A_1, B_1), ..., (A_{N-1+M}, B_{N-1+M}), which represent that the i-th edge extends from Vertex A_i to Vertex B_i.\n\nRestore the original rooted tree.\n\nNotes\n\nFor \"tree\" and other related terms in graph theory, see the article in Wikipedia, for example.\n\nConstraints\n\n3 \\leq N\n\n1 \\leq M\n\nN + M \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\nIf i \\neq j, (A_i, B_i) \\neq (A_j, B_j).\n\nThe graph in input can be obtained by adding M edges satisfying the condition in the problem statement to a rooted tree with N vertices.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_{N-1+M} B_{N-1+M}\n\nOutput\n\nPrint N lines.\nIn the i-th line, print 0 if Vertex i is the root of the original tree, and otherwise print the integer representing the parent of Vertex i in the original tree.\n\nNote that it can be shown that the original tree is uniquely determined.\n\nSample Input 1\n\n3 1\n1 2\n1 3\n2 3\n\nSample Output 1\n\n0\n1\n2\n\nThe graph in this input is shown below:\n\nIt can be seen that this graph is obtained by adding the edge 1 \\rightarrow 3 to the rooted tree 1 \\rightarrow 2 \\rightarrow 3.\n\nSample Input 2\n\n6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n4 6\n6 5\n\nSample Output 2\n\n6\n4\n2\n0\n6\n2", "sample_input": "3 1\n1 2\n1 3\n2 3\n"}, "reference_outputs": ["0\n1\n2\n"], "source_document_id": "p03142", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is a rooted tree (see Notes) with N vertices numbered 1 to N.\nEach of the vertices, except the root, has a directed edge coming from its parent.\nNote that the root may not be Vertex 1.\n\nTakahashi has added M new directed edges to this graph.\nEach of these M edges, u \\rightarrow v, extends from some vertex u to its descendant v.\n\nYou are given the directed graph with N vertices and N-1+M edges after Takahashi added edges.\nMore specifically, you are given N-1+M pairs of integers, (A_1, B_1), ..., (A_{N-1+M}, B_{N-1+M}), which represent that the i-th edge extends from Vertex A_i to Vertex B_i.\n\nRestore the original rooted tree.\n\nNotes\n\nFor \"tree\" and other related terms in graph theory, see the article in Wikipedia, for example.\n\nConstraints\n\n3 \\leq N\n\n1 \\leq M\n\nN + M \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\nIf i \\neq j, (A_i, B_i) \\neq (A_j, B_j).\n\nThe graph in input can be obtained by adding M edges satisfying the condition in the problem statement to a rooted tree with N vertices.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_{N-1+M} B_{N-1+M}\n\nOutput\n\nPrint N lines.\nIn the i-th line, print 0 if Vertex i is the root of the original tree, and otherwise print the integer representing the parent of Vertex i in the original tree.\n\nNote that it can be shown that the original tree is uniquely determined.\n\nSample Input 1\n\n3 1\n1 2\n1 3\n2 3\n\nSample Output 1\n\n0\n1\n2\n\nThe graph in this input is shown below:\n\nIt can be seen that this graph is obtained by adding the edge 1 \\rightarrow 3 to the rooted tree 1 \\rightarrow 2 \\rightarrow 3.\n\nSample Input 2\n\n6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n4 6\n6 5\n\nSample Output 2\n\n6\n4\n2\n0\n6\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1485, "cpu_time_ms": 2108, "memory_kb": 36256}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s163152517", "group_id": "codeNet:p03145", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\te := make([]int, 3)\n\te[0] = nextInt()\n\te[1] = nextInt()\n\te[2] = nextInt()\n\tsort.Ints(e)\n\tfmt.Println(e[0] * e[1] / 2)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1580177021, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03145.html", "problem_id": "p03145", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03145/input.txt", "sample_output_relpath": "derived/input_output/data/p03145/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03145/Go/s163152517.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s163152517", "user_id": "u696272993"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\te := make([]int, 3)\n\te[0] = nextInt()\n\te[1] = nextInt()\n\te[2] = nextInt()\n\tsort.Ints(e)\n\tfmt.Println(e[0] * e[1] / 2)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "sample_input": "3 4 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03145", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1425, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s321131941", "group_id": "codeNet:p03145", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n//scanで一行づつ読み込む\nvar sc = bufio.NewScanner(os.Stdin)\nvar wtr = bufio.NewWriter(os.Stdout)\n\n//sort\n// array := []int{5, 1, 4, 2, 3}\n// sort.Sort(sort.IntSlice(array))\n\nfunc main() {\n\t// a := make([]int, n)\n\tn := nextLine()\n\tn2 := strings.Split(n, \" \")\n\tarr := []int{}\n\tfor _, i := range n2 {\n\t\tj, _ := strconv.Atoi(i)\n\t\tarr = append(arr, j)\n\t}\n\tsort.Sort(sort.IntSlice(arr))\n\ta, b := arr[0], arr[1]\n\n\tfmt.Fprintln(wtr, (a*b)/2)\n\t_ = wtr.Flush()\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1548036562, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03145.html", "problem_id": "p03145", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03145/input.txt", "sample_output_relpath": "derived/input_output/data/p03145/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03145/Go/s321131941.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s321131941", "user_id": "u947658937"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n//scanで一行づつ読み込む\nvar sc = bufio.NewScanner(os.Stdin)\nvar wtr = bufio.NewWriter(os.Stdout)\n\n//sort\n// array := []int{5, 1, 4, 2, 3}\n// sort.Sort(sort.IntSlice(array))\n\nfunc main() {\n\t// a := make([]int, n)\n\tn := nextLine()\n\tn2 := strings.Split(n, \" \")\n\tarr := []int{}\n\tfor _, i := range n2 {\n\t\tj, _ := strconv.Atoi(i)\n\t\tarr = append(arr, j)\n\t}\n\tsort.Sort(sort.IntSlice(arr))\n\ta, b := arr[0], arr[1]\n\n\tfmt.Fprintln(wtr, (a*b)/2)\n\t_ = wtr.Flush()\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "sample_input": "3 4 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03145", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 599, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s913842263", "group_id": "codeNet:p03146", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\n\tnn := make([]int, 10000, 10000)\n\tmm := map[int]int{}\n\n\tnn[0] = n\n\tmm[n]++\n\n\ti := 1\n\tfor {\n\t\tvar re int\n\t\tv := nn[i-1]\n\t\tif v%2 == 0 {\n\t\t\tnn[i] = v / 2\n\t\t\tre = v / 2\n\t\t} else {\n\t\t\tnn[i] = 3*v + 1\n\t\t\tre = 3*v + 1\n\t\t}\n\n\t\tmm[re]++\n\t\tif mm[re] > 1 {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t\ti++\n\t}\n}\n", "language": "Go", "metadata": {"date": 1561441799, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03146.html", "problem_id": "p03146", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03146/input.txt", "sample_output_relpath": "derived/input_output/data/p03146/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03146/Go/s913842263.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s913842263", "user_id": "u317845566"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\n\tnn := make([]int, 10000, 10000)\n\tmm := map[int]int{}\n\n\tnn[0] = n\n\tmm[n]++\n\n\ti := 1\n\tfor {\n\t\tvar re int\n\t\tv := nn[i-1]\n\t\tif v%2 == 0 {\n\t\t\tnn[i] = v / 2\n\t\t\tre = v / 2\n\t\t} else {\n\t\t\tnn[i] = 3*v + 1\n\t\t\tre = 3*v + 1\n\t\t}\n\n\t\tmm[re]++\n\t\tif mm[re] > 1 {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t\ti++\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "sample_input": "8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03146", "source_text": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 645, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s142970933", "group_id": "codeNet:p03147", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tfor i:=range h {\n\t\tfmt.Scan(&h[i])\n\t}\n\tg := make([]int, n-1)\n\tif n == 1 {\n\t\tfmt.Println(h[0])\n\t\treturn\n\t}\n\n\tfor i:=1;i 0 {\n\t\t\t\tarr[i]--\n\t\t\t\tif !flg {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tflg = true\n\t\t\t} else {\n\t\t\t\tflg = false\n\t\t\t}\n\t\t\tsum += arr[i]\n\t\t}\n\t\tif sum == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1554550340, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03147.html", "problem_id": "p03147", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03147/input.txt", "sample_output_relpath": "derived/input_output/data/p03147/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03147/Go/s100925843.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s100925843", "user_id": "u857510905"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\t_, _ = fmt.Scan(&n)\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\t_, _ = fmt.Scan(&tmp)\n\t\tarr[i] = tmp\n\t}\n\tcount := 0\n\tfor {\n\t\tsum := 0\n\t\tflg := false\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif arr[i] > 0 {\n\t\t\t\tarr[i]--\n\t\t\t\tif !flg {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tflg = true\n\t\t\t} else {\n\t\t\t\tflg = false\n\t\t\t}\n\t\t\tsum += arr[i]\n\t\t}\n\t\tif sum == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn a flower bed, there are N flowers, numbered 1,2,......,N. Initially, the heights of all flowers are 0.\nYou are given a sequence h=\\{h_1,h_2,h_3,......\\} as input. You would like to change the height of Flower k to h_k for all k (1 \\leq k \\leq N), by repeating the following \"watering\" operation:\n\nSpecify integers l and r. Increase the height of Flower x by 1 for all x such that l \\leq x \\leq r.\n\nFind the minimum number of watering operations required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq h_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 h_3 ...... h_N\n\nOutput\n\nPrint the minimum number of watering operations required to satisfy the condition.\n\nSample Input 1\n\n4\n1 2 2 1\n\nSample Output 1\n\n2\n\nThe minimum number of watering operations required is 2.\nOne way to achieve it is:\n\nPerform the operation with (l,r)=(1,3).\n\nPerform the operation with (l,r)=(2,4).\n\nSample Input 2\n\n5\n3 1 2 3 1\n\nSample Output 2\n\n5\n\nSample Input 3\n\n8\n4 23 75 0 23 96 50 100\n\nSample Output 3\n\n221", "sample_input": "4\n1 2 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03147", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn a flower bed, there are N flowers, numbered 1,2,......,N. Initially, the heights of all flowers are 0.\nYou are given a sequence h=\\{h_1,h_2,h_3,......\\} as input. You would like to change the height of Flower k to h_k for all k (1 \\leq k \\leq N), by repeating the following \"watering\" operation:\n\nSpecify integers l and r. Increase the height of Flower x by 1 for all x such that l \\leq x \\leq r.\n\nFind the minimum number of watering operations required to satisfy the condition.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq h_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 h_3 ...... h_N\n\nOutput\n\nPrint the minimum number of watering operations required to satisfy the condition.\n\nSample Input 1\n\n4\n1 2 2 1\n\nSample Output 1\n\n2\n\nThe minimum number of watering operations required is 2.\nOne way to achieve it is:\n\nPerform the operation with (l,r)=(1,3).\n\nPerform the operation with (l,r)=(2,4).\n\nSample Input 2\n\n5\n3 1 2 3 1\n\nSample Output 2\n\n5\n\nSample Input 3\n\n8\n4 23 75 0 23 96 50 100\n\nSample Output 3\n\n221", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 438, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s715277440", "group_id": "codeNet:p03149", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tcorrect := []int64{1, 4, 7, 9}\n\tN1, N2, N3, N4 := readInt(), readInt(), readInt(), readInt()\n\ta := []int64{N1, N2, N3, N4}\n\tInt64s(correct)\n\tInt64s(a)\n\tif aryEq(correct, a) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1589379453, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03149.html", "problem_id": "p03149", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03149/input.txt", "sample_output_relpath": "derived/input_output/data/p03149/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03149/Go/s715277440.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s715277440", "user_id": "u967669872"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tcorrect := []int64{1, 4, 7, 9}\n\tN1, N2, N3, N4 := readInt(), readInt(), readInt(), readInt()\n\ta := []int64{N1, N2, N3, N4}\n\tInt64s(correct)\n\tInt64s(a)\n\tif aryEq(correct, a) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "sample_input": "1 7 9 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03149", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5793, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s804525503", "group_id": "codeNet:p03150", "input_text": "// ProblemURL : https://atcoder.jp/contests/keyence2019/tasks/keyence2019_b\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc calcMod(n int) int { return n % mod }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc powMod(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, maxBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tmaxBufSize = 1e6\n\n\talphabetUpper = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetLower = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\ts := rs()\n\n\tt := \"keyence\"\n\tok := false\n\tfor i := 0; i <= 7; i++ {\n\t\tj := 7 - i\n\t\tif s[:i]+s[len(s)-j:] == t {\n\t\t\tok = true\n\t\t}\n\t}\n\n\tif ok {\n\t\tpln(\"YES\")\n\t} else {\n\t\tpln(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1568299475, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03150.html", "problem_id": "p03150", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03150/input.txt", "sample_output_relpath": "derived/input_output/data/p03150/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03150/Go/s804525503.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s804525503", "user_id": "u554269352"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/keyence2019/tasks/keyence2019_b\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc calcMod(n int) int { return n % mod }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc powMod(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, maxBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tmaxBufSize = 1e6\n\n\talphabetUpper = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetLower = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\ts := rs()\n\n\tt := \"keyence\"\n\tok := false\n\tfor i := 0; i <= 7; i++ {\n\t\tj := 7 - i\n\t\tif s[:i]+s[len(s)-j:] == t {\n\t\t\tok = true\n\t\t}\n\t}\n\n\tif ok {\n\t\tpln(\"YES\")\n\t} else {\n\t\tpln(\"NO\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string is called a KEYENCE string when it can be changed to keyence by removing its contiguous substring (possibly empty) only once.\n\nGiven a string S consisting of lowercase English letters, determine if S is a KEYENCE string.\n\nConstraints\n\nThe length of S is between 7 and 100 (inclusive).\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a KEYENCE string, print YES; otherwise, print NO.\n\nSample Input 1\n\nkeyofscience\n\nSample Output 1\n\nYES\n\nkeyence is an abbreviation of key of science.\n\nSample Input 2\n\nmpyszsbznf\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nashlfyha\n\nSample Output 3\n\nNO\n\nSample Input 4\n\nkeyence\n\nSample Output 4\n\nYES", "sample_input": "keyofscience\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03150", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string is called a KEYENCE string when it can be changed to keyence by removing its contiguous substring (possibly empty) only once.\n\nGiven a string S consisting of lowercase English letters, determine if S is a KEYENCE string.\n\nConstraints\n\nThe length of S is between 7 and 100 (inclusive).\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a KEYENCE string, print YES; otherwise, print NO.\n\nSample Input 1\n\nkeyofscience\n\nSample Output 1\n\nYES\n\nkeyence is an abbreviation of key of science.\n\nSample Input 2\n\nmpyszsbznf\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nashlfyha\n\nSample Output 3\n\nNO\n\nSample Input 4\n\nkeyence\n\nSample Output 4\n\nYES", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6324, "cpu_time_ms": 2, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448085163", "group_id": "codeNet:p03156", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tn := atoi()\n\tslice := atoiSlice()\n\ta, b := slice[0], slice[1]\n\tp := make([]int, n)\n\tslice = atoiSlice()\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = slice[i]\n\t}\n\n\tvar cnt int\n\tvar state int\n\tenc := map[int]bool{}\n\tfor {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif enc[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif state == 0 && p[i] <= a {\n\t\t\t\tenc[i] = true\n\t\t\t\tstate++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif state == 1 && p[i] > a && p[i] <= b {\n\t\t\t\tenc[i] = true\n\t\t\t\tstate++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif state == 2 && p[i] > b {\n\t\t\t\tenc[i] = true\n\t\t\t\tstate = 0\n\t\t\t\tcnt++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif state == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n\nfunc atoi() int {\n\tif !in.Scan() {\n\t\tpanic(\"eof\")\n\t}\n\ts := in.Text()\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc atoiStr(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc atoiSlice() []int {\n\tif !in.Scan() {\n\t\tpanic(\"eof\")\n\t}\n\ts := in.Text()\n\tsp := strings.Split(s, \" \")\n\te := make([]int, len(sp))\n\tfor i, s := range sp {\n\t\te[i] = atoiStr(s)\n\t}\n\treturn e\n}\n", "language": "Go", "metadata": {"date": 1547326321, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03156.html", "problem_id": "p03156", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03156/input.txt", "sample_output_relpath": "derived/input_output/data/p03156/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03156/Go/s448085163.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s448085163", "user_id": "u580327099"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tn := atoi()\n\tslice := atoiSlice()\n\ta, b := slice[0], slice[1]\n\tp := make([]int, n)\n\tslice = atoiSlice()\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = slice[i]\n\t}\n\n\tvar cnt int\n\tvar state int\n\tenc := map[int]bool{}\n\tfor {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif enc[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif state == 0 && p[i] <= a {\n\t\t\t\tenc[i] = true\n\t\t\t\tstate++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif state == 1 && p[i] > a && p[i] <= b {\n\t\t\t\tenc[i] = true\n\t\t\t\tstate++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif state == 2 && p[i] > b {\n\t\t\t\tenc[i] = true\n\t\t\t\tstate = 0\n\t\t\t\tcnt++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif state == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n\nfunc atoi() int {\n\tif !in.Scan() {\n\t\tpanic(\"eof\")\n\t}\n\ts := in.Text()\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc atoiStr(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc atoiSlice() []int {\n\tif !in.Scan() {\n\t\tpanic(\"eof\")\n\t}\n\ts := in.Text()\n\tsp := strings.Split(s, \" \")\n\te := make([]int, len(sp))\n\tfor i, s := range sp {\n\t\te[i] = atoiStr(s)\n\t}\n\treturn e\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have written N problems to hold programming contests.\nThe i-th problem will have a score of P_i points if used in a contest.\n\nWith these problems, you would like to hold as many contests as possible under the following condition:\n\nA contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points.\n\nThe same problem should not be used in multiple contests.\nAt most how many contests can be held?\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1 \\leq P_i \\leq 20 (1 \\leq i \\leq N)\n\n1 \\leq A < B < 20\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA B\nP_1 P_2 ... P_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n5 15\n1 10 16 2 7 20 12\n\nSample Output 1\n\n2\n\nTwo contests can be held by putting the first, second, third problems and the fourth, fifth, sixth problems together.\n\nSample Input 2\n\n8\n3 8\n5 5 5 10 10 10 15 20\n\nSample Output 2\n\n0\n\nNo contest can be held, because there is no problem with a score of A = 3 or less.\n\nSample Input 3\n\n3\n5 6\n5 6 10\n\nSample Output 3\n\n1", "sample_input": "7\n5 15\n1 10 16 2 7 20 12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03156", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have written N problems to hold programming contests.\nThe i-th problem will have a score of P_i points if used in a contest.\n\nWith these problems, you would like to hold as many contests as possible under the following condition:\n\nA contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points.\n\nThe same problem should not be used in multiple contests.\nAt most how many contests can be held?\n\nConstraints\n\n3 \\leq N \\leq 100\n\n1 \\leq P_i \\leq 20 (1 \\leq i \\leq N)\n\n1 \\leq A < B < 20\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA B\nP_1 P_2 ... P_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n5 15\n1 10 16 2 7 20 12\n\nSample Output 1\n\n2\n\nTwo contests can be held by putting the first, second, third problems and the fourth, fifth, sixth problems together.\n\nSample Input 2\n\n8\n3 8\n5 5 5 10 10 10 15 20\n\nSample Output 2\n\n0\n\nNo contest can be held, because there is no problem with a score of A = 3 or less.\n\nSample Input 3\n\n3\n5 6\n5 6 10\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1148, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s217614209", "group_id": "codeNet:p03157", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar H, W int\nvar S []string\n\nvar dy = []int{1, 0, -1, 0}\nvar dx = []int{0, 1, 0, -1}\n\nvar cnt int\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tH = nextInt()\n\tW = nextInt()\n\tS = make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = nextString()\n\t}\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif S[i][j] == '#' {\n\t\t\t\tcheck := make([]int, H*W)\n\t\t\t\tcheck[i*W+j]++\n\t\t\t\ts(i, j, check)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\nfunc s(h int, w int, check []int) {\n\tcheck[h*W+w]++\n\tfor d := 0; d < 4; d++ {\n\t\tny := h + dy[d]\n\t\tnx := w + dx[d]\n\t\tif ny >= 0 && ny < H && nx >= 0 && nx < W {\n\t\t\tif check[ny*W+nx] > 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif S[ny][nx] != S[h][w] {\n\t\t\t\tif S[ny][nx] == '.' {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t\tcheck[ny*W+nx]++\n\t\t\t\ts(ny, nx, check)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc intPow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc intMax(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc intMin(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc intSum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc intAbs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype pair struct {\n\ta, b int\n}\n\ntype pairs []pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\treturn p[i].b < p[j].b\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = newScanner()\n}\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1547326002, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03157.html", "problem_id": "p03157", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03157/input.txt", "sample_output_relpath": "derived/input_output/data/p03157/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03157/Go/s217614209.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s217614209", "user_id": "u696272993"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar H, W int\nvar S []string\n\nvar dy = []int{1, 0, -1, 0}\nvar dx = []int{0, 1, 0, -1}\n\nvar cnt int\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tH = nextInt()\n\tW = nextInt()\n\tS = make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = nextString()\n\t}\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif S[i][j] == '#' {\n\t\t\t\tcheck := make([]int, H*W)\n\t\t\t\tcheck[i*W+j]++\n\t\t\t\ts(i, j, check)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\nfunc s(h int, w int, check []int) {\n\tcheck[h*W+w]++\n\tfor d := 0; d < 4; d++ {\n\t\tny := h + dy[d]\n\t\tnx := w + dx[d]\n\t\tif ny >= 0 && ny < H && nx >= 0 && nx < W {\n\t\t\tif check[ny*W+nx] > 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif S[ny][nx] != S[h][w] {\n\t\t\t\tif S[ny][nx] == '.' {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t\tcheck[ny*W+nx]++\n\t\t\t\ts(ny, nx, check)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc intPow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc intMax(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc intMin(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc intSum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc intAbs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype pair struct {\n\ta, b int\n}\n\ntype pairs []pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\treturn p[i].b < p[j].b\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = newScanner()\n}\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with H rows and W columns, where each square is painted black or white.\n\nYou are given H strings S_1, S_2, ..., S_H, each of length W.\nIf the square at the i-th row from the top and the j-th column from the left is painted black, the j-th character in the string S_i is #; if that square is painted white, the j-th character in the string S_i is ..\n\nFind the number of pairs of a black square c_1 and a white square c_2 that satisfy the following condition:\n\nThere is a path from the square c_1 to the square c_2 where we repeatedly move to a vertically or horizontally adjacent square through an alternating sequence of black and white squares: black, white, black, white...\n\nConstraints\n\n1 \\leq H, W \\leq 400\n\n|S_i| = W (1 \\leq i \\leq H)\n\nFor each i (1 \\leq i \\leq H), the string S_i consists of characters # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\nS_2\n:\nS_H\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n.#.\n..#\n#..\n\nSample Output 1\n\n10\n\nSome of the pairs satisfying the condition are ((1, 2), (3, 3)) and ((3, 1), (3, 2)), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nSample Input 2\n\n2 4\n....\n....\n\nSample Output 2\n\n0\n\nSample Input 3\n\n4 3\n###\n###\n...\n###\n\nSample Output 3\n\n6", "sample_input": "3 3\n.#.\n..#\n#..\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03157", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with H rows and W columns, where each square is painted black or white.\n\nYou are given H strings S_1, S_2, ..., S_H, each of length W.\nIf the square at the i-th row from the top and the j-th column from the left is painted black, the j-th character in the string S_i is #; if that square is painted white, the j-th character in the string S_i is ..\n\nFind the number of pairs of a black square c_1 and a white square c_2 that satisfy the following condition:\n\nThere is a path from the square c_1 to the square c_2 where we repeatedly move to a vertically or horizontally adjacent square through an alternating sequence of black and white squares: black, white, black, white...\n\nConstraints\n\n1 \\leq H, W \\leq 400\n\n|S_i| = W (1 \\leq i \\leq H)\n\nFor each i (1 \\leq i \\leq H), the string S_i consists of characters # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\nS_2\n:\nS_H\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n.#.\n..#\n#..\n\nSample Output 1\n\n10\n\nSome of the pairs satisfying the condition are ((1, 2), (3, 3)) and ((3, 1), (3, 2)), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nSample Input 2\n\n2 4\n....\n....\n\nSample Output 2\n\n0\n\nSample Input 3\n\n4 3\n###\n###\n...\n###\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2324, "cpu_time_ms": 2108, "memory_kb": 40064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s882292866", "group_id": "codeNet:p03157", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sat Jan 12 21:05:35 2019\n//\npackage main\n\nimport \"fmt\"\n\nconst (\n\tWHITE = '.'\n\tBLACK = '#'\n)\n\nfunc dfs(visited [][]bool, board []string, x, y int, color rune) int {\n\tvisited[x][y] = true\n\n\tret := 0\n\tif rune(board[x][y]) == color {\n\t\tif color == WHITE {\n\t\t\tret++\n\t\t}\n\t\tfor _, d := range [][]int{{-1, 0}, {1, 0}, {0, -1}, {0, 1}} {\n\t\t\tdx := x + d[0]\n\t\t\tdy := y + d[1]\n\n\t\t\tnextColor := WHITE\n\t\t\tif color == nextColor {\n\t\t\t\tnextColor = BLACK\n\t\t\t}\n\n\t\t\tif 0 <= dx && dx < len(board) && 0 <= dy && dy < len(board[0]) && visited[dx][dy] == false {\n\t\t\t\tret += dfs(visited, board, dx, dy, nextColor)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc routes(board []string, x, y int, color rune) int {\n\tvisited := make([][]bool, len(board))\n\tfor i := range visited {\n\t\tvisited[i] = make([]bool, len(board[0]))\n\t}\n\n\treturn dfs(visited, board, x, y, color)\n}\n\ntype pair struct {\n\tx, y int\n}\n\nfunc main() {\n\tvar H, W int\n\tfmt.Scan(&H, &W)\n\tboard := make([]string, H)\n\tfor i := range board {\n\t\tfmt.Scan(&board[i])\n\t}\n\n\tblacks := make([]pair, 0)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif board[i][j] == BLACK {\n\t\t\t\tblacks = append(blacks, pair{x: i, y: j})\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, b := range blacks {\n\t\tans += routes(board, b.x, b.y, BLACK)\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1547325149, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03157.html", "problem_id": "p03157", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03157/input.txt", "sample_output_relpath": "derived/input_output/data/p03157/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03157/Go/s882292866.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s882292866", "user_id": "u842030412"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sat Jan 12 21:05:35 2019\n//\npackage main\n\nimport \"fmt\"\n\nconst (\n\tWHITE = '.'\n\tBLACK = '#'\n)\n\nfunc dfs(visited [][]bool, board []string, x, y int, color rune) int {\n\tvisited[x][y] = true\n\n\tret := 0\n\tif rune(board[x][y]) == color {\n\t\tif color == WHITE {\n\t\t\tret++\n\t\t}\n\t\tfor _, d := range [][]int{{-1, 0}, {1, 0}, {0, -1}, {0, 1}} {\n\t\t\tdx := x + d[0]\n\t\t\tdy := y + d[1]\n\n\t\t\tnextColor := WHITE\n\t\t\tif color == nextColor {\n\t\t\t\tnextColor = BLACK\n\t\t\t}\n\n\t\t\tif 0 <= dx && dx < len(board) && 0 <= dy && dy < len(board[0]) && visited[dx][dy] == false {\n\t\t\t\tret += dfs(visited, board, dx, dy, nextColor)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc routes(board []string, x, y int, color rune) int {\n\tvisited := make([][]bool, len(board))\n\tfor i := range visited {\n\t\tvisited[i] = make([]bool, len(board[0]))\n\t}\n\n\treturn dfs(visited, board, x, y, color)\n}\n\ntype pair struct {\n\tx, y int\n}\n\nfunc main() {\n\tvar H, W int\n\tfmt.Scan(&H, &W)\n\tboard := make([]string, H)\n\tfor i := range board {\n\t\tfmt.Scan(&board[i])\n\t}\n\n\tblacks := make([]pair, 0)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif board[i][j] == BLACK {\n\t\t\t\tblacks = append(blacks, pair{x: i, y: j})\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, b := range blacks {\n\t\tans += routes(board, b.x, b.y, BLACK)\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with H rows and W columns, where each square is painted black or white.\n\nYou are given H strings S_1, S_2, ..., S_H, each of length W.\nIf the square at the i-th row from the top and the j-th column from the left is painted black, the j-th character in the string S_i is #; if that square is painted white, the j-th character in the string S_i is ..\n\nFind the number of pairs of a black square c_1 and a white square c_2 that satisfy the following condition:\n\nThere is a path from the square c_1 to the square c_2 where we repeatedly move to a vertically or horizontally adjacent square through an alternating sequence of black and white squares: black, white, black, white...\n\nConstraints\n\n1 \\leq H, W \\leq 400\n\n|S_i| = W (1 \\leq i \\leq H)\n\nFor each i (1 \\leq i \\leq H), the string S_i consists of characters # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\nS_2\n:\nS_H\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n.#.\n..#\n#..\n\nSample Output 1\n\n10\n\nSome of the pairs satisfying the condition are ((1, 2), (3, 3)) and ((3, 1), (3, 2)), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nSample Input 2\n\n2 4\n....\n....\n\nSample Output 2\n\n0\n\nSample Input 3\n\n4 3\n###\n###\n...\n###\n\nSample Output 3\n\n6", "sample_input": "3 3\n.#.\n..#\n#..\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03157", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with H rows and W columns, where each square is painted black or white.\n\nYou are given H strings S_1, S_2, ..., S_H, each of length W.\nIf the square at the i-th row from the top and the j-th column from the left is painted black, the j-th character in the string S_i is #; if that square is painted white, the j-th character in the string S_i is ..\n\nFind the number of pairs of a black square c_1 and a white square c_2 that satisfy the following condition:\n\nThere is a path from the square c_1 to the square c_2 where we repeatedly move to a vertically or horizontally adjacent square through an alternating sequence of black and white squares: black, white, black, white...\n\nConstraints\n\n1 \\leq H, W \\leq 400\n\n|S_i| = W (1 \\leq i \\leq H)\n\nFor each i (1 \\leq i \\leq H), the string S_i consists of characters # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\nS_2\n:\nS_H\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n.#.\n..#\n#..\n\nSample Output 1\n\n10\n\nSome of the pairs satisfying the condition are ((1, 2), (3, 3)) and ((3, 1), (3, 2)), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nSample Input 2\n\n2 4\n....\n....\n\nSample Output 2\n\n0\n\nSample Input 3\n\n4 3\n###\n###\n...\n###\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1336, "cpu_time_ms": 2109, "memory_kb": 137344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s623024650", "group_id": "codeNet:p03162", "input_text": "package main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc maxs(xs []int) int {\n\tvar ans int\n\tfor _, x := range xs {\n\t\tif ans < x {\n\t\t\tans = x\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tc := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d %d %d\", &a[i], &b[i], &c[i])\n\t}\n\n\tdp := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = make([]int, 3)\n\t}\n\tdp[0] = []int{a[0], b[0], c[0]}\n\n\tfor i := 1; i < n; i++ {\n\t\t// aを選んだ場合\n\t\tdp[i][0] = max(dp[i][0], dp[i-1][1]+a[i]) // 1つ前でbを選んだ場合\n\t\tdp[i][0] = max(dp[i][0], dp[i-1][2]+a[i]) // 1つ前でcを選んだ場合\n\t\t// bを選んだ場合\n\t\tdp[i][1] = max(dp[i][1], dp[i-1][0]+b[i]) // 1つ前でaを選んだ場合\n\t\tdp[i][1] = max(dp[i][1], dp[i-1][2]+b[i]) // 1つ前でcを選んだ場合\n\t\t// cを選んだ場合\n\t\tdp[i][2] = max(dp[i][2], dp[i-1][0]+c[i]) // 1つ前でaを選んだ場合\n\t\tdp[i][2] = max(dp[i][2], dp[i-1][1]+c[i]) // 1つ前でbを選んだ場合\n\t}\n\n\tfmt.Println(maxs(dp[len(dp)-1]))\n}\n", "language": "Go", "metadata": {"date": 1600201497, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03162.html", "problem_id": "p03162", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03162/input.txt", "sample_output_relpath": "derived/input_output/data/p03162/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03162/Go/s623024650.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s623024650", "user_id": "u998286277"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc maxs(xs []int) int {\n\tvar ans int\n\tfor _, x := range xs {\n\t\tif ans < x {\n\t\t\tans = x\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tc := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d %d %d\", &a[i], &b[i], &c[i])\n\t}\n\n\tdp := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = make([]int, 3)\n\t}\n\tdp[0] = []int{a[0], b[0], c[0]}\n\n\tfor i := 1; i < n; i++ {\n\t\t// aを選んだ場合\n\t\tdp[i][0] = max(dp[i][0], dp[i-1][1]+a[i]) // 1つ前でbを選んだ場合\n\t\tdp[i][0] = max(dp[i][0], dp[i-1][2]+a[i]) // 1つ前でcを選んだ場合\n\t\t// bを選んだ場合\n\t\tdp[i][1] = max(dp[i][1], dp[i-1][0]+b[i]) // 1つ前でaを選んだ場合\n\t\tdp[i][1] = max(dp[i][1], dp[i-1][2]+b[i]) // 1つ前でcを選んだ場合\n\t\t// cを選んだ場合\n\t\tdp[i][2] = max(dp[i][2], dp[i-1][0]+c[i]) // 1つ前でaを選んだ場合\n\t\tdp[i][2] = max(dp[i][2], dp[i-1][1]+c[i]) // 1つ前でbを選んだ場合\n\t}\n\n\tfmt.Println(maxs(dp[len(dp)-1]))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1262, "cpu_time_ms": 1497, "memory_kb": 11172}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s183407038", "group_id": "codeNet:p03162", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(v1, v2 int) int {\n\tif v1 > v2 {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\nfunc main() {\n\tvar dp [100005][3]int\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tvar abc [3][]int\n\tfor i := 0; i < n; i++ {\n\t\tabc[0] = append(abc[0], nextInt())\n\t\tabc[1] = append(abc[1], nextInt())\n\t\tabc[2] = append(abc[2], nextInt())\n\t}\n\n\tfor j := 0; j < 3; j++ {\n\t\tdp[0][j] = abc[j][0]\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\tdp[i][0] = max(dp[i-1][1]+abc[0][i], dp[i-1][2]+abc[0][i])\n\t\tdp[i][1] = max(dp[i-1][0]+abc[1][i], dp[i-1][2]+abc[1][i])\n\t\tdp[i][2] = max(dp[i-1][0]+abc[2][i], dp[i-1][1]+abc[2][i])\n\t}\n\n\tans := max(max(dp[n-1][0], dp[n-1][1]), dp[n-1][2])\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1570310155, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03162.html", "problem_id": "p03162", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03162/input.txt", "sample_output_relpath": "derived/input_output/data/p03162/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03162/Go/s183407038.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s183407038", "user_id": "u443924743"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(v1, v2 int) int {\n\tif v1 > v2 {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\nfunc main() {\n\tvar dp [100005][3]int\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tvar abc [3][]int\n\tfor i := 0; i < n; i++ {\n\t\tabc[0] = append(abc[0], nextInt())\n\t\tabc[1] = append(abc[1], nextInt())\n\t\tabc[2] = append(abc[2], nextInt())\n\t}\n\n\tfor j := 0; j < 3; j++ {\n\t\tdp[0][j] = abc[j][0]\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\tdp[i][0] = max(dp[i-1][1]+abc[0][i], dp[i-1][2]+abc[0][i])\n\t\tdp[i][1] = max(dp[i-1][0]+abc[1][i], dp[i-1][2]+abc[1][i])\n\t\tdp[i][2] = max(dp[i-1][0]+abc[2][i], dp[i-1][1]+abc[2][i])\n\t}\n\n\tans := max(max(dp[n-1][0], dp[n-1][1]), dp[n-1][2])\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 898, "cpu_time_ms": 64, "memory_kb": 10880}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s640326165", "group_id": "codeNet:p03162", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Wed Jan 9 23:27:55 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc max(slice ...int) int {\n\tsort.Ints(slice)\n\treturn slice[len(slice)-1]\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\ta, b, c := make([]int, N), make([]int, N), make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i], &b[i], &c[i])\n\t}\n\n\tdp := make([][3]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tdp[i][0] = a[i-1] + max(dp[i-1][1], dp[i-1][2])\n\t\tdp[i][1] = b[i-1] + max(dp[i-1][2], dp[i-1][0])\n\t\tdp[i][2] = c[i-1] + max(dp[i-1][0], dp[i-1][1])\n\t}\n\n\tfmt.Println(max(dp[N][0], dp[N][1], dp[N][2]))\n}\n", "language": "Go", "metadata": {"date": 1547147280, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03162.html", "problem_id": "p03162", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03162/input.txt", "sample_output_relpath": "derived/input_output/data/p03162/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03162/Go/s640326165.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s640326165", "user_id": "u802614675"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Wed Jan 9 23:27:55 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc max(slice ...int) int {\n\tsort.Ints(slice)\n\treturn slice[len(slice)-1]\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\ta, b, c := make([]int, N), make([]int, N), make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i], &b[i], &c[i])\n\t}\n\n\tdp := make([][3]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tdp[i][0] = a[i-1] + max(dp[i-1][1], dp[i-1][2])\n\t\tdp[i][1] = b[i-1] + max(dp[i-1][2], dp[i-1][0])\n\t\tdp[i][2] = c[i-1] + max(dp[i-1][0], dp[i-1][1])\n\t}\n\n\tfmt.Println(max(dp[N][0], dp[N][1], dp[N][2]))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 647, "cpu_time_ms": 1281, "memory_kb": 10112}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s924316387", "group_id": "codeNet:p03164", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Item struct {\n\tValue int\n\tWeight int\n}\n\nfunc main() {\n\tvar ItemNumber int\n\tvar MaxWeight int\n\tconst maxW = 100000\n\n\tsack := []Item{}\n\n\tfmt.Scanln(&ItemNumber, &MaxWeight)\n\n\tdp := make([]int, maxW+1)\n\tfill(dp, math.MaxInt64)\n\tdp[0] = 0\n\n\tfor i := 0; i < ItemNumber; i++ {\n\t\tX := Item{}\n\t\tfmt.Scanln(&X.Weight, &X.Value)\n\t\tsack = append(sack, X)\n\t}\n\tvalue := Knapsack(sack, dp,ItemNumber,MaxWeight)\n\tfmt.Print(value)\n}\n\nfunc Knapsack(sacks []Item,dp []int, N int, W int) int{\n\tconst maxW = 100000\n\tfor i := 0; i < N; i++ {\n\t\tw := sacks[i].Weight\n\t\tv := sacks[i].Value\n\t\tfor j := maxW - v; j >= 0; j-- {\n\t\t\tif dp[j] == math.MaxInt64 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif dp[j]+w <= W {\n\t\t\t\tdp[j+v] = min(dp[j+v], dp[j]+w)\n\t\t\t}\n\t\t}\n\t}\n\ti := maxW\n\tfor dp[i] == math.MaxInt64 {\n\t\ti--\n\t}\n\treturn i\n}\n\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc fill(a []int, x int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = x\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594219346, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03164.html", "problem_id": "p03164", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03164/input.txt", "sample_output_relpath": "derived/input_output/data/p03164/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03164/Go/s924316387.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s924316387", "user_id": "u646141604"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Item struct {\n\tValue int\n\tWeight int\n}\n\nfunc main() {\n\tvar ItemNumber int\n\tvar MaxWeight int\n\tconst maxW = 100000\n\n\tsack := []Item{}\n\n\tfmt.Scanln(&ItemNumber, &MaxWeight)\n\n\tdp := make([]int, maxW+1)\n\tfill(dp, math.MaxInt64)\n\tdp[0] = 0\n\n\tfor i := 0; i < ItemNumber; i++ {\n\t\tX := Item{}\n\t\tfmt.Scanln(&X.Weight, &X.Value)\n\t\tsack = append(sack, X)\n\t}\n\tvalue := Knapsack(sack, dp,ItemNumber,MaxWeight)\n\tfmt.Print(value)\n}\n\nfunc Knapsack(sacks []Item,dp []int, N int, W int) int{\n\tconst maxW = 100000\n\tfor i := 0; i < N; i++ {\n\t\tw := sacks[i].Weight\n\t\tv := sacks[i].Value\n\t\tfor j := maxW - v; j >= 0; j-- {\n\t\t\tif dp[j] == math.MaxInt64 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif dp[j]+w <= W {\n\t\t\t\tdp[j+v] = min(dp[j+v], dp[j]+w)\n\t\t\t}\n\t\t}\n\t}\n\ti := maxW\n\tfor dp[i] == math.MaxInt64 {\n\t\ti--\n\t}\n\treturn i\n}\n\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc fill(a []int, x int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = x\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^9\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n1 1000000000\n1000000000 10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03164", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^9\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n1 1000000000\n1000000000 10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 971, "cpu_time_ms": 33, "memory_kb": 2712}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218700877", "group_id": "codeNet:p03173", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar N int\nvar a, s []int\n\nfunc main() {\n\tN = ReadInt()\n\ta = ReadInts(N)\n\ts = make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\ts[i+1] = s[i] + a[i]\n\t}\n\tmemo = make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tmemo[i] = make([]int, N)\n\t}\n\tfmt.Println(f(0, N-1))\n}\n\nvar memo [][]int\n\nfunc f(i, j int) int {\n\tif i == j {\n\t\treturn 0\n\t}\n\tif j-1 == i {\n\t\treturn a[i] + a[j]\n\t}\n\tif memo[i][j] > 0 {\n\t\treturn memo[i][j]\n\t}\n\tv := Min(\n\t\tf(i, j-1)+s[j+1]-s[i],\n\t\tf(i, j-2)+a[j-1]+a[j]+s[j+1]-s[i],\n\t\tf(i+1, j)+s[j+1]-s[i],\n\t\tf(i+2, j)+a[i]+a[i+1]+s[j+1]-s[i],\n\t)\n\tmemo[i][j] = v\n\treturn v\n}\n\nfunc Min(xs ...int) int {\n\tmin := xs[0]\n\tfor _, x := range xs[1:] {\n\t\tif min > x {\n\t\t\tmin = x\n\t\t}\n\t}\n\treturn min\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1593990290, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03173.html", "problem_id": "p03173", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03173/input.txt", "sample_output_relpath": "derived/input_output/data/p03173/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03173/Go/s218700877.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s218700877", "user_id": "u328656362"}, "prompt_components": {"gold_output": "190\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar N int\nvar a, s []int\n\nfunc main() {\n\tN = ReadInt()\n\ta = ReadInts(N)\n\ts = make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\ts[i+1] = s[i] + a[i]\n\t}\n\tmemo = make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tmemo[i] = make([]int, N)\n\t}\n\tfmt.Println(f(0, N-1))\n}\n\nvar memo [][]int\n\nfunc f(i, j int) int {\n\tif i == j {\n\t\treturn 0\n\t}\n\tif j-1 == i {\n\t\treturn a[i] + a[j]\n\t}\n\tif memo[i][j] > 0 {\n\t\treturn memo[i][j]\n\t}\n\tv := Min(\n\t\tf(i, j-1)+s[j+1]-s[i],\n\t\tf(i, j-2)+a[j-1]+a[j]+s[j+1]-s[i],\n\t\tf(i+1, j)+s[j+1]-s[i],\n\t\tf(i+2, j)+a[i]+a[i+1]+s[j+1]-s[i],\n\t)\n\tmemo[i][j] = v\n\treturn v\n}\n\nfunc Min(xs ...int) int {\n\tmin := xs[0]\n\tfor _, x := range xs[1:] {\n\t\tif min > x {\n\t\t\tmin = x\n\t\t}\n\t}\n\treturn min\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N slimes lining up in a row.\nInitially, the i-th slime from the left has a size of a_i.\n\nTaro is trying to combine all the slimes into a larger slime.\nHe will perform the following operation repeatedly until there is only one slime:\n\nChoose two adjacent slimes, and combine them into a new slime. The new slime has a size of x + y, where x and y are the sizes of the slimes before combining them. Here, a cost of x + y is incurred. The positional relationship of the slimes does not change while combining slimes.\n\nFind the minimum possible total cost incurred.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 400\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 20 30 40\n\nSample Output 1\n\n190\n\nTaro should do as follows (slimes being combined are shown in bold):\n\n(10, 20, 30, 40) → (30, 30, 40)\n\n(30, 30, 40) → (60, 40)\n\n(60, 40) → (100)\n\nSample Input 2\n\n5\n10 10 10 10 10\n\nSample Output 2\n\n120\n\nTaro should do, for example, as follows:\n\n(10, 10, 10, 10, 10) → (20, 10, 10, 10)\n\n(20, 10, 10, 10) → (20, 20, 10)\n\n(20, 20, 10) → (20, 30)\n\n(20, 30) → (50)\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 4\n\n6\n7 6 8 6 1 1\n\nSample Output 4\n\n68\n\nTaro should do, for example, as follows:\n\n(7, 6, 8, 6, 1, 1) → (7, 6, 8, 6, 2)\n\n(7, 6, 8, 6, 2) → (7, 6, 8, 8)\n\n(7, 6, 8, 8) → (13, 8, 8)\n\n(13, 8, 8) → (13, 16)\n\n(13, 16) → (29)", "sample_input": "4\n10 20 30 40\n"}, "reference_outputs": ["190\n"], "source_document_id": "p03173", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N slimes lining up in a row.\nInitially, the i-th slime from the left has a size of a_i.\n\nTaro is trying to combine all the slimes into a larger slime.\nHe will perform the following operation repeatedly until there is only one slime:\n\nChoose two adjacent slimes, and combine them into a new slime. The new slime has a size of x + y, where x and y are the sizes of the slimes before combining them. Here, a cost of x + y is incurred. The positional relationship of the slimes does not change while combining slimes.\n\nFind the minimum possible total cost incurred.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 400\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 20 30 40\n\nSample Output 1\n\n190\n\nTaro should do as follows (slimes being combined are shown in bold):\n\n(10, 20, 30, 40) → (30, 30, 40)\n\n(30, 30, 40) → (60, 40)\n\n(60, 40) → (100)\n\nSample Input 2\n\n5\n10 10 10 10 10\n\nSample Output 2\n\n120\n\nTaro should do, for example, as follows:\n\n(10, 10, 10, 10, 10) → (20, 10, 10, 10)\n\n(20, 10, 10, 10) → (20, 20, 10)\n\n(20, 20, 10) → (20, 30)\n\n(20, 30) → (50)\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 4\n\n6\n7 6 8 6 1 1\n\nSample Output 4\n\n68\n\nTaro should do, for example, as follows:\n\n(7, 6, 8, 6, 1, 1) → (7, 6, 8, 6, 2)\n\n(7, 6, 8, 6, 2) → (7, 6, 8, 8)\n\n(7, 6, 8, 8) → (13, 8, 8)\n\n(13, 8, 8) → (13, 16)\n\n(13, 16) → (29)", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1025, "cpu_time_ms": 16, "memory_kb": 3324}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s548514333", "group_id": "codeNet:p03176", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tN int\n\th, a [212345]int\n)\n\nfunc readVariables() {\n\tN = nextInt()\n\tfor i := 0; i < N; i++ {\n\t\th[i] = nextInt()\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n}\n\nfunc main() {\n\treadVariables()\n\tbit := NewBIT(N)\n\tanswer := 0\n\tfor i := 0; i < N; i++ {\n\t\tv := a[i] + bit.Accumulate(h[i]-1)\n\t\tbit.Add(h[i], v)\n\t\t// fmt.Println(bit.Nodes)\n\t\tanswer = MaxInt(v, answer)\n\t}\n\tfmt.Println(answer)\n}\n\n/* 以下、テンプレート*/\n\nvar scanner *bufio.Scanner\n\nfunc init() {\n\tMax := 1001001\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 0, Max), Max)\n\tscanner.Split(bufio.ScanWords)\n}\n\n//nextInt converts next token from stdin and returns integer value.\n//nextInt panics when conversion into an integer fails.\nfunc nextInt() int {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(\"nextInt(): cannot convert to int: \" + scanner.Text())\n\t}\n\treturn num\n}\n\nfunc nextStr() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\treturn scanner.Text()\n}\n\n// MinInt は、2つの整数を受け取り、最小値を返します。\nfunc MinInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\n//MaxInt は、2つの整数を受け取り、最大値を返します。\nfunc MaxInt(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\n//AbsInt は、整数の絶対値を返します。\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n//ModPow は整数の累乗関数で、剰余もサポートします。\n//base^exponentの値をmoduleで割った余りを返します。\n//moduloが1以下の場合には、剰余演算をしません。\n//baseが負の値である場合には、返す値が負になることがあります。\nfunc ModPow(base, exponent, modulo int) (result int) {\n\tresult = 1\n\tfor exponent > 0 {\n\t\tif exponent%2 == 1 {\n\t\t\tresult *= base\n\t\t\tif modulo > 1 {\n\t\t\t\tresult %= modulo\n\t\t\t}\n\t\t}\n\t\tbase *= base\n\t\tif modulo > 1 {\n\t\t\tbase %= modulo\n\t\t}\n\t\texponent /= 2\n\t}\n\treturn\n}\n\n//Gcd は、引数の整数全ての最大公約数を返します。\nfunc Gcd(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = gcd(result, vals[i])\n\t}\n\treturn\n}\n\nfunc gcd(x, y int) int {\n\tx, y = AbsInt(x), AbsInt(y)\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\n//Lcm は、与えられた整数の最小公倍数を返します。\nfunc Lcm(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = lcm(result, vals[i])\n\t}\n\treturn\n}\n\nfunc lcm(x, y int) int {\n\treturn x * y / gcd(x, y)\n}\n\ntype BIT struct {\n\tNodes []int\n\tSize int\n}\n\nfunc NewBIT(size int) *BIT {\n\tbit := new(BIT)\n\tbit.Size = size\n\tbit.Nodes = make([]int, size+1)\n\treturn bit\n}\n\nfunc (bit *BIT) Add(location, value int) {\n\tfor i := location + 1; i <= bit.Size; i += (i & -i) {\n\t\tbit.Nodes[i] = MaxInt(bit.Nodes[i], value)\n\t}\n}\n\nfunc (bit *BIT) Sum(start, end int) int {\n\treturn bit.Accumulate(end) - bit.Accumulate(start-1)\n}\n\nfunc (bit *BIT) Accumulate(end int) (result int) {\n\tresult = -1234567890\n\tif end >= bit.Size {\n\t\tend = bit.Size - 1\n\t}\n\tfor i := end + 1; i > 0; i -= i & -i {\n\t\tresult = MaxInt(bit.Nodes[i], result)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1582733472, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03176.html", "problem_id": "p03176", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03176/input.txt", "sample_output_relpath": "derived/input_output/data/p03176/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03176/Go/s548514333.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s548514333", "user_id": "u390694622"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tN int\n\th, a [212345]int\n)\n\nfunc readVariables() {\n\tN = nextInt()\n\tfor i := 0; i < N; i++ {\n\t\th[i] = nextInt()\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n}\n\nfunc main() {\n\treadVariables()\n\tbit := NewBIT(N)\n\tanswer := 0\n\tfor i := 0; i < N; i++ {\n\t\tv := a[i] + bit.Accumulate(h[i]-1)\n\t\tbit.Add(h[i], v)\n\t\t// fmt.Println(bit.Nodes)\n\t\tanswer = MaxInt(v, answer)\n\t}\n\tfmt.Println(answer)\n}\n\n/* 以下、テンプレート*/\n\nvar scanner *bufio.Scanner\n\nfunc init() {\n\tMax := 1001001\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 0, Max), Max)\n\tscanner.Split(bufio.ScanWords)\n}\n\n//nextInt converts next token from stdin and returns integer value.\n//nextInt panics when conversion into an integer fails.\nfunc nextInt() int {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(\"nextInt(): cannot convert to int: \" + scanner.Text())\n\t}\n\treturn num\n}\n\nfunc nextStr() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\treturn scanner.Text()\n}\n\n// MinInt は、2つの整数を受け取り、最小値を返します。\nfunc MinInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\n//MaxInt は、2つの整数を受け取り、最大値を返します。\nfunc MaxInt(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\n//AbsInt は、整数の絶対値を返します。\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n//ModPow は整数の累乗関数で、剰余もサポートします。\n//base^exponentの値をmoduleで割った余りを返します。\n//moduloが1以下の場合には、剰余演算をしません。\n//baseが負の値である場合には、返す値が負になることがあります。\nfunc ModPow(base, exponent, modulo int) (result int) {\n\tresult = 1\n\tfor exponent > 0 {\n\t\tif exponent%2 == 1 {\n\t\t\tresult *= base\n\t\t\tif modulo > 1 {\n\t\t\t\tresult %= modulo\n\t\t\t}\n\t\t}\n\t\tbase *= base\n\t\tif modulo > 1 {\n\t\t\tbase %= modulo\n\t\t}\n\t\texponent /= 2\n\t}\n\treturn\n}\n\n//Gcd は、引数の整数全ての最大公約数を返します。\nfunc Gcd(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = gcd(result, vals[i])\n\t}\n\treturn\n}\n\nfunc gcd(x, y int) int {\n\tx, y = AbsInt(x), AbsInt(y)\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\n//Lcm は、与えられた整数の最小公倍数を返します。\nfunc Lcm(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = lcm(result, vals[i])\n\t}\n\treturn\n}\n\nfunc lcm(x, y int) int {\n\treturn x * y / gcd(x, y)\n}\n\ntype BIT struct {\n\tNodes []int\n\tSize int\n}\n\nfunc NewBIT(size int) *BIT {\n\tbit := new(BIT)\n\tbit.Size = size\n\tbit.Nodes = make([]int, size+1)\n\treturn bit\n}\n\nfunc (bit *BIT) Add(location, value int) {\n\tfor i := location + 1; i <= bit.Size; i += (i & -i) {\n\t\tbit.Nodes[i] = MaxInt(bit.Nodes[i], value)\n\t}\n}\n\nfunc (bit *BIT) Sum(start, end int) int {\n\treturn bit.Accumulate(end) - bit.Accumulate(start-1)\n}\n\nfunc (bit *BIT) Accumulate(end int) (result int) {\n\tresult = -1234567890\n\tif end >= bit.Size {\n\t\tend = bit.Size - 1\n\t}\n\tfor i := end + 1; i > 0; i -= i & -i {\n\t\tresult = MaxInt(bit.Nodes[i], result)\n\t}\n\treturn\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N flowers arranged in a row.\nFor each i (1 \\leq i \\leq N), the height and the beauty of the i-th flower from the left is h_i and a_i, respectively.\nHere, h_1, h_2, \\ldots, h_N are all distinct.\n\nTaro is pulling out some flowers so that the following condition is met:\n\nThe heights of the remaining flowers are monotonically increasing from left to right.\n\nFind the maximum possible sum of the beauties of the remaining flowers.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 × 10^5\n\n1 \\leq h_i \\leq N\n\nh_1, h_2, \\ldots, h_N are all distinct.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the maximum possible sum of the beauties of the remaining flowers.\n\nSample Input 1\n\n4\n3 1 4 2\n10 20 30 40\n\nSample Output 1\n\n60\n\nWe should keep the second and fourth flowers from the left.\nThen, the heights would be 1, 2 from left to right, which is monotonically increasing, and the sum of the beauties would be 20 + 40 = 60.\n\nSample Input 2\n\n1\n1\n10\n\nSample Output 2\n\n10\n\nThe condition is met already at the beginning.\n\nSample Input 3\n\n5\n1 2 3 4 5\n1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 4\n\n9\n4 2 5 8 3 6 1 7 9\n6 8 8 4 6 3 5 7 5\n\nSample Output 4\n\n31\n\nWe should keep the second, third, sixth, eighth and ninth flowers from the left.", "sample_input": "4\n3 1 4 2\n10 20 30 40\n"}, "reference_outputs": ["60\n"], "source_document_id": "p03176", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N flowers arranged in a row.\nFor each i (1 \\leq i \\leq N), the height and the beauty of the i-th flower from the left is h_i and a_i, respectively.\nHere, h_1, h_2, \\ldots, h_N are all distinct.\n\nTaro is pulling out some flowers so that the following condition is met:\n\nThe heights of the remaining flowers are monotonically increasing from left to right.\n\nFind the maximum possible sum of the beauties of the remaining flowers.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 × 10^5\n\n1 \\leq h_i \\leq N\n\nh_1, h_2, \\ldots, h_N are all distinct.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the maximum possible sum of the beauties of the remaining flowers.\n\nSample Input 1\n\n4\n3 1 4 2\n10 20 30 40\n\nSample Output 1\n\n60\n\nWe should keep the second and fourth flowers from the left.\nThen, the heights would be 1, 2 from left to right, which is monotonically increasing, and the sum of the beauties would be 20 + 40 = 60.\n\nSample Input 2\n\n1\n1\n10\n\nSample Output 2\n\n10\n\nThe condition is met already at the beginning.\n\nSample Input 3\n\n5\n1 2 3 4 5\n1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 4\n\n9\n4 2 5 8 3 6 1 7 9\n6 8 8 4 6 3 5 7 5\n\nSample Output 4\n\n31\n\nWe should keep the second, third, sixth, eighth and ninth flowers from the left.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3333, "cpu_time_ms": 119, "memory_kb": 10368}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s376488236", "group_id": "codeNet:p03177", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Mod = int(1e9) + 7\n\nfunc main() {\n\tN, K := ReadInt(), ReadInt()\n\ta := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = ReadInts(N)\n\t}\n\n\tg := Pow(a, K)\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tans += g[i][j]\n\t\t\tans %= Mod\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n// 行列の積\nfunc Mul(A [][]int, B [][]int) [][]int {\n\tC := make([][]int, len(A))\n\tfor i := 0; i < len(A); i++ {\n\t\tC[i] = make([]int, len(B))\n\t}\n\tfor i := 0; i < len(A); i++ {\n\t\tfor k := 0; k < len(B); k++ {\n\t\t\tfor j := 0; j < len(B[0]); j++ {\n\t\t\t\tC[i][j] += +A[i][k] * B[k][j]\n\t\t\t\tC[i][j] %= Mod\n\t\t\t}\n\t\t}\n\t}\n\treturn C\n}\n\n// 行列の累乗\nfunc Pow(A [][]int, n int) [][]int {\n\tB := make([][]int, len(A))\n\tfor i := 0; i < len(A); i++ {\n\t\tB[i] = make([]int, len(A))\n\t\tB[i][i] = 1 // 単位行列にする\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = Mul(B, A)\n\t\t}\n\t\tA = Mul(A, A)\n\t\tn >>= 1\n\t}\n\treturn B\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1598744149, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03177.html", "problem_id": "p03177", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03177/input.txt", "sample_output_relpath": "derived/input_output/data/p03177/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03177/Go/s376488236.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s376488236", "user_id": "u328656362"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Mod = int(1e9) + 7\n\nfunc main() {\n\tN, K := ReadInt(), ReadInt()\n\ta := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = ReadInts(N)\n\t}\n\n\tg := Pow(a, K)\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tans += g[i][j]\n\t\t\tans %= Mod\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n// 行列の積\nfunc Mul(A [][]int, B [][]int) [][]int {\n\tC := make([][]int, len(A))\n\tfor i := 0; i < len(A); i++ {\n\t\tC[i] = make([]int, len(B))\n\t}\n\tfor i := 0; i < len(A); i++ {\n\t\tfor k := 0; k < len(B); k++ {\n\t\t\tfor j := 0; j < len(B[0]); j++ {\n\t\t\t\tC[i][j] += +A[i][k] * B[k][j]\n\t\t\t\tC[i][j] %= Mod\n\t\t\t}\n\t\t}\n\t}\n\treturn C\n}\n\n// 行列の累乗\nfunc Pow(A [][]int, n int) [][]int {\n\tB := make([][]int, len(A))\n\tfor i := 0; i < len(A); i++ {\n\t\tB[i] = make([]int, len(A))\n\t\tB[i][i] = 1 // 単位行列にする\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = Mul(B, A)\n\t\t}\n\t\tA = Mul(A, A)\n\t\tn >>= 1\n\t}\n\treturn B\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a simple directed graph G with N vertices, numbered 1, 2, \\ldots, N.\n\nFor each i and j (1 \\leq i, j \\leq N), you are given an integer a_{i, j} that represents whether there is a directed edge from Vertex i to j.\nIf a_{i, j} = 1, there is a directed edge from Vertex i to j; if a_{i, j} = 0, there is not.\n\nFind the number of different directed paths of length K in G, modulo 10^9 + 7.\nWe will also count a path that traverses the same edge multiple times.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 10^{18}\n\na_{i, j} is 0 or 1.\n\na_{i, i} = 0\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_{1, 1} \\ldots a_{1, N}\n:\na_{N, 1} \\ldots a_{N, N}\n\nOutput\n\nPrint the number of different directed paths of length K in G, modulo 10^9 + 7.\n\nSample Input 1\n\n4 2\n0 1 0 0\n0 0 1 1\n0 0 0 1\n1 0 0 0\n\nSample Output 1\n\n6\n\nG is drawn in the figure below:\n\nThere are six directed paths of length 2:\n\n1 → 2 → 3\n\n1 → 2 → 4\n\n2 → 3 → 4\n\n2 → 4 → 1\n\n3 → 4 → 1\n\n4 → 1 → 2\n\nSample Input 2\n\n3 3\n0 1 0\n1 0 1\n0 0 0\n\nSample Output 2\n\n3\n\nG is drawn in the figure below:\n\nThere are three directed paths of length 3:\n\n1 → 2 → 1 → 2\n\n2 → 1 → 2 → 1\n\n2 → 1 → 2 → 3\n\nSample Input 3\n\n6 2\n0 0 0 0 0 0\n0 0 1 0 0 0\n0 0 0 0 0 0\n0 0 0 0 1 0\n0 0 0 0 0 1\n0 0 0 0 0 0\n\nSample Output 3\n\n1\n\nG is drawn in the figure below:\n\nThere is one directed path of length 2:\n\n4 → 5 → 6\n\nSample Input 4\n\n1 1\n0\n\nSample Output 4\n\n0\n\nSample Input 5\n\n10 1000000000000000000\n0 0 1 1 0 0 0 1 1 0\n0 0 0 0 0 1 1 1 0 0\n0 1 0 0 0 1 0 1 0 1\n1 1 1 0 1 1 0 1 1 0\n0 1 1 1 0 1 0 1 1 1\n0 0 0 1 0 0 1 0 1 0\n0 0 0 1 1 0 0 1 0 1\n1 0 0 0 1 0 1 0 0 0\n0 0 0 0 0 1 0 0 0 0\n1 0 1 1 1 0 1 1 1 0\n\nSample Output 5\n\n957538352\n\nBe sure to print the count modulo 10^9 + 7.", "sample_input": "4 2\n0 1 0 0\n0 0 1 1\n0 0 0 1\n1 0 0 0\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03177", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a simple directed graph G with N vertices, numbered 1, 2, \\ldots, N.\n\nFor each i and j (1 \\leq i, j \\leq N), you are given an integer a_{i, j} that represents whether there is a directed edge from Vertex i to j.\nIf a_{i, j} = 1, there is a directed edge from Vertex i to j; if a_{i, j} = 0, there is not.\n\nFind the number of different directed paths of length K in G, modulo 10^9 + 7.\nWe will also count a path that traverses the same edge multiple times.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 50\n\n1 \\leq K \\leq 10^{18}\n\na_{i, j} is 0 or 1.\n\na_{i, i} = 0\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_{1, 1} \\ldots a_{1, N}\n:\na_{N, 1} \\ldots a_{N, N}\n\nOutput\n\nPrint the number of different directed paths of length K in G, modulo 10^9 + 7.\n\nSample Input 1\n\n4 2\n0 1 0 0\n0 0 1 1\n0 0 0 1\n1 0 0 0\n\nSample Output 1\n\n6\n\nG is drawn in the figure below:\n\nThere are six directed paths of length 2:\n\n1 → 2 → 3\n\n1 → 2 → 4\n\n2 → 3 → 4\n\n2 → 4 → 1\n\n3 → 4 → 1\n\n4 → 1 → 2\n\nSample Input 2\n\n3 3\n0 1 0\n1 0 1\n0 0 0\n\nSample Output 2\n\n3\n\nG is drawn in the figure below:\n\nThere are three directed paths of length 3:\n\n1 → 2 → 1 → 2\n\n2 → 1 → 2 → 1\n\n2 → 1 → 2 → 3\n\nSample Input 3\n\n6 2\n0 0 0 0 0 0\n0 0 1 0 0 0\n0 0 0 0 0 0\n0 0 0 0 1 0\n0 0 0 0 0 1\n0 0 0 0 0 0\n\nSample Output 3\n\n1\n\nG is drawn in the figure below:\n\nThere is one directed path of length 2:\n\n4 → 5 → 6\n\nSample Input 4\n\n1 1\n0\n\nSample Output 4\n\n0\n\nSample Input 5\n\n10 1000000000000000000\n0 0 1 1 0 0 0 1 1 0\n0 0 0 0 0 1 1 1 0 0\n0 1 0 0 0 1 0 1 0 1\n1 1 1 0 1 1 0 1 1 0\n0 1 1 1 0 1 0 1 1 1\n0 0 0 1 0 0 1 0 1 0\n0 0 0 1 1 0 0 1 0 1\n1 0 0 0 1 0 1 0 0 0\n0 0 0 0 0 1 0 0 0 0\n1 0 1 1 1 0 1 1 1 0\n\nSample Output 5\n\n957538352\n\nBe sure to print the count modulo 10^9 + 7.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1279, "cpu_time_ms": 71, "memory_kb": 4664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s372586202", "group_id": "codeNet:p03200", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n\nfunc main() {\n\tcount := 0\n\n\tvar str string\n\tfmt.Scanf(\"%s\", &str)\n\tfor {\n\t\tif strings.Contains(str, \"BW\") {\n\t\t\tstr2 := strings.Replace(str, \"BW\", \"WB\", -1)\n\t\t\tfor i := 0; i < len(str2); i++ {\n\t\t\t\tif str[i] != str2[i] {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr = str2\n\t\t\tstr = strings.Replace(str, \"BBB\", \"BB\", -1)\n\t\t\tstr = strings.Replace(str, \"WWW\", \"WW\", -1)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count / 2)\n}", "language": "Go", "metadata": {"date": 1544931995, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03200.html", "problem_id": "p03200", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03200/input.txt", "sample_output_relpath": "derived/input_output/data/p03200/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03200/Go/s372586202.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s372586202", "user_id": "u479759035"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc scanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n\nfunc main() {\n\tcount := 0\n\n\tvar str string\n\tfmt.Scanf(\"%s\", &str)\n\tfor {\n\t\tif strings.Contains(str, \"BW\") {\n\t\t\tstr2 := strings.Replace(str, \"BW\", \"WB\", -1)\n\t\t\tfor i := 0; i < len(str2); i++ {\n\t\t\t\tif str[i] != str2[i] {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr = str2\n\t\t\tstr = strings.Replace(str, \"BBB\", \"BB\", -1)\n\t\t\tstr = strings.Replace(str, \"WWW\", \"WW\", -1)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count / 2)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N Reversi pieces arranged in a row. (A Reversi piece is a disc with a black side and a white side.)\nThe state of each piece is represented by a string S of length N.\nIf S_i=B, the i-th piece from the left is showing black;\nIf S_i=W, the i-th piece from the left is showing white.\n\nConsider performing the following operation:\n\nChoose i (1 \\leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black.\n\nFind the maximum possible number of times this operation can be performed.\n\nConstraints\n\n1 \\leq |S| \\leq 2\\times 10^5\n\nS_i=B or W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum possible number of times the operation can be performed.\n\nSample Input 1\n\nBBW\n\nSample Output 1\n\n2\n\nThe operation can be performed twice, as follows:\n\nFlip the second and third pieces from the left.\n\nFlip the first and second pieces from the left.\n\nSample Input 2\n\nBWBWBW\n\nSample Output 2\n\n6", "sample_input": "BBW\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03200", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N Reversi pieces arranged in a row. (A Reversi piece is a disc with a black side and a white side.)\nThe state of each piece is represented by a string S of length N.\nIf S_i=B, the i-th piece from the left is showing black;\nIf S_i=W, the i-th piece from the left is showing white.\n\nConsider performing the following operation:\n\nChoose i (1 \\leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black.\n\nFind the maximum possible number of times this operation can be performed.\n\nConstraints\n\n1 \\leq |S| \\leq 2\\times 10^5\n\nS_i=B or W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum possible number of times the operation can be performed.\n\nSample Input 1\n\nBBW\n\nSample Output 1\n\n2\n\nThe operation can be performed twice, as follows:\n\nFlip the second and third pieces from the left.\n\nFlip the first and second pieces from the left.\n\nSample Input 2\n\nBWBWBW\n\nSample Output 2\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 779, "cpu_time_ms": 2108, "memory_kb": 9600}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s800874327", "group_id": "codeNet:p03207", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsum, max := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\tsum += tmp\n\t\tif max < tmp {\n\t\t\tmax = tmp\n\t\t}\n\t}\n\tfmt.Println(sum - (max / 2))\n}", "language": "Go", "metadata": {"date": 1555047157, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03207.html", "problem_id": "p03207", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03207/input.txt", "sample_output_relpath": "derived/input_output/data/p03207/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03207/Go/s800874327.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s800874327", "user_id": "u857510905"}, "prompt_components": {"gold_output": "15950\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsum, max := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\tsum += tmp\n\t\tif max < tmp {\n\t\t\tmax = tmp\n\t\t}\n\t}\n\tfmt.Println(sum - (max / 2))\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "sample_input": "3\n4980\n7980\n6980\n"}, "reference_outputs": ["15950\n"], "source_document_id": "p03207", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 228, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s797375395", "group_id": "codeNet:p03207", "input_text": "// B - Christmas Eve Eve\n// https://atcoder.jp/contests/abc115/tasks/abc115_b\n// +build ignore\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, tmp, ans int\n\tfmt.Scan(&n)\n\tp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&p[i])\n\t\tans += p[i]\n\t\tif p[i] > tmp {\n\t\t\ttmp = p[i]\n\t\t}\n\t}\n\tans = ans - (tmp / 2)\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1549881107, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03207.html", "problem_id": "p03207", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03207/input.txt", "sample_output_relpath": "derived/input_output/data/p03207/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03207/Go/s797375395.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s797375395", "user_id": "u078994017"}, "prompt_components": {"gold_output": "15950\n", "input_to_evaluate": "// B - Christmas Eve Eve\n// https://atcoder.jp/contests/abc115/tasks/abc115_b\n// +build ignore\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, tmp, ans int\n\tfmt.Scan(&n)\n\tp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&p[i])\n\t\tans += p[i]\n\t\tif p[i] > tmp {\n\t\t\ttmp = p[i]\n\t\t}\n\t}\n\tans = ans - (tmp / 2)\n\tfmt.Println(ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "sample_input": "3\n4980\n7980\n6980\n"}, "reference_outputs": ["15950\n"], "source_document_id": "p03207", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 338, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s537512947", "group_id": "codeNet:p03207", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tans := 0\n\tmx := 0\n\tfor i := 0; i < n; i++ {\n\t\ttmp := sc.NextInt()\n\t\tans += tmp\n\t\tif mx < tmp {\n\t\t\tmx = tmp\n\t\t}\n\t}\n\tans -= (mx / 2)\n\tfmt.Printf(\"%+v\\n\", ans) // output for debug\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1545000546, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03207.html", "problem_id": "p03207", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03207/input.txt", "sample_output_relpath": "derived/input_output/data/p03207/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03207/Go/s537512947.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s537512947", "user_id": "u084693263"}, "prompt_components": {"gold_output": "15950\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tans := 0\n\tmx := 0\n\tfor i := 0; i < n; i++ {\n\t\ttmp := sc.NextInt()\n\t\tans += tmp\n\t\tif mx < tmp {\n\t\t\tmx = tmp\n\t\t}\n\t}\n\tans -= (mx / 2)\n\tfmt.Printf(\"%+v\\n\", ans) // output for debug\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "sample_input": "3\n4980\n7980\n6980\n"}, "reference_outputs": ["15950\n"], "source_document_id": "p03207", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1773, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s129058366", "group_id": "codeNet:p03208", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\tk := nextInt()\n\n\th := make([]int, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\th = append(h, nextInt())\n\t}\n\n\tIntReverse(h)\n\n\tre := 1000000000\n\tr := k - 1\n\tfor index := 0; r < n; index++ {\n\t\tif h[r]-h[index] < re {\n\t\t\tre = h[r] - h[index]\n\t\t}\n\t\tr += k - 1\n\t}\n\n\tfmt.Println(re)\n}\n\nfunc IntReverse(vv []int) {\n\tsort.Sort(sort.IntSlice(vv))\n}\n", "language": "Go", "metadata": {"date": 1561782697, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03208.html", "problem_id": "p03208", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03208/input.txt", "sample_output_relpath": "derived/input_output/data/p03208/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03208/Go/s129058366.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s129058366", "user_id": "u317845566"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\tk := nextInt()\n\n\th := make([]int, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\th = append(h, nextInt())\n\t}\n\n\tIntReverse(h)\n\n\tre := 1000000000\n\tr := k - 1\n\tfor index := 0; r < n; index++ {\n\t\tif h[r]-h[index] < re {\n\t\t\tre = h[r] - h[index]\n\t\t}\n\t\tr += k - 1\n\t}\n\n\tfmt.Println(re)\n}\n\nfunc IntReverse(vv []int) {\n\tsort.Sort(sort.IntSlice(vv))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "sample_input": "5 3\n10\n15\n11\n14\n12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03208", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 688, "cpu_time_ms": 46, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s603203182", "group_id": "codeNet:p03210", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x int\n fmt.Scan(&x)\n \n if x == 3 || x == 5 || x == 7 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "language": "Go", "metadata": {"date": 1569890665, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03210.html", "problem_id": "p03210", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03210/input.txt", "sample_output_relpath": "derived/input_output/data/p03210/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03210/Go/s603203182.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s603203182", "user_id": "u195309147"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x int\n fmt.Scan(&x)\n \n if x == 3 || x == 5 || x == 7 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 167, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s150469705", "group_id": "codeNet:p03210", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\n\tif x == 3 || x == 5 || x == 7 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "language": "Go", "metadata": {"date": 1545105161, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03210.html", "problem_id": "p03210", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03210/input.txt", "sample_output_relpath": "derived/input_output/data/p03210/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03210/Go/s150469705.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s150469705", "user_id": "u150922405"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\n\tif x == 3 || x == 5 || x == 7 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 156, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s420991010", "group_id": "codeNet:p03210", "input_text": "// Package main provides\n//\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 2 20:57:55 2018\n//\npackage main\n\nimport \"fmt\"\n\nvar x int\n\nfunc main() {\n\tfmt.Scan(&x)\n\tif x == 7 || x == 5 || x == 3 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1543802479, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03210.html", "problem_id": "p03210", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03210/input.txt", "sample_output_relpath": "derived/input_output/data/p03210/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03210/Go/s420991010.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s420991010", "user_id": "u802614675"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "// Package main provides\n//\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 2 20:57:55 2018\n//\npackage main\n\nimport \"fmt\"\n\nvar x int\n\nfunc main() {\n\tfmt.Scan(&x)\n\tif x == 7 || x == 5 || x == 3 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 265, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s275148643", "group_id": "codeNet:p03211", "input_text": "package main\n\nimport(\n \"fmt\"\n \"sort\"\n \"strings\"\n \"strconv\"\n)\n\n\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans := 10000\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i 0 {\n\t\tss := strings.Join(s, \"\")\n\t\tsInt, _ := strconv.Atoi(ss)\n\t\tif sInt > n {\n\t\t\treturn ret\n\t\t} else {\n\t\t\tok := true\n\t\t\tfor _, v := range list {\n\t\t\t\tif !strings.Contains(ss, v) {\n\t\t\t\t\tok = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tret++\n\t\t\t}\n\t\t}\n\t}\n\tfor _, v := range list {\n\t\ts = append(s, v)\n\t\tret += dfs(s)\n\t\ts = s[:len(s)-1]\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn = io.readInt()\n\tvar s []string\n\tio.println(dfs(s))\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) readStringLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) readString() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.readStringLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) readInt() int {\n\ti, err := strconv.Atoi(io.readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) printStringSlice(a []string) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc (io *Io) printIntSlice(a []int) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593484426, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03212.html", "problem_id": "p03212", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03212/input.txt", "sample_output_relpath": "derived/input_output/data/p03212/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03212/Go/s405376024.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s405376024", "user_id": "u323255029"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tn int\n\tlist = []string{\"3\", \"5\", \"7\"}\n)\n\nfunc dfs(s []string) int {\n\tret := 0\n\tif len(s) > 0 {\n\t\tss := strings.Join(s, \"\")\n\t\tsInt, _ := strconv.Atoi(ss)\n\t\tif sInt > n {\n\t\t\treturn ret\n\t\t} else {\n\t\t\tok := true\n\t\t\tfor _, v := range list {\n\t\t\t\tif !strings.Contains(ss, v) {\n\t\t\t\t\tok = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tret++\n\t\t\t}\n\t\t}\n\t}\n\tfor _, v := range list {\n\t\ts = append(s, v)\n\t\tret += dfs(s)\n\t\ts = s[:len(s)-1]\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn = io.readInt()\n\tvar s []string\n\tio.println(dfs(s))\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) readStringLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) readString() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.readStringLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) readInt() int {\n\ti, err := strconv.Atoi(io.readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) printStringSlice(a []string) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc (io *Io) printIntSlice(a []int) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "sample_input": "575\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03212", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2051, "cpu_time_ms": 32, "memory_kb": 4876}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s823050666", "group_id": "codeNet:p03212", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tfmt.Println(f(N, \"\", true, true, true))\n}\n\nfunc f(N int, s string, r7, r5, r3 bool) int {\n\tn, _ := strconv.Atoi(s)\n\tif n > N {\n\t\treturn 0\n\t}\n\tret := 0\n\tif !r7 && !r5 && !r3 {\n\t\tret++\n\t}\n\tret += f(N, s+\"7\", false, r5, r3)\n\tret += f(N, s+\"5\", r7, false, r3)\n\tret += f(N, s+\"3\", r7, r5, false)\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1593050302, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03212.html", "problem_id": "p03212", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03212/input.txt", "sample_output_relpath": "derived/input_output/data/p03212/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03212/Go/s823050666.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s823050666", "user_id": "u328656362"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tfmt.Println(f(N, \"\", true, true, true))\n}\n\nfunc f(N int, s string, r7, r5, r3 bool) int {\n\tn, _ := strconv.Atoi(s)\n\tif n > N {\n\t\treturn 0\n\t}\n\tret := 0\n\tif !r7 && !r5 && !r3 {\n\t\tret++\n\t}\n\tret += f(N, s+\"7\", false, r5, r3)\n\tret += f(N, s+\"5\", r7, false, r3)\n\tret += f(N, s+\"3\", r7, r5, false)\n\treturn ret\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "sample_input": "575\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03212", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 389, "cpu_time_ms": 19, "memory_kb": 3108}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s707544945", "group_id": "codeNet:p03212", "input_text": "package main\n\nimport \"fmt\"\n\nfunc order(n int) int {\n\tcount := 1\n\tfor {\n\t\tif n/10 >= 1 {\n\t\t\tn /= 10\n\t\t\tcount++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn count\n}\nfunc is(rep []int, n int) bool {\n\tfor i := 0; i < len(rep); i++ {\n\t\tif rep[i] == n {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\nfunc solve(n int) bool {\n\torder := order(n)\n\tvar rep []int\n\tfor i := 1; i <= order; i++ {\n\t\tif n%10 == 3 || n%10 == 5 || n%10 == 7 {\n\t\t\trep = append(rep, n%10)\n\t\t\tn /= 10\n\t\t\tif i == order {\n\t\t\t\tif is(rep, 3) && is(rep, 5) && is(rep, 7) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\treturn false\n}\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tcount := 0\n\tfor i := 357; i <= n; i++ {\n\t\tif solve(i) {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1549242904, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03212.html", "problem_id": "p03212", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03212/input.txt", "sample_output_relpath": "derived/input_output/data/p03212/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03212/Go/s707544945.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s707544945", "user_id": "u370270364"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc order(n int) int {\n\tcount := 1\n\tfor {\n\t\tif n/10 >= 1 {\n\t\t\tn /= 10\n\t\t\tcount++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn count\n}\nfunc is(rep []int, n int) bool {\n\tfor i := 0; i < len(rep); i++ {\n\t\tif rep[i] == n {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\nfunc solve(n int) bool {\n\torder := order(n)\n\tvar rep []int\n\tfor i := 1; i <= order; i++ {\n\t\tif n%10 == 3 || n%10 == 5 || n%10 == 7 {\n\t\t\trep = append(rep, n%10)\n\t\t\tn /= 10\n\t\t\tif i == order {\n\t\t\t\tif is(rep, 3) && is(rep, 5) && is(rep, 7) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\treturn false\n}\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tcount := 0\n\tfor i := 357; i <= n; i++ {\n\t\tif solve(i) {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "sample_input": "575\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03212", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\n\nHere, a Shichi-Go-San number is a positive integer that satisfies the following condition:\n\nWhen the number is written in base ten, each of the digits 7, 5 and 3 appears at least once, and the other digits never appear.\n\nConstraints\n\n1 \\leq N < 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go-San numbers between 1 and N (inclusive).\n\nSample Input 1\n\n575\n\nSample Output 1\n\n4\n\nThere are four Shichi-Go-San numbers not greater than 575: 357, 375, 537 and 573.\n\nSample Input 2\n\n3600\n\nSample Output 2\n\n13\n\nThere are 13 Shichi-Go-San numbers not greater than 3600: the above four numbers, 735, 753, 3357, 3375, 3537, 3557, 3573, 3575 and 3577.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n26484", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 711, "cpu_time_ms": 2112, "memory_kb": 7684}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s076036480", "group_id": "codeNet:p03213", "input_text": "package main\n\n/*\n\t予め片方の一端を引いたぶんでかんがえればいいね\n\t(X-Z) // ((Y+Z)\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code ---*/\n\tx, y, z := nextInt(), nextInt(), nextInt()\n\tfmt.Fprint(out, (x-z)/(y+z))\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581216295, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03213.html", "problem_id": "p03213", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03213/input.txt", "sample_output_relpath": "derived/input_output/data/p03213/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03213/Go/s076036480.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s076036480", "user_id": "u445624660"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\n/*\n\t予め片方の一端を引いたぶんでかんがえればいいね\n\t(X-Z) // ((Y+Z)\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code ---*/\n\tx, y, z := nextInt(), nextInt(), nextInt()\n\tfmt.Fprint(out, (x-z)/(y+z))\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "sample_input": "9\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03213", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1381, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s909484069", "group_id": "codeNet:p03213", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tp := make([]int, 0, 0)\n\n\tfor i := 2; i <= n; i++ {\n\t\ttmp := true\n\t\tfor j := 2; j * j <= i; j++ {\n\t\t\tif i % j == 0 {\n\t\t\t\ttmp = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif tmp {\n\t\t\tp = append(p, i)\n\t\t}\n\t}\n\n\tl := len(p)\n\ta := make([]int, l, l)\n\n\tfor i := 0; i < l; i++ {\n\t\tc := 0\n\t\tfor d := p[i]; d < n; d *= p[i] {\n\t\t\tc += n / d\n\t\t}\n\t\ta[i] = c\n\t}\n\n\tanswer := 0\n\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] >= 75 - 1 {\n\t\t\tanswer++\n\t\t}\n\t}\n\n\tfor i := 0; i < l; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif (i == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[i] >= 3 - 1 && a[j] >= 25 - 1 {\n\t\t\t\tanswer++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < l; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif (i == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[i] >= 5 - 1 && a[j] >= 15 - 1 {\n\t\t\t\tanswer++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < l; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tfor k := j + 1; k < l; k++ {\n\t\t\t\tif (i == j || i == k) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif a[i] >= 3 - 1 && a[j] >= 5 - 1 && a[k] >= 5 - 1 {\n\t\t\t\t\tanswer++\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(answer)\n}", "language": "Go", "metadata": {"date": 1581199795, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03213.html", "problem_id": "p03213", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03213/input.txt", "sample_output_relpath": "derived/input_output/data/p03213/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03213/Go/s909484069.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909484069", "user_id": "u253759478"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tp := make([]int, 0, 0)\n\n\tfor i := 2; i <= n; i++ {\n\t\ttmp := true\n\t\tfor j := 2; j * j <= i; j++ {\n\t\t\tif i % j == 0 {\n\t\t\t\ttmp = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif tmp {\n\t\t\tp = append(p, i)\n\t\t}\n\t}\n\n\tl := len(p)\n\ta := make([]int, l, l)\n\n\tfor i := 0; i < l; i++ {\n\t\tc := 0\n\t\tfor d := p[i]; d < n; d *= p[i] {\n\t\t\tc += n / d\n\t\t}\n\t\ta[i] = c\n\t}\n\n\tanswer := 0\n\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] >= 75 - 1 {\n\t\t\tanswer++\n\t\t}\n\t}\n\n\tfor i := 0; i < l; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif (i == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[i] >= 3 - 1 && a[j] >= 25 - 1 {\n\t\t\t\tanswer++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < l; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif (i == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[i] >= 5 - 1 && a[j] >= 15 - 1 {\n\t\t\t\tanswer++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < l; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tfor k := j + 1; k < l; k++ {\n\t\t\t\tif (i == j || i == k) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif a[i] >= 3 - 1 && a[j] >= 5 - 1 && a[k] >= 5 - 1 {\n\t\t\t\t\tanswer++\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(answer)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "sample_input": "9\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03213", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1037, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s388394105", "group_id": "codeNet:p03215", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var N, K int\n fmt.Scan(&N, &K)\n A := make([]int, N)\n var x int\n for i := 0; i < N; i++ {\n fmt.Scan(&x)\n A[i] = x\n }\n B := make([]int, N + 1)\n for i := 0; i < N; i++ {\n B[i + 1] = B[i] + A[i]\n }\n M := make([][]int, N * (N + 1) / 2)\n S := make([]int, 40)\n pos := 0\n var alr, b int\n for r := 1; r < N + 1; r++ {\n for l := 0; l < r; l++ {\n alr = B[r] - B[l]\n M[pos] = make([]int, 40)\n for j := 39; j >= 0; j-- {\n b = alr % 2\n M[pos][j] = b\n S[j] += b\n alr /= 2\n }\n pos += 1\n }\n }\n cnt := 0\n for i := 0; i < 40; i++ {\n if S[i] < K {\n continue\n }\n cnt += int(1 << uint(39 - i))\n for j := 0; j < pos; j++ {\n if M[j][i] > 0 {\n continue\n }\n for k := i; k < 40; k++ {\n if M[j][k] == 0 {\n continue\n }\n M[j][k] = 0\n S[k] -= 1\n }\n }\n }\n fmt.Println(cnt)\n}", "language": "Go", "metadata": {"date": 1568682492, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03215.html", "problem_id": "p03215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03215/input.txt", "sample_output_relpath": "derived/input_output/data/p03215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03215/Go/s388394105.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s388394105", "user_id": "u415905784"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var N, K int\n fmt.Scan(&N, &K)\n A := make([]int, N)\n var x int\n for i := 0; i < N; i++ {\n fmt.Scan(&x)\n A[i] = x\n }\n B := make([]int, N + 1)\n for i := 0; i < N; i++ {\n B[i + 1] = B[i] + A[i]\n }\n M := make([][]int, N * (N + 1) / 2)\n S := make([]int, 40)\n pos := 0\n var alr, b int\n for r := 1; r < N + 1; r++ {\n for l := 0; l < r; l++ {\n alr = B[r] - B[l]\n M[pos] = make([]int, 40)\n for j := 39; j >= 0; j-- {\n b = alr % 2\n M[pos][j] = b\n S[j] += b\n alr /= 2\n }\n pos += 1\n }\n }\n cnt := 0\n for i := 0; i < 40; i++ {\n if S[i] < K {\n continue\n }\n cnt += int(1 << uint(39 - i))\n for j := 0; j < pos; j++ {\n if M[j][i] > 0 {\n continue\n }\n for k := i; k < 40; k++ {\n if M[j][k] == 0 {\n continue\n }\n M[j][k] = 0\n S[k] -= 1\n }\n }\n }\n fmt.Println(cnt)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input are integers\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "sample_input": "4 2\n2 5 2 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03215", "source_text": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input are integers\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 962, "cpu_time_ms": 753, "memory_kb": 180720}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s437742769", "group_id": "codeNet:p03215", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n\n/*\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n*/\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar n, k int\nvar A []int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn, k = tmp[0], tmp[1]\n\tA = NextIntsLine()\n\n\tbeauties := make([]int, 500505)\n\n\t// 累積和を計算\n\tsums := [1010]int{}\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += A[i]\n\t\tsums[i] = sum\n\t}\n\n\t// すべての部分列の美しさを計算\n\tbidx := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i; j < n; j++ {\n\t\t\tbeauty := 0\n\t\t\tif i == j {\n\t\t\t\tbeauty = A[i]\n\t\t\t} else {\n\t\t\t\tif i == 0 {\n\t\t\t\t\tbeauty = sums[j]\n\t\t\t\t} else {\n\t\t\t\t\tbeauty = sums[j] - sums[i-1]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbeauties[bidx] = beauty\n\t\t\tbidx++\n\t\t}\n\t}\n\n\t// beautiesのすべての桁について1の数がk未満の桁をすべて0に置換する\n\tbitNumbers := [64]int{}\n\tfor _, b := range beauties {\n\t\tfor i := 0; i < 60; i++ {\n\t\t\tshifted := b >> uint(i)\n\t\t\tbit := shifted & 1\n\t\t\tif bit == 1 {\n\t\t\t\tbitNumbers[i]++\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < len(beauties); i++ {\n\t\tfor j := 0; j < 60; j++ {\n\t\t\tif bitNumbers[j] < k {\n\t\t\t\tnum := beauties[i]\n\t\t\t\tbit := (num >> uint(j)) & 1\n\t\t\t\tif bit == 1 {\n\t\t\t\t\tbeauties[i] -= PowInt(2, j)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 降順ソート\n\tsort.Sort(sort.Reverse(sort.IntSlice(beauties)))\n\n\t//\tfor i := 0; i < n*(n+1)/2; i++ {\n\t//\t\tfmt.Println(beauties[i])\n\t//\t}\n\n\t// 先頭k個の美しさのビット論理積が答え\n\tans := beauties[0]\n\tfor i := 1; i < k; i++ {\n\t\tans &= beauties[i]\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1543113842, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03215.html", "problem_id": "p03215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03215/input.txt", "sample_output_relpath": "derived/input_output/data/p03215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03215/Go/s437742769.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s437742769", "user_id": "u103600314"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n\n/*\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n*/\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar n, k int\nvar A []int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn, k = tmp[0], tmp[1]\n\tA = NextIntsLine()\n\n\tbeauties := make([]int, 500505)\n\n\t// 累積和を計算\n\tsums := [1010]int{}\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += A[i]\n\t\tsums[i] = sum\n\t}\n\n\t// すべての部分列の美しさを計算\n\tbidx := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i; j < n; j++ {\n\t\t\tbeauty := 0\n\t\t\tif i == j {\n\t\t\t\tbeauty = A[i]\n\t\t\t} else {\n\t\t\t\tif i == 0 {\n\t\t\t\t\tbeauty = sums[j]\n\t\t\t\t} else {\n\t\t\t\t\tbeauty = sums[j] - sums[i-1]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbeauties[bidx] = beauty\n\t\t\tbidx++\n\t\t}\n\t}\n\n\t// beautiesのすべての桁について1の数がk未満の桁をすべて0に置換する\n\tbitNumbers := [64]int{}\n\tfor _, b := range beauties {\n\t\tfor i := 0; i < 60; i++ {\n\t\t\tshifted := b >> uint(i)\n\t\t\tbit := shifted & 1\n\t\t\tif bit == 1 {\n\t\t\t\tbitNumbers[i]++\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < len(beauties); i++ {\n\t\tfor j := 0; j < 60; j++ {\n\t\t\tif bitNumbers[j] < k {\n\t\t\t\tnum := beauties[i]\n\t\t\t\tbit := (num >> uint(j)) & 1\n\t\t\t\tif bit == 1 {\n\t\t\t\t\tbeauties[i] -= PowInt(2, j)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 降順ソート\n\tsort.Sort(sort.Reverse(sort.IntSlice(beauties)))\n\n\t//\tfor i := 0; i < n*(n+1)/2; i++ {\n\t//\t\tfmt.Println(beauties[i])\n\t//\t}\n\n\t// 先頭k個の美しさのビット論理積が答え\n\tans := beauties[0]\n\tfor i := 1; i < k; i++ {\n\t\tans &= beauties[i]\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input are integers\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "sample_input": "4 2\n2 5 2 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03215", "source_text": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input are integers\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5886, "cpu_time_ms": 455, "memory_kb": 6272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s069365316", "group_id": "codeNet:p03219", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar X,Y int\n\tfmt.Scan(&X,&Y)\n\t\n\tfmt.Println(X + Y / 2)\n}", "language": "Go", "metadata": {"date": 1575244723, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03219.html", "problem_id": "p03219", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03219/input.txt", "sample_output_relpath": "derived/input_output/data/p03219/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03219/Go/s069365316.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s069365316", "user_id": "u689167014"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar X,Y int\n\tfmt.Scan(&X,&Y)\n\t\n\tfmt.Println(X + Y / 2)\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "sample_input": "81 58\n"}, "reference_outputs": ["110\n"], "source_document_id": "p03219", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 104, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s357862142", "group_id": "codeNet:p03219", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\tfmt.Println(x + (y / 2))\n}\n", "language": "Go", "metadata": {"date": 1551641175, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03219.html", "problem_id": "p03219", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03219/input.txt", "sample_output_relpath": "derived/input_output/data/p03219/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03219/Go/s357862142.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s357862142", "user_id": "u375977529"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\tfmt.Println(x + (y / 2))\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "sample_input": "81 58\n"}, "reference_outputs": ["110\n"], "source_document_id": "p03219", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 107, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s605463908", "group_id": "codeNet:p03221", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\t_ = scanInt()\n\tm := scanInt()\n\n\tps := make(pairs, m)\n\tfor i := 0; i < m; i++ {\n\t\tp := scanString()\n\t\ty := scanInt()\n\t\tp = strings.Repeat(\"0\", 6-len(p)) + p\n\t\tps[i] = pair{p, y, i}\n\t}\n\tsort.Sort(ps)\n\tpre := \"#\"\n\tx := 1\n\tans := make([]string, m)\n\tfor i := 0; i < m; i++ {\n\t\tif pre != ps[i].p {\n\t\t\tx = 1\n\t\t}\n\t\tt := strconv.Itoa(x)\n\t\tt = strings.Repeat(\"0\", 6-len(t)) + t\n\t\tans[ps[i].num] = ps[i].p + t\n\t\tx++\n\t\tpre = ps[i].p\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fprintln(wr, ans[i])\n\t}\n}\n\ntype pair struct {\n\tp string\n\ty, num int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int { return len(a) }\nfunc (a pairs) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a pairs) Less(i, j int) bool {\n\tif a[i].p == a[j].p {\n\t\treturn a[i].y < a[j].y\n\t}\n\treturn a[i].p < a[j].p\n}\n", "language": "Go", "metadata": {"date": 1588645310, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/Go/s605463908.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s605463908", "user_id": "u548992197"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\t_ = scanInt()\n\tm := scanInt()\n\n\tps := make(pairs, m)\n\tfor i := 0; i < m; i++ {\n\t\tp := scanString()\n\t\ty := scanInt()\n\t\tp = strings.Repeat(\"0\", 6-len(p)) + p\n\t\tps[i] = pair{p, y, i}\n\t}\n\tsort.Sort(ps)\n\tpre := \"#\"\n\tx := 1\n\tans := make([]string, m)\n\tfor i := 0; i < m; i++ {\n\t\tif pre != ps[i].p {\n\t\t\tx = 1\n\t\t}\n\t\tt := strconv.Itoa(x)\n\t\tt = strings.Repeat(\"0\", 6-len(t)) + t\n\t\tans[ps[i].num] = ps[i].p + t\n\t\tx++\n\t\tpre = ps[i].p\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fprintln(wr, ans[i])\n\t}\n}\n\ntype pair struct {\n\tp string\n\ty, num int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int { return len(a) }\nfunc (a pairs) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a pairs) Less(i, j int) bool {\n\tif a[i].p == a[j].p {\n\t\treturn a[i].y < a[j].y\n\t}\n\treturn a[i].p < a[j].p\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1830, "cpu_time_ms": 199, "memory_kb": 12800}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s918368438", "group_id": "codeNet:p03221", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t_, _ = strconv.Atoi(stringLineScan())\n\tm, _ := strconv.Atoi(stringLineScan())\n\tpy := make([][]int, m)\n\tx := map[int][]int{}\n\tfor i := 0; i < m; i++ {\n\t\tt := make([]int, 2)\n\t\tt[0], _ = strconv.Atoi(stringLineScan())\n\t\tt[1], _ = strconv.Atoi(stringLineScan())\n\t\tpy[i] = t\n\t\tif val, ok := x[t[0]]; ok {\n\t\t\tx[t[0]] = append(val, t[1])\n\t\t} else {\n\t\t\tu := make([]int, 1)\n\t\t\tu[0] = t[1]\n\t\t\tx[t[0]] = u\n\t\t}\n\t}\n\tfor k, _ := range x {\n\t\tsort.Ints(x[k])\n\t}\n\ty := map[string]string{}\n\tfor k, v := range x {\n\t\tfor i, w := range v {\n\t\t\tq := make([]int, 2)\n\t\t\tq[0], q[1] = k, w\n\t\t\ty[fmt.Sprint(q)] = fmt.Sprintf(\"%06d\", k) + fmt.Sprintf(\"%06d\", i+1)\n\t\t}\n\t}\n\tfor _, b := range py {\n\t\tfmt.Println(y[fmt.Sprint(b)])\n\t}\n}", "language": "Go", "metadata": {"date": 1581879519, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/Go/s918368438.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s918368438", "user_id": "u843722521"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t_, _ = strconv.Atoi(stringLineScan())\n\tm, _ := strconv.Atoi(stringLineScan())\n\tpy := make([][]int, m)\n\tx := map[int][]int{}\n\tfor i := 0; i < m; i++ {\n\t\tt := make([]int, 2)\n\t\tt[0], _ = strconv.Atoi(stringLineScan())\n\t\tt[1], _ = strconv.Atoi(stringLineScan())\n\t\tpy[i] = t\n\t\tif val, ok := x[t[0]]; ok {\n\t\t\tx[t[0]] = append(val, t[1])\n\t\t} else {\n\t\t\tu := make([]int, 1)\n\t\t\tu[0] = t[1]\n\t\t\tx[t[0]] = u\n\t\t}\n\t}\n\tfor k, _ := range x {\n\t\tsort.Ints(x[k])\n\t}\n\ty := map[string]string{}\n\tfor k, v := range x {\n\t\tfor i, w := range v {\n\t\t\tq := make([]int, 2)\n\t\t\tq[0], q[1] = k, w\n\t\t\ty[fmt.Sprint(q)] = fmt.Sprintf(\"%06d\", k) + fmt.Sprintf(\"%06d\", i+1)\n\t\t}\n\t}\n\tfor _, b := range py {\n\t\tfmt.Println(y[fmt.Sprint(b)])\n\t}\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 911, "cpu_time_ms": 768, "memory_kb": 35328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s382773857", "group_id": "codeNet:p03221", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tids := make(Ids, m)\n\tnum := make([]int, n)\n\tdict := map[Id]int{}\n\tfor i := range ids {\n\t\tfmt.Scan(&ids[i].p, &ids[i].y)\n\t\ta := &Id{ids[i].p, ids[i].y}\n\t\tdict[*a] = 0\n\t}\n\tids2 := make(Ids, m)\n\tcopy(ids2, ids)\n\tsort.Sort(ids)\n\n\tfor i:=0;i= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1549231812, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/Go/s089727526.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s089727526", "user_id": "u084693263"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\t_ = sc.NextInt()\n\tm := sc.NextInt()\n\n\tmp := map[int][]int{}\n\n\tplist := []int{}\n\tylist := []int{}\n\n\tfor i := 0; i < m; i++ {\n\t\tp := sc.NextInt()\n\t\ty := sc.NextInt()\n\t\tplist = append(plist, p)\n\t\tylist = append(ylist, y)\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tmp[plist[i]] = append(mp[plist[i]], ylist[i])\n\t}\n\n\tfor _, v := range mp {\n\t\tsort.Ints(v)\n\t}\n\n\tamp := map[string]string{}\n\n\tfor k, v := range mp {\n\t\tfor i := 0; i < len(v); i++ {\n\t\t\tamp[fmt.Sprintf(\"%s%s\", k, v[i])] = fmt.Sprintf(\"%06d%06d\", k, i+1)\n\n\t\t}\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Printf(\"%+v\\n\", amp[fmt.Sprintf(\"%s%s\", plist[i], ylist[i])])\n\t}\n\n\t// fmt.Printf(\"%06d%06d\\n\", plist[i], j+1)\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2232, "cpu_time_ms": 624, "memory_kb": 29696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s330601806", "group_id": "codeNet:p03222", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst mod = 1000000007\n\nfunc main() {\n\tvar H, W, K int\n\tfmt.Scanf(\"%d%d%d\", &H, &W, &K)\n\tdp := make([][]int, H+1)\n\tfor i := 0; i <= H; i++ {\n\t\tdp[i] = make([]int, W+1)\n\t}\n\tcp := make([]int, W+1)\n\tcp[0] = 1\n\tcp[1] = 1\n\tfor i := 2; i <= W; i++ {\n\t\tcp[i] = cp[i-1] + cp[i-2]\n\t}\n\tdp[0][1] = 1\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 1; j <= W; j++ {\n\t\t\tif j >= 2 {\n\t\t\t\tdp[i+1][j-1] += dp[i][j] * cp[j-2] % mod * cp[W-j] % mod\n\t\t\t\tdp[i+1][j-1] %= mod\n\t\t\t}\n\t\t\tdp[i+1][j] += dp[i][j] * cp[j-1] % mod * cp[W-j] % mod\n\t\t\tdp[i+1][j] %= mod\n\t\t\tif j <= W-1 {\n\t\t\t\tdp[i+1][j+1] += dp[i][j] * cp[j-1] % mod * cp[W-j-1] % mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", dp[H][K])\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1541462549, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03222.html", "problem_id": "p03222", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03222/input.txt", "sample_output_relpath": "derived/input_output/data/p03222/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03222/Go/s330601806.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s330601806", "user_id": "u014272610"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst mod = 1000000007\n\nfunc main() {\n\tvar H, W, K int\n\tfmt.Scanf(\"%d%d%d\", &H, &W, &K)\n\tdp := make([][]int, H+1)\n\tfor i := 0; i <= H; i++ {\n\t\tdp[i] = make([]int, W+1)\n\t}\n\tcp := make([]int, W+1)\n\tcp[0] = 1\n\tcp[1] = 1\n\tfor i := 2; i <= W; i++ {\n\t\tcp[i] = cp[i-1] + cp[i-2]\n\t}\n\tdp[0][1] = 1\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 1; j <= W; j++ {\n\t\t\tif j >= 2 {\n\t\t\t\tdp[i+1][j-1] += dp[i][j] * cp[j-2] % mod * cp[W-j] % mod\n\t\t\t\tdp[i+1][j-1] %= mod\n\t\t\t}\n\t\t\tdp[i+1][j] += dp[i][j] * cp[j-1] % mod * cp[W-j] % mod\n\t\t\tdp[i+1][j] %= mod\n\t\t\tif j <= W-1 {\n\t\t\t\tdp[i+1][j+1] += dp[i][j] * cp[j-1] % mod * cp[W-j-1] % mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", dp[H][K])\n\treturn\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nAmidakuji is a traditional method of lottery in Japan.\n\nTo make an amidakuji, we first draw W parallel vertical lines, and then draw horizontal lines that connect them. The length of each vertical line is H+1 [cm], and the endpoints of the horizontal lines must be at 1, 2, 3, ..., or H [cm] from the top of a vertical line.\n\nA valid amidakuji is an amidakuji that satisfies the following conditions:\n\nNo two horizontal lines share an endpoint.\n\nThe two endpoints of each horizontal lines must be at the same height.\n\nA horizontal line must connect adjacent vertical lines.\n\nFind the number of the valid amidakuji that satisfy the following condition, modulo 1\\ 000\\ 000\\ 007: if we trace the path from the top of the leftmost vertical line to the bottom, always following horizontal lines when we encounter them, we reach the bottom of the K-th vertical line from the left.\n\nFor example, in the following amidakuji, we will reach the bottom of the fourth vertical line from the left.\n\nConstraints\n\nH is an integer between 1 and 100 (inclusive).\n\nW is an integer between 1 and 8 (inclusive).\n\nK is an integer between 1 and W (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\n\nOutput\n\nPrint the number of the amidakuji that satisfy the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\n1\n\nOnly the following one amidakuji satisfies the condition:\n\nSample Input 2\n\n1 3 1\n\nSample Output 2\n\n2\n\nOnly the following two amidakuji satisfy the condition:\n\nSample Input 3\n\n2 3 3\n\nSample Output 3\n\n1\n\nOnly the following one amidakuji satisfies the condition:\n\nSample Input 4\n\n2 3 1\n\nSample Output 4\n\n5\n\nOnly the following five amidakuji satisfy the condition:\n\nSample Input 5\n\n7 1 1\n\nSample Output 5\n\n1\n\nAs there is only one vertical line, we cannot draw any horizontal lines. Thus, there is only one amidakuji that satisfies the condition: the amidakuji with no horizontal lines.\n\nSample Input 6\n\n15 8 5\n\nSample Output 6\n\n437760187\n\nBe sure to print the answer modulo 1\\ 000\\ 000\\ 007.", "sample_input": "1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03222", "source_text": "Score: 400 points\n\nProblem Statement\n\nAmidakuji is a traditional method of lottery in Japan.\n\nTo make an amidakuji, we first draw W parallel vertical lines, and then draw horizontal lines that connect them. The length of each vertical line is H+1 [cm], and the endpoints of the horizontal lines must be at 1, 2, 3, ..., or H [cm] from the top of a vertical line.\n\nA valid amidakuji is an amidakuji that satisfies the following conditions:\n\nNo two horizontal lines share an endpoint.\n\nThe two endpoints of each horizontal lines must be at the same height.\n\nA horizontal line must connect adjacent vertical lines.\n\nFind the number of the valid amidakuji that satisfy the following condition, modulo 1\\ 000\\ 000\\ 007: if we trace the path from the top of the leftmost vertical line to the bottom, always following horizontal lines when we encounter them, we reach the bottom of the K-th vertical line from the left.\n\nFor example, in the following amidakuji, we will reach the bottom of the fourth vertical line from the left.\n\nConstraints\n\nH is an integer between 1 and 100 (inclusive).\n\nW is an integer between 1 and 8 (inclusive).\n\nK is an integer between 1 and W (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W K\n\nOutput\n\nPrint the number of the amidakuji that satisfy the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\n1\n\nOnly the following one amidakuji satisfies the condition:\n\nSample Input 2\n\n1 3 1\n\nSample Output 2\n\n2\n\nOnly the following two amidakuji satisfy the condition:\n\nSample Input 3\n\n2 3 3\n\nSample Output 3\n\n1\n\nOnly the following one amidakuji satisfies the condition:\n\nSample Input 4\n\n2 3 1\n\nSample Output 4\n\n5\n\nOnly the following five amidakuji satisfy the condition:\n\nSample Input 5\n\n7 1 1\n\nSample Output 5\n\n1\n\nAs there is only one vertical line, we cannot draw any horizontal lines. Thus, there is only one amidakuji that satisfies the condition: the amidakuji with no horizontal lines.\n\nSample Input 6\n\n15 8 5\n\nSample Output 6\n\n437760187\n\nBe sure to print the answer modulo 1\\ 000\\ 000\\ 007.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 692, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s901721600", "group_id": "codeNet:p03223", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tn := nextInt()\n\ta := nextInts(n)\n\tsort.Ints(a)\n\tb := make([]int, n)\n\tleft := n / 2\n\tif n%2 == 0 {\n\t\tleft--\n\t} else {\n\t\tb[0] = a[n/2]\n\t}\n\tright := left + 1\n\tfor i := 0; i < n/2; i++ {\n\t\t// log.Println(left, right, i)\n\t\tif i%2 == 0 {\n\t\t\tb[left] = a[i]\n\t\t\tb[right] = a[n-i-1]\n\t\t} else {\n\t\t\tb[left] = a[n-i-1]\n\t\t\tb[right] = a[i]\n\t\t}\n\t\tleft--\n\t\tright++\n\t}\n\t// log.Println(b)\n\trtn := 0\n\tfor i := 1; i < n; i++ {\n\t\trtn += Abs(b[i] - b[i-1])\n\t}\n\t// rtn := 0\n\t// left := 0\n\t// for i := n - 1; i > n/2; i-- {\n\t// \tlog.Println(left, i, rtn)\n\t// \tif Abs(left-i) > 2 {\n\t// \t\trtn += Abs(a[i] - a[left])\n\t// \t\tif Abs(left+1-i) > 2 {\n\t// \t\t\trtn += Abs(a[i] - a[left+1])\n\t// \t\t}\n\t// \t}\n\t// \tleft++\n\t// }\n\tfmt.Println(rtn)\n}\nfunc Max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc Min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc Sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[j].b\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1540690452, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03223.html", "problem_id": "p03223", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03223/input.txt", "sample_output_relpath": "derived/input_output/data/p03223/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03223/Go/s901721600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s901721600", "user_id": "u696272993"}, "prompt_components": {"gold_output": "21\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tn := nextInt()\n\ta := nextInts(n)\n\tsort.Ints(a)\n\tb := make([]int, n)\n\tleft := n / 2\n\tif n%2 == 0 {\n\t\tleft--\n\t} else {\n\t\tb[0] = a[n/2]\n\t}\n\tright := left + 1\n\tfor i := 0; i < n/2; i++ {\n\t\t// log.Println(left, right, i)\n\t\tif i%2 == 0 {\n\t\t\tb[left] = a[i]\n\t\t\tb[right] = a[n-i-1]\n\t\t} else {\n\t\t\tb[left] = a[n-i-1]\n\t\t\tb[right] = a[i]\n\t\t}\n\t\tleft--\n\t\tright++\n\t}\n\t// log.Println(b)\n\trtn := 0\n\tfor i := 1; i < n; i++ {\n\t\trtn += Abs(b[i] - b[i-1])\n\t}\n\t// rtn := 0\n\t// left := 0\n\t// for i := n - 1; i > n/2; i-- {\n\t// \tlog.Println(left, i, rtn)\n\t// \tif Abs(left-i) > 2 {\n\t// \t\trtn += Abs(a[i] - a[left])\n\t// \t\tif Abs(left+1-i) > 2 {\n\t// \t\t\trtn += Abs(a[i] - a[left+1])\n\t// \t\t}\n\t// \t}\n\t// \tleft++\n\t// }\n\tfmt.Println(rtn)\n}\nfunc Max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc Min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc Sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[j].b\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given N integers; the i-th of them is A_i.\nFind the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum possible sum of the absolute differences between the adjacent elements after arranging the given integers in a row in any order you like.\n\nSample Input 1\n\n5\n6\n8\n1\n2\n3\n\nSample Output 1\n\n21\n\nWhen the integers are arranged as 3,8,1,6,2, the sum of the absolute differences between the adjacent elements is |3 - 8| + |8 - 1| + |1 - 6| + |6 - 2| = 21. This is the maximum possible sum.\n\nSample Input 2\n\n6\n3\n1\n4\n1\n5\n9\n\nSample Output 2\n\n25\n\nSample Input 3\n\n3\n5\n5\n1\n\nSample Output 3\n\n8", "sample_input": "5\n6\n8\n1\n2\n3\n"}, "reference_outputs": ["21\n"], "source_document_id": "p03223", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given N integers; the i-th of them is A_i.\nFind the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum possible sum of the absolute differences between the adjacent elements after arranging the given integers in a row in any order you like.\n\nSample Input 1\n\n5\n6\n8\n1\n2\n3\n\nSample Output 1\n\n21\n\nWhen the integers are arranged as 3,8,1,6,2, the sum of the absolute differences between the adjacent elements is |3 - 8| + |8 - 1| + |1 - 6| + |6 - 2| = 21. This is the maximum possible sum.\n\nSample Input 2\n\n6\n3\n1\n4\n1\n5\n9\n\nSample Output 2\n\n25\n\nSample Input 3\n\n3\n5\n5\n1\n\nSample Output 3\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2078, "cpu_time_ms": 48, "memory_kb": 3712}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s136655607", "group_id": "codeNet:p03228", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b, &k)\n\tfor i := 1; i <= k; i++ {\n\t\tif i%2 == 1 { // T's turn\n\t\t\tif a%2 == 1 {\n\t\t\t\ta = a - 1\n\t\t\t}\n\t\t\tb = b + a/2\n\t\t\ta /= 2\n\t\t} else { // A's turn\n\t\t\tif b%2 == 1 {\n\t\t\t\tb = b - 1\n\t\t\t}\n\t\t\ta = a + b/2\n\t\t\tb /= 2\n\t\t}\n\t}\n\tfmt.Println(a, b)\n}\n", "language": "Go", "metadata": {"date": 1555703067, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03228.html", "problem_id": "p03228", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03228/input.txt", "sample_output_relpath": "derived/input_output/data/p03228/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03228/Go/s136655607.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s136655607", "user_id": "u196030116"}, "prompt_components": {"gold_output": "5 3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b, &k)\n\tfor i := 1; i <= k; i++ {\n\t\tif i%2 == 1 { // T's turn\n\t\t\tif a%2 == 1 {\n\t\t\t\ta = a - 1\n\t\t\t}\n\t\t\tb = b + a/2\n\t\t\ta /= 2\n\t\t} else { // A's turn\n\t\t\tif b%2 == 1 {\n\t\t\t\tb = b - 1\n\t\t\t}\n\t\t\ta = a + b/2\n\t\t\tb /= 2\n\t\t}\n\t}\n\tfmt.Println(a, b)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn the beginning, Takahashi has A cookies, and Aoki has B cookies.\nThey will perform the following operation alternately, starting from Takahashi:\n\nIf the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person.\n\nFind the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.\n\nConstraints\n\n1 \\leq A,B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nA,B and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total.\n\nSample Input 1\n\n5 4 2\n\nSample Output 1\n\n5 3\n\nThe process will go as follows:\n\nIn the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n\nTakahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n\nAoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\nSample Input 2\n\n3 3 3\n\nSample Output 2\n\n1 3\n\nSample Input 3\n\n314159265 358979323 84\n\nSample Output 3\n\n448759046 224379523", "sample_input": "5 4 2\n"}, "reference_outputs": ["5 3\n"], "source_document_id": "p03228", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn the beginning, Takahashi has A cookies, and Aoki has B cookies.\nThey will perform the following operation alternately, starting from Takahashi:\n\nIf the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person.\n\nFind the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.\n\nConstraints\n\n1 \\leq A,B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nA,B and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total.\n\nSample Input 1\n\n5 4 2\n\nSample Output 1\n\n5 3\n\nThe process will go as follows:\n\nIn the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n\nTakahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n\nAoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\nSample Input 2\n\n3 3 3\n\nSample Output 2\n\n1 3\n\nSample Input 3\n\n314159265 358979323 84\n\nSample Output 3\n\n448759046 224379523", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 309, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s854167042", "group_id": "codeNet:p03231", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\n// gcd ...\nfunc gcd(n, m int) int {\n\tif m == 0 {\n\t\treturn n\n\t}\n\treturn gcd(m, n%m)\n}\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tm := sc.NextInt()\n\ts := sc.NextLine()\n\tt := sc.NextLine()\n\n\tg := gcd(n, m)\n\tans := n / g * m\n\n\tn /= g\n\tm /= g\n\tfor i := 0; i < g; i++ {\n\t\tif string(s[i*n]) != string(t[i*m]) {\n\t\t\tfmt.Printf(\"-1\\n\") // output for debug\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", ans)\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1549213328, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03231.html", "problem_id": "p03231", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03231/input.txt", "sample_output_relpath": "derived/input_output/data/p03231/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03231/Go/s854167042.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s854167042", "user_id": "u084693263"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\n// gcd ...\nfunc gcd(n, m int) int {\n\tif m == 0 {\n\t\treturn n\n\t}\n\treturn gcd(m, n%m)\n}\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tm := sc.NextInt()\n\ts := sc.NextLine()\n\tt := sc.NextLine()\n\n\tg := gcd(n, m)\n\tans := n / g * m\n\n\tn /= g\n\tm /= g\n\tfor i := 0; i < g; i++ {\n\t\tif string(s[i*n]) != string(t[i*m]) {\n\t\t\tfmt.Printf(\"-1\\n\") // output for debug\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", ans)\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N and another string T of length M.\nThese strings consist of lowercase English letters.\n\nA string X is called a good string when the following conditions are all met:\n\nLet L be the length of X. L is divisible by both N and M.\n\nConcatenating the 1-st, (\\frac{L}{N}+1)-th, (2 \\times \\frac{L}{N}+1)-th, ..., ((N-1)\\times\\frac{L}{N}+1)-th characters of X, without changing the order, results in S.\n\nConcatenating the 1-st, (\\frac{L}{M}+1)-th, (2 \\times \\frac{L}{M}+1)-th, ..., ((M-1)\\times\\frac{L}{M}+1)-th characters of X, without changing the order, results in T.\n\nDetermine if there exists a good string. If it exists, find the length of the shortest such string.\n\nConstraints\n\n1 \\leq N,M \\leq 10^5\n\nS and T consist of lowercase English letters.\n\n|S|=N\n\n|T|=M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\nT\n\nOutput\n\nIf a good string does not exist, print -1; if it exists, print the length of the shortest such string.\n\nSample Input 1\n\n3 2\nacp\nae\n\nSample Output 1\n\n6\n\nFor example, the string accept is a good string.\nThere is no good string shorter than this, so the answer is 6.\n\nSample Input 2\n\n6 3\nabcdef\nabc\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n15 9\ndnsusrayukuaiia\ndujrunuma\n\nSample Output 3\n\n45", "sample_input": "3 2\nacp\nae\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03231", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S of length N and another string T of length M.\nThese strings consist of lowercase English letters.\n\nA string X is called a good string when the following conditions are all met:\n\nLet L be the length of X. L is divisible by both N and M.\n\nConcatenating the 1-st, (\\frac{L}{N}+1)-th, (2 \\times \\frac{L}{N}+1)-th, ..., ((N-1)\\times\\frac{L}{N}+1)-th characters of X, without changing the order, results in S.\n\nConcatenating the 1-st, (\\frac{L}{M}+1)-th, (2 \\times \\frac{L}{M}+1)-th, ..., ((M-1)\\times\\frac{L}{M}+1)-th characters of X, without changing the order, results in T.\n\nDetermine if there exists a good string. If it exists, find the length of the shortest such string.\n\nConstraints\n\n1 \\leq N,M \\leq 10^5\n\nS and T consist of lowercase English letters.\n\n|S|=N\n\n|T|=M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS\nT\n\nOutput\n\nIf a good string does not exist, print -1; if it exists, print the length of the shortest such string.\n\nSample Input 1\n\n3 2\nacp\nae\n\nSample Output 1\n\n6\n\nFor example, the string accept is a good string.\nThere is no good string shorter than this, so the answer is 6.\n\nSample Input 2\n\n6 3\nabcdef\nabc\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n15 9\ndnsusrayukuaiia\ndujrunuma\n\nSample Output 3\n\n45", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1941, "cpu_time_ms": 2, "memory_kb": 1536}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s166114920", "group_id": "codeNet:p03238", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\t\n\tif N == 1 {\n\t\tfmt.Println(\"Hello World\")\n\t} else {\n\t\tA := getInt()\n\t\tB := getInt()\n\t\tfmt.Println(A + B)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1587236830, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03238.html", "problem_id": "p03238", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03238/input.txt", "sample_output_relpath": "derived/input_output/data/p03238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03238/Go/s166114920.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s166114920", "user_id": "u964273035"}, "prompt_components": {"gold_output": "Hello World\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\t\n\tif N == 1 {\n\t\tfmt.Println(\"Hello World\")\n\t} else {\n\t\tA := getInt()\n\t\tB := getInt()\n\t\tfmt.Println(A + B)\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "sample_input": "1\n"}, "reference_outputs": ["Hello World\n"], "source_document_id": "p03238", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5138, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s903035344", "group_id": "codeNet:p03238", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tif n == 1 {\n\t\tfmt.Printf(\"Hello World\\n\")\n\t\treturn\n\t}\n\tn1 := sc.NextInt()\n\tn2 := sc.NextInt()\n\tfmt.Printf(\"%v\\n\", n1+n2)\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1544304466, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03238.html", "problem_id": "p03238", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03238/input.txt", "sample_output_relpath": "derived/input_output/data/p03238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03238/Go/s903035344.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s903035344", "user_id": "u084693263"}, "prompt_components": {"gold_output": "Hello World\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tif n == 1 {\n\t\tfmt.Printf(\"Hello World\\n\")\n\t\treturn\n\t}\n\tn1 := sc.NextInt()\n\tn2 := sc.NextInt()\n\tfmt.Printf(\"%v\\n\", n1+n2)\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "sample_input": "1\n"}, "reference_outputs": ["Hello World\n"], "source_document_id": "p03238", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1717, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s706324593", "group_id": "codeNet:p03239", "input_text": "package main\n\nimport(\n \"fmt\"\n \"sort\"\n \"strings\"\n)\n\n\n\nfunc main() {\n var n,T int\n fmt.Scan(&n,&T)\n inf := 1000000000\n ans := inf\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN, M := sc.nextInt(), sc.nextInt()\n\tans := 1\n\tfor i := 1; i*i <= M; i++ {\n\t\tif M%i == 0 {\n\t\t\tif M/i >= N {\n\t\t\t\tans = i\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tq := M / i\n\t\t\tif M/q >= N {\n\t\t\t\tans = q\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n}\n", "language": "Go", "metadata": {"date": 1581735907, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03241.html", "problem_id": "p03241", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03241/input.txt", "sample_output_relpath": "derived/input_output/data/p03241/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03241/Go/s923553080.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s923553080", "user_id": "u924691798"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN, M := sc.nextInt(), sc.nextInt()\n\tans := 1\n\tfor i := 1; i*i <= M; i++ {\n\t\tif M%i == 0 {\n\t\t\tif M/i >= N {\n\t\t\t\tans = i\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tq := M / i\n\t\t\tif M/q >= N {\n\t\t\t\tans = q\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "sample_input": "3 14\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03241", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2169, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s975211963", "group_id": "codeNet:p03241", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tans := 1\n\tfor i := 2; i*i <= m; i++ {\n\t\tif m%i == 0 && i*n <= m {\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1572714622, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03241.html", "problem_id": "p03241", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03241/input.txt", "sample_output_relpath": "derived/input_output/data/p03241/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03241/Go/s975211963.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s975211963", "user_id": "u461993794"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tans := 1\n\tfor i := 2; i*i <= m; i++ {\n\t\tif m%i == 0 && i*n <= m {\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "sample_input": "3 14\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03241", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s978580667", "group_id": "codeNet:p03241", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n,m int\n\tfmt.Scan(&n,&m)\n\t\n\tlimit := int(math.Floor(math.Sqrt(float64(m))))\n\tdiv := []int{}\n\tfor i:=1; i <= limit; i++ {\n\t\tif m % i ==0{\n\t\t\tdiv = append(div,i)\n\t\t\tdiv = append(div,m/i)\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(div))\n\tfor i := len(div)-1; i >= 0; i -= 1{\n\t\tif m/div[i] >= n {\n\t\t\tfmt.Println(div[i])\n\t\t\treturn\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1538879586, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03241.html", "problem_id": "p03241", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03241/input.txt", "sample_output_relpath": "derived/input_output/data/p03241/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03241/Go/s978580667.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s978580667", "user_id": "u207125019"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n,m int\n\tfmt.Scan(&n,&m)\n\t\n\tlimit := int(math.Floor(math.Sqrt(float64(m))))\n\tdiv := []int{}\n\tfor i:=1; i <= limit; i++ {\n\t\tif m % i ==0{\n\t\t\tdiv = append(div,i)\n\t\t\tdiv = append(div,m/i)\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(div))\n\tfor i := len(div)-1; i >= 0; i -= 1{\n\t\tif m/div[i] >= n {\n\t\t\tfmt.Println(div[i])\n\t\t\treturn\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "sample_input": "3 14\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03241", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 393, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s776712136", "group_id": "codeNet:p03242", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\tn = strings.Replace(n, \"9\", \"q\", -1)\n\tn = strings.Replace(n, \"1\", \"9\", -1)\n\tn = strings.Replace(n, \"q\", \"1\", -1)\n\tfmt.Println(n)\n}\n", "language": "Go", "metadata": {"date": 1550299912, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03242.html", "problem_id": "p03242", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03242/input.txt", "sample_output_relpath": "derived/input_output/data/p03242/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03242/Go/s776712136.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s776712136", "user_id": "u061935128"}, "prompt_components": {"gold_output": "991\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\tn = strings.Replace(n, \"9\", \"q\", -1)\n\tn = strings.Replace(n, \"1\", \"9\", -1)\n\tn = strings.Replace(n, \"q\", \"1\", -1)\n\tfmt.Println(n)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "sample_input": "119\n"}, "reference_outputs": ["991\n"], "source_document_id": "p03242", "source_text": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 218, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s528681385", "group_id": "codeNet:p03242", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tfmt.Printf(\"%c%c%c\\n\", a[2], a[1], a[0])\n}\n", "language": "Go", "metadata": {"date": 1546086423, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03242.html", "problem_id": "p03242", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03242/input.txt", "sample_output_relpath": "derived/input_output/data/p03242/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03242/Go/s528681385.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s528681385", "user_id": "u113872560"}, "prompt_components": {"gold_output": "991\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tfmt.Printf(\"%c%c%c\\n\", a[2], a[1], a[0])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "sample_input": "119\n"}, "reference_outputs": ["991\n"], "source_document_id": "p03242", "source_text": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 114, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s690902587", "group_id": "codeNet:p03243", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < len(n); i++ {\n\t\tfmt.Print(string(n[0]))\n\t}\n\tfmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1600637915, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03243.html", "problem_id": "p03243", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03243/input.txt", "sample_output_relpath": "derived/input_output/data/p03243/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03243/Go/s690902587.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s690902587", "user_id": "u717943620"}, "prompt_components": {"gold_output": "111\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < len(n); i++ {\n\t\tfmt.Print(string(n[0]))\n\t}\n\tfmt.Println()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nKurohashi has never participated in AtCoder Beginner Contest (ABC).\n\nThe next ABC to be held is ABC N (the N-th ABC ever held).\nKurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.\n\nWhat is the earliest ABC where Kurohashi can make his debut?\n\nConstraints\n\n100 \\leq N \\leq 999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf the earliest ABC where Kurohashi can make his debut is ABC n, print n.\n\nSample Input 1\n\n111\n\nSample Output 1\n\n111\n\nThe next ABC to be held is ABC 111, where Kurohashi can make his debut.\n\nSample Input 2\n\n112\n\nSample Output 2\n\n222\n\nThe next ABC to be held is ABC 112, which means Kurohashi can no longer participate in ABC 111.\nAmong the ABCs where Kurohashi can make his debut, the earliest one is ABC 222.\n\nSample Input 3\n\n750\n\nSample Output 3\n\n777", "sample_input": "111\n"}, "reference_outputs": ["111\n"], "source_document_id": "p03243", "source_text": "Score : 200 points\n\nProblem Statement\n\nKurohashi has never participated in AtCoder Beginner Contest (ABC).\n\nThe next ABC to be held is ABC N (the N-th ABC ever held).\nKurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.\n\nWhat is the earliest ABC where Kurohashi can make his debut?\n\nConstraints\n\n100 \\leq N \\leq 999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf the earliest ABC where Kurohashi can make his debut is ABC n, print n.\n\nSample Input 1\n\n111\n\nSample Output 1\n\n111\n\nThe next ABC to be held is ABC 111, where Kurohashi can make his debut.\n\nSample Input 2\n\n112\n\nSample Output 2\n\n222\n\nThe next ABC to be held is ABC 112, which means Kurohashi can no longer participate in ABC 111.\nAmong the ABCs where Kurohashi can make his debut, the earliest one is ABC 222.\n\nSample Input 3\n\n750\n\nSample Output 3\n\n777", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 148, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s571112219", "group_id": "codeNet:p03245", "input_text": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Sat Dec 1 17:02:49 2018\n//\npackage main\n\nimport \"fmt\"\n\ntype pos struct {\n\tx, y int\n}\n\nvar n int\n\nfunc pow(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\treturn 2 * pow(n-1)\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tfmt.Scan(&n)\n\n\tposs := make([]pos, n)\n\tfor i := range poss {\n\t\tfmt.Scan(&poss[i].x, &poss[i].y)\n\t}\n\n\tparity := (abs(poss[0].x) + abs(poss[0].y)) % 2\n\tfor _, p := range poss {\n\t\tif (abs(p.x)+abs(p.y))%2 != parity {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar dist []int\n\tif parity == 0 {\n\t\tdist = []int{1}\n\t} else {\n\t\tdist = []int{}\n\t}\n\n\tfor i := 0; i < 33; i++ {\n\t\tdist = append(dist, pow(i))\n\t}\n\n\tfmt.Println(len(dist))\n\n\tfor i, d := range dist {\n\t\tfmt.Print(d)\n\t\tif i < len(dist)-1 {\n\t\t\tfmt.Print(\" \")\n\t\t} else {\n\t\t\tfmt.Println()\n\t\t}\n\t}\n\n\tfor _, p := range poss {\n\t\tx, y := p.x, p.y\n\t\troute := \"\"\n\t\tfor i := len(dist) - 1; i >= 0; i-- {\n\t\t\td := dist[i]\n\t\t\tif abs(x) > abs(y) {\n\t\t\t\tif x > 0 {\n\t\t\t\t\troute += \"R\"\n\t\t\t\t\tx -= d\n\t\t\t\t} else {\n\t\t\t\t\troute += \"L\"\n\t\t\t\t\tx += d\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif y > 0 {\n\t\t\t\t\troute += \"U\"\n\t\t\t\t\ty -= d\n\t\t\t\t} else {\n\t\t\t\t\troute += \"D\"\n\t\t\t\t\ty += d\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor i := len(route) - 1; i >= 0; i-- {\n\t\t\tfmt.Print(string(route[i]))\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1544246956, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03245.html", "problem_id": "p03245", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03245/input.txt", "sample_output_relpath": "derived/input_output/data/p03245/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03245/Go/s571112219.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s571112219", "user_id": "u802614675"}, "prompt_components": {"gold_output": "2\n1 2\nRL\nUU\nDR\n", "input_to_evaluate": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Sat Dec 1 17:02:49 2018\n//\npackage main\n\nimport \"fmt\"\n\ntype pos struct {\n\tx, y int\n}\n\nvar n int\n\nfunc pow(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\treturn 2 * pow(n-1)\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tfmt.Scan(&n)\n\n\tposs := make([]pos, n)\n\tfor i := range poss {\n\t\tfmt.Scan(&poss[i].x, &poss[i].y)\n\t}\n\n\tparity := (abs(poss[0].x) + abs(poss[0].y)) % 2\n\tfor _, p := range poss {\n\t\tif (abs(p.x)+abs(p.y))%2 != parity {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar dist []int\n\tif parity == 0 {\n\t\tdist = []int{1}\n\t} else {\n\t\tdist = []int{}\n\t}\n\n\tfor i := 0; i < 33; i++ {\n\t\tdist = append(dist, pow(i))\n\t}\n\n\tfmt.Println(len(dist))\n\n\tfor i, d := range dist {\n\t\tfmt.Print(d)\n\t\tif i < len(dist)-1 {\n\t\t\tfmt.Print(\" \")\n\t\t} else {\n\t\t\tfmt.Println()\n\t\t}\n\t}\n\n\tfor _, p := range poss {\n\t\tx, y := p.x, p.y\n\t\troute := \"\"\n\t\tfor i := len(dist) - 1; i >= 0; i-- {\n\t\t\td := dist[i]\n\t\t\tif abs(x) > abs(y) {\n\t\t\t\tif x > 0 {\n\t\t\t\t\troute += \"R\"\n\t\t\t\t\tx -= d\n\t\t\t\t} else {\n\t\t\t\t\troute += \"L\"\n\t\t\t\t\tx += d\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif y > 0 {\n\t\t\t\t\troute += \"U\"\n\t\t\t\t\ty -= d\n\t\t\t\t} else {\n\t\t\t\t\troute += \"D\"\n\t\t\t\t\ty += d\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor i := len(route) - 1; i >= 0; i-- {\n\t\t\tfmt.Print(string(route[i]))\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke is introducing a robot arm with the following properties to his factory:\n\nThe robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1 and Joint i. The length of Section i is d_i.\n\nFor each section, its mode can be specified individually. There are four modes: L, R, D and U. The mode of a section decides the direction of that section. If we consider the factory as a coordinate plane, the position of Joint i will be determined as follows (we denote its coordinates as (x_i, y_i)):\n\n(x_0, y_0) = (0, 0).\n\nIf the mode of Section i is L, (x_{i}, y_{i}) = (x_{i-1} - d_{i}, y_{i-1}).\n\nIf the mode of Section i is R, (x_{i}, y_{i}) = (x_{i-1} + d_{i}, y_{i-1}).\n\nIf the mode of Section i is D, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} - d_{i}).\n\nIf the mode of Section i is U, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} + d_{i}).\n\nSnuke would like to introduce a robot arm so that the position of Joint m can be matched with all of the N points (X_1, Y_1), (X_2, Y_2), ..., (X_N, Y_N) by properly specifying the modes of the sections.\nIs this possible?\nIf so, find such a robot arm and how to bring Joint m to each point (X_j, Y_j).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 1000\n\n-10^9 \\leq X_i \\leq 10^9\n\n-10^9 \\leq Y_i \\leq 10^9\n\nPartial Score\n\nIn the test cases worth 300 points, -10 \\leq X_i \\leq 10 and -10 \\leq Y_i \\leq 10 hold.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1\nX_2 Y_2\n:\nX_N Y_N\n\nOutput\n\nIf the condition can be satisfied, follow the following format. If the condition cannot be satisfied, print -1.\n\nm\nd_1 d_2 ... d_m\nw_1\nw_2\n:\nw_N\n\nm and d_i are the configurations of the robot arm. Refer to the problem statement for what each of them means.\nHere, 1 \\leq m \\leq 40 and 1 \\leq d_i \\leq 10^{12} must hold. Also, m and d_i must all be integers.\n\nw_j is a string of length m that represents the way to bring Joint m of the robot arm to point (X_j, Y_j).\nThe i-th character of w_j should be one of the letters L, R, D and U, representing the mode of Section i.\n\nSample Input 1\n\n3\n-1 0\n0 3\n2 -1\n\nSample Output 1\n\n2\n1 2\nRL\nUU\nDR\n\nIn the given way to bring Joint m of the robot arm to each (X_j, Y_j), the positions of the joints will be as follows:\n\nTo (X_1, Y_1) = (-1, 0): First, the position of Joint 0 is (x_0, y_0) = (0, 0). As the mode of Section 1 is R, the position of Joint 1 is (x_1, y_1) = (1, 0). Then, as the mode of Section 2 is L, the position of Joint 2 is (x_2, y_2) = (-1, 0).\n\nTo (X_2, Y_2) = (0, 3): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, 1), (x_2, y_2) = (0, 3).\n\nTo (X_3, Y_3) = (2, -1): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, -1), (x_2, y_2) = (2, -1).\n\nSample Input 2\n\n5\n0 0\n1 0\n2 0\n3 0\n4 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n1 1\n1 1\n\nSample Output 3\n\n2\n1 1\nRU\nUR\n\nThere may be duplicated points among (X_j, Y_j).\n\nSample Input 4\n\n3\n-7 -3\n7 3\n-3 -7\n\nSample Output 4\n\n5\n3 1 4 1 5\nLRDUL\nRDULR\nDULRD", "sample_input": "3\n-1 0\n0 3\n2 -1\n"}, "reference_outputs": ["2\n1 2\nRL\nUU\nDR\n"], "source_document_id": "p03245", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke is introducing a robot arm with the following properties to his factory:\n\nThe robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1 and Joint i. The length of Section i is d_i.\n\nFor each section, its mode can be specified individually. There are four modes: L, R, D and U. The mode of a section decides the direction of that section. If we consider the factory as a coordinate plane, the position of Joint i will be determined as follows (we denote its coordinates as (x_i, y_i)):\n\n(x_0, y_0) = (0, 0).\n\nIf the mode of Section i is L, (x_{i}, y_{i}) = (x_{i-1} - d_{i}, y_{i-1}).\n\nIf the mode of Section i is R, (x_{i}, y_{i}) = (x_{i-1} + d_{i}, y_{i-1}).\n\nIf the mode of Section i is D, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} - d_{i}).\n\nIf the mode of Section i is U, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} + d_{i}).\n\nSnuke would like to introduce a robot arm so that the position of Joint m can be matched with all of the N points (X_1, Y_1), (X_2, Y_2), ..., (X_N, Y_N) by properly specifying the modes of the sections.\nIs this possible?\nIf so, find such a robot arm and how to bring Joint m to each point (X_j, Y_j).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 1000\n\n-10^9 \\leq X_i \\leq 10^9\n\n-10^9 \\leq Y_i \\leq 10^9\n\nPartial Score\n\nIn the test cases worth 300 points, -10 \\leq X_i \\leq 10 and -10 \\leq Y_i \\leq 10 hold.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1\nX_2 Y_2\n:\nX_N Y_N\n\nOutput\n\nIf the condition can be satisfied, follow the following format. If the condition cannot be satisfied, print -1.\n\nm\nd_1 d_2 ... d_m\nw_1\nw_2\n:\nw_N\n\nm and d_i are the configurations of the robot arm. Refer to the problem statement for what each of them means.\nHere, 1 \\leq m \\leq 40 and 1 \\leq d_i \\leq 10^{12} must hold. Also, m and d_i must all be integers.\n\nw_j is a string of length m that represents the way to bring Joint m of the robot arm to point (X_j, Y_j).\nThe i-th character of w_j should be one of the letters L, R, D and U, representing the mode of Section i.\n\nSample Input 1\n\n3\n-1 0\n0 3\n2 -1\n\nSample Output 1\n\n2\n1 2\nRL\nUU\nDR\n\nIn the given way to bring Joint m of the robot arm to each (X_j, Y_j), the positions of the joints will be as follows:\n\nTo (X_1, Y_1) = (-1, 0): First, the position of Joint 0 is (x_0, y_0) = (0, 0). As the mode of Section 1 is R, the position of Joint 1 is (x_1, y_1) = (1, 0). Then, as the mode of Section 2 is L, the position of Joint 2 is (x_2, y_2) = (-1, 0).\n\nTo (X_2, Y_2) = (0, 3): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, 1), (x_2, y_2) = (0, 3).\n\nTo (X_3, Y_3) = (2, -1): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, -1), (x_2, y_2) = (2, -1).\n\nSample Input 2\n\n5\n0 0\n1 0\n2 0\n3 0\n4 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n1 1\n1 1\n\nSample Output 3\n\n2\n1 1\nRU\nUR\n\nThere may be duplicated points among (X_j, Y_j).\n\nSample Input 4\n\n3\n-7 -3\n7 3\n-3 -7\n\nSample Output 4\n\n5\n3 1 4 1 5\nLRDUL\nRDULR\nDULRD", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1313, "cpu_time_ms": 92, "memory_kb": 2176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s239187522", "group_id": "codeNet:p03246", "input_text": "package main\n\nimport \"fmt\"\n\n// 2018-10-25T16:28:48+0800\n// 2018-10-25T16:43:57+0800 # WA @see https://arc103.contest.atcoder.jp/submissions/3466776\n// 2018-10-25T16:45:49+0800\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\t//v := make([]int, n)\n\ta := make([]int, n/2)\n\tb := make([]int, n/2)\n\tma := make(map[int]int, n/2)\n\taa1 := -1\n\taa2 := -1\n\tmb := make(map[int]int, n/2)\n\tbb1 := -1\n\tbb2 := -1\n\tfor i := 0; i < n/2; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t\tma[a[i]]++\n\t\tif ma[a[i]] >= ma[aa1] {\n\t\t\taa2 = aa1\n\t\t\taa1 = a[i]\n\t\t}\n\t\tfmt.Scanf(\"%d\", &b[i])\n\t\tmb[b[i]]++\n\t\tif mb[b[i]] >= mb[bb1] {\n\t\t\tbb2 = bb1\n\t\t\tbb1 = b[i]\n\t\t}\n\t}\n\tif aa1 != bb1 {\n\t\tfmt.Println(n - ma[aa1] - mb[bb1])\n\t\treturn\n\t}\n\tO1 := n - ma[aa1] - mb[bb2]\n\tO2 := n - ma[aa2] - mb[bb1]\n\tif O1 > O2 {\n\t\tfmt.Println(O2)\n\t} else {\n\t\tfmt.Println(O1)\n\t}\n}", "language": "Go", "metadata": {"date": 1540503971, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03246.html", "problem_id": "p03246", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03246/input.txt", "sample_output_relpath": "derived/input_output/data/p03246/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03246/Go/s239187522.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s239187522", "user_id": "u916751718"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\n// 2018-10-25T16:28:48+0800\n// 2018-10-25T16:43:57+0800 # WA @see https://arc103.contest.atcoder.jp/submissions/3466776\n// 2018-10-25T16:45:49+0800\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\t//v := make([]int, n)\n\ta := make([]int, n/2)\n\tb := make([]int, n/2)\n\tma := make(map[int]int, n/2)\n\taa1 := -1\n\taa2 := -1\n\tmb := make(map[int]int, n/2)\n\tbb1 := -1\n\tbb2 := -1\n\tfor i := 0; i < n/2; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t\tma[a[i]]++\n\t\tif ma[a[i]] >= ma[aa1] {\n\t\t\taa2 = aa1\n\t\t\taa1 = a[i]\n\t\t}\n\t\tfmt.Scanf(\"%d\", &b[i])\n\t\tmb[b[i]]++\n\t\tif mb[b[i]] >= mb[bb1] {\n\t\t\tbb2 = bb1\n\t\t\tbb1 = b[i]\n\t\t}\n\t}\n\tif aa1 != bb1 {\n\t\tfmt.Println(n - ma[aa1] - mb[bb1])\n\t\treturn\n\t}\n\tO1 := n - ma[aa1] - mb[bb2]\n\tO2 := n - ma[aa2] - mb[bb1]\n\tif O1 > O2 {\n\t\tfmt.Println(O2)\n\t} else {\n\t\tfmt.Println(O1)\n\t}\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03246", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 806, "cpu_time_ms": 475, "memory_kb": 6784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s836724699", "group_id": "codeNet:p03252", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\ts := scanRunes()\n\tt := scanRunes()\n\n\tss := make([]rune, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tss[i] = -1\n\t}\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif ss[t[i]-'a'] != -1 && ss[t[i]-'a'] != s[i] && s[i] != t[i] {\n\t\t\tdebug(ss)\n\t\t\tfmt.Fprintln(wr, \"No\")\n\t\t\treturn\n\t\t}\n\t\t// debug(string(s[i]), string(t[i]), ss[s[i]-'a'], t[i])\n\t\tss[t[i]-'a'] = s[i]\n\t}\n\t// debug(ss)\n\tfmt.Fprintln(wr, \"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1589074000, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03252.html", "problem_id": "p03252", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03252/input.txt", "sample_output_relpath": "derived/input_output/data/p03252/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03252/Go/s836724699.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s836724699", "user_id": "u548992197"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\ts := scanRunes()\n\tt := scanRunes()\n\n\tss := make([]rune, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tss[i] = -1\n\t}\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif ss[t[i]-'a'] != -1 && ss[t[i]-'a'] != s[i] && s[i] != t[i] {\n\t\t\tdebug(ss)\n\t\t\tfmt.Fprintln(wr, \"No\")\n\t\t\treturn\n\t\t}\n\t\t// debug(string(s[i]), string(t[i]), ss[s[i]-'a'], t[i])\n\t\tss[t[i]-'a'] = s[i]\n\t}\n\t// debug(ss)\n\tfmt.Fprintln(wr, \"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "sample_input": "azzel\napple\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03252", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1418, "cpu_time_ms": 19, "memory_kb": 3328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s375776758", "group_id": "codeNet:p03252", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s)\n\tfmt.Scan(&t)\n\n\tss := strings.Split(s, \"\")\n\ttt := strings.Split(t, \"\")\n\n\tms := map[string]string{}\n\tmt := map[string]string{}\n\tok := true\n\tfor i := 0; i < len(ss); i++ {\n\n\t\tif len(ms[ss[i]]) != 0 {\n\t\t\tif ms[ss[i]] != tt[i] {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\n\t\tif len(mt[tt[i]]) != 0 {\n\t\t\tif mt[tt[i]] != ss[i] {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\n\t\tms[ss[i]] = tt[i]\n\t\tmt[tt[i]] = ss[i]\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564520363, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03252.html", "problem_id": "p03252", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03252/input.txt", "sample_output_relpath": "derived/input_output/data/p03252/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03252/Go/s375776758.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s375776758", "user_id": "u710190793"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s)\n\tfmt.Scan(&t)\n\n\tss := strings.Split(s, \"\")\n\ttt := strings.Split(t, \"\")\n\n\tms := map[string]string{}\n\tmt := map[string]string{}\n\tok := true\n\tfor i := 0; i < len(ss); i++ {\n\n\t\tif len(ms[ss[i]]) != 0 {\n\t\t\tif ms[ss[i]] != tt[i] {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\n\t\tif len(mt[tt[i]]) != 0 {\n\t\t\tif mt[tt[i]] != ss[i] {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\n\t\tms[ss[i]] = tt[i]\n\t\tmt[tt[i]] = ss[i]\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "sample_input": "azzel\napple\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03252", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 697, "cpu_time_ms": 286, "memory_kb": 10624}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s214711428", "group_id": "codeNet:p03252", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts, t := nextLine(), nextLine()\n\n\tn := len(s)\n\n\tvar start, goal []int\n\tfor i := 0; i < 26; i++ {\n\t\tstart = append(start, -1)\n\t\tgoal = append(goal, -1)\n\t}\n\n\t// fmt.Printf(\"%#v\\n\", n)\n\n\tfor i := 0; i < n; i++ {\n\t\ta := int(s[i] - 'a')\n\t\tb := int(t[i] - 'a')\n\n\t\t// 何かしら変換が行われている\n\t\tif start[a] != -1 || goal[b] != -1 {\n\t\t\tif start[a] != b || goal[b] != a {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\t// 何も値がセットされていないとき\n\t\t\tstart[a] = b\n\t\t\tgoal[b] = a\n\t\t}\n\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1563073767, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03252.html", "problem_id": "p03252", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03252/input.txt", "sample_output_relpath": "derived/input_output/data/p03252/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03252/Go/s214711428.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s214711428", "user_id": "u317845566"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts, t := nextLine(), nextLine()\n\n\tn := len(s)\n\n\tvar start, goal []int\n\tfor i := 0; i < 26; i++ {\n\t\tstart = append(start, -1)\n\t\tgoal = append(goal, -1)\n\t}\n\n\t// fmt.Printf(\"%#v\\n\", n)\n\n\tfor i := 0; i < n; i++ {\n\t\ta := int(s[i] - 'a')\n\t\tb := int(t[i] - 'a')\n\n\t\t// 何かしら変換が行われている\n\t\tif start[a] != -1 || goal[b] != -1 {\n\t\t\tif start[a] != b || goal[b] != a {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\t// 何も値がセットされていないとき\n\t\t\tstart[a] = b\n\t\t\tgoal[b] = a\n\t\t}\n\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "sample_input": "azzel\napple\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03252", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 876, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s747672456", "group_id": "codeNet:p03252", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\td := strings.Split(string(b), \"\\n\")\n\ts := d[0]\n\tt := d[1]\n\tsm := make(map[byte]int)\n\ttm := make(map[byte]int)\n\tfor i := 0; i < len(s); i++ {\n\t\tif sm[s[i]] != tm[t[i]] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tsm[s[i]] = i + 1\n\t\ttm[t[i]] = i + 1\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1558147793, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03252.html", "problem_id": "p03252", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03252/input.txt", "sample_output_relpath": "derived/input_output/data/p03252/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03252/Go/s747672456.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s747672456", "user_id": "u889640107"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\td := strings.Split(string(b), \"\\n\")\n\ts := d[0]\n\tt := d[1]\n\tsm := make(map[byte]int)\n\ttm := make(map[byte]int)\n\tfor i := 0; i < len(s); i++ {\n\t\tif sm[s[i]] != tm[t[i]] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tsm[s[i]] = i + 1\n\t\ttm[t[i]] = i + 1\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "sample_input": "azzel\napple\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03252", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 379, "cpu_time_ms": 35, "memory_kb": 1920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s545371463", "group_id": "codeNet:p03252", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\ts := sc.Text()\n\tsc.Scan()\n\tt := sc.Text()\n\n\tsm := make(map[string]int)\n\ttm := make(map[string]int)\n\tfor i := 0; i < len(s); i++ {\n\t\tss := string(s[i])\n\t\tst := string(t[i])\n\t\tif sm[ss] != tm[st] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tsm[ss] = i + 1\n\t\ttm[st] = i + 1\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1558147335, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03252.html", "problem_id": "p03252", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03252/input.txt", "sample_output_relpath": "derived/input_output/data/p03252/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03252/Go/s545371463.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s545371463", "user_id": "u889640107"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\ts := sc.Text()\n\tsc.Scan()\n\tt := sc.Text()\n\n\tsm := make(map[string]int)\n\ttm := make(map[string]int)\n\tfor i := 0; i < len(s); i++ {\n\t\tss := string(s[i])\n\t\tst := string(t[i])\n\t\tif sm[ss] != tm[st] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tsm[ss] = i + 1\n\t\ttm[st] = i + 1\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "sample_input": "azzel\napple\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03252", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 398, "cpu_time_ms": 11, "memory_kb": 1152}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s755477197", "group_id": "codeNet:p03252", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS, T := sc.Next(), sc.Next()\n\n\tmpA := map[byte]int{}\n\tfor i := 0; i < len(S); i++ {\n\t\tmpA[S[i]]++\n\t}\n\tmpB := map[byte]int{}\n\tfor i := 0; i < len(T); i++ {\n\t\tmpB[T[i]]++\n\t}\n\n\tA := make([]int, 26)\n\n\ti := 0\n\tfor _, v := range mpA {\n\t\tA[i] = v\n\t\ti++\n\t}\n\n\tB := make([]int, 26)\n\n\ti = 0\n\tfor _, v := range mpB {\n\t\tB[i] = v\n\t\ti++\n\t}\n\n\tsort.Ints(A)\n\tsort.Ints(B)\n\tfor i := 0; i < 26; i++ {\n\t\tif A[i] != B[i] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1537753772, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03252.html", "problem_id": "p03252", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03252/input.txt", "sample_output_relpath": "derived/input_output/data/p03252/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03252/Go/s755477197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s755477197", "user_id": "u504669764"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS, T := sc.Next(), sc.Next()\n\n\tmpA := map[byte]int{}\n\tfor i := 0; i < len(S); i++ {\n\t\tmpA[S[i]]++\n\t}\n\tmpB := map[byte]int{}\n\tfor i := 0; i < len(T); i++ {\n\t\tmpB[T[i]]++\n\t}\n\n\tA := make([]int, 26)\n\n\ti := 0\n\tfor _, v := range mpA {\n\t\tA[i] = v\n\t\ti++\n\t}\n\n\tB := make([]int, 26)\n\n\ti = 0\n\tfor _, v := range mpB {\n\t\tB[i] = v\n\t\ti++\n\t}\n\n\tsort.Ints(A)\n\tsort.Ints(B)\n\tfor i := 0; i < 26; i++ {\n\t\tif A[i] != B[i] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "sample_input": "azzel\napple\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03252", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given strings S and T consisting of lowercase English letters.\n\nYou can perform the following operation on S any number of times:\n\nOperation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.\n\nDetermine if S and T can be made equal by performing the operation zero or more times.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\n|S| = |T|\n\nS and T consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S and T can be made equal, print Yes; otherwise, print No.\n\nSample Input 1\n\nazzel\napple\n\nSample Output 1\n\nYes\n\nazzel can be changed to apple, as follows:\n\nChoose e as c_1 and l as c_2. azzel becomes azzle.\n\nChoose z as c_1 and p as c_2. azzle becomes apple.\n\nSample Input 2\n\nchokudai\nredcoder\n\nSample Output 2\n\nNo\n\nNo sequences of operation can change chokudai to redcoder.\n\nSample Input 3\n\nabcdefghijklmnopqrstuvwxyz\nibyhqfrekavclxjstdwgpzmonu\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2391, "cpu_time_ms": 39, "memory_kb": 3328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s714050511", "group_id": "codeNet:p03266", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, k := nextInt(), nextInt()\n\n\tif k%2 == 0 {\n\t\ta := n / k\n\t\tb := (n + (k / 2)) / k\n\t\tfmt.Println(a*a*a + b*b*b)\n\t} else {\n\t\ta := n / k\n\t\tfmt.Println(a * a * a)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564515638, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03266.html", "problem_id": "p03266", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03266/input.txt", "sample_output_relpath": "derived/input_output/data/p03266/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03266/Go/s714050511.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s714050511", "user_id": "u710190793"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, k := nextInt(), nextInt()\n\n\tif k%2 == 0 {\n\t\ta := n / k\n\t\tb := (n + (k / 2)) / k\n\t\tfmt.Println(a*a*a + b*b*b)\n\t} else {\n\t\ta := n / k\n\t\tfmt.Println(a * a * a)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "sample_input": "3 2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03266", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 411, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s193247728", "group_id": "codeNet:p03272", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, i int\n\tfmt.Scan(&n, &i)\n\tfmt.Println(n - i + 1)\n}\n", "language": "Go", "metadata": {"date": 1593053074, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03272.html", "problem_id": "p03272", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03272/input.txt", "sample_output_relpath": "derived/input_output/data/p03272/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03272/Go/s193247728.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s193247728", "user_id": "u055687574"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, i int\n\tfmt.Scan(&n, &i)\n\tfmt.Println(n - i + 1)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is an N-car train.\n\nYou are given an integer i. Find the value of j such that the following statement is true: \"the i-th car from the front of the train is the j-th car from the back.\"\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN i\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n\nSample Output 1\n\n3\n\nThe second car from the front of a 4-car train is the third car from the back.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n15 11\n\nSample Output 3\n\n5", "sample_input": "4 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03272", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is an N-car train.\n\nYou are given an integer i. Find the value of j such that the following statement is true: \"the i-th car from the front of the train is the j-th car from the back.\"\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN i\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n\nSample Output 1\n\n3\n\nThe second car from the front of a 4-car train is the third car from the back.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n15 11\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 105, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s335998622", "group_id": "codeNet:p03274", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\tar := make([]int64, n)\n\tfor i := range ar {\n\t\tfmt.Scan(&ar[i])\n\t}\n\tvar ans int64 = 3000000000\n\tfor i := 0; i < n-k+1; i++ {\n\t\tvar v int64 = f(ar[i], ar[i+k-1])\n\t\tif v < ans {\n\t\t\tans = v\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc f(s, e int64) int64 {\n\tif s <= 0 && e <= 0 {\n\t\treturn -s\n\t}\n\tif s <= 0 && 0 <= e {\n\t\tif -s < e {\n\t\t\treturn -s*2 + e\n\t\t}\n\t\treturn -s + e*2\n\t}\n\treturn e\n}\n", "language": "Go", "metadata": {"date": 1554177076, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03274.html", "problem_id": "p03274", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03274/input.txt", "sample_output_relpath": "derived/input_output/data/p03274/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03274/Go/s335998622.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s335998622", "user_id": "u375977529"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\tar := make([]int64, n)\n\tfor i := range ar {\n\t\tfmt.Scan(&ar[i])\n\t}\n\tvar ans int64 = 3000000000\n\tfor i := 0; i < n-k+1; i++ {\n\t\tvar v int64 = f(ar[i], ar[i+k-1])\n\t\tif v < ans {\n\t\t\tans = v\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc f(s, e int64) int64 {\n\tif s <= 0 && e <= 0 {\n\t\treturn -s\n\t}\n\tif s <= 0 && 0 <= e {\n\t\tif -s < e {\n\t\t\treturn -s*2 + e\n\t\t}\n\t\treturn -s + e*2\n\t}\n\treturn e\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "sample_input": "5 3\n-30 -10 10 20 50\n"}, "reference_outputs": ["40\n"], "source_document_id": "p03274", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 452, "cpu_time_ms": 663, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s045028964", "group_id": "codeNet:p03276", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN, K := sc.NextInt(), sc.NextInt()\n\tx := sc.NextIntArray()\n\n\tmn := -1\n\tfor i := 0; i+K-1 < N; i++ {\n\t\tj := i + K - 1\n\t\tA := 0\n\t\tif x[i] < 0 && x[j] > 0 {\n\t\t\tA = abs(x[i])*2 + abs(x[j])\n\t\t} else {\n\t\t\tA = max(abs(x[i]), abs(x[j]))\n\t\t}\n\n\t\tB := 0\n\t\tif x[i] < 0 && x[j] > 0 {\n\t\t\tB = abs(x[i]) + abs(x[j])*2\n\t\t} else {\n\t\t\tB = max(abs(x[i]), abs(x[j]))\n\t\t}\n\n\t\tC := min(A, B)\n\n\t\tif mn == -1 || mn > C {\n\t\t\tmn = C\n\t\t}\n\t}\n\n\tfmt.Println(mn)\n\n}\nfunc max(a int, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1535247663, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03276.html", "problem_id": "p03276", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03276/input.txt", "sample_output_relpath": "derived/input_output/data/p03276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03276/Go/s045028964.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s045028964", "user_id": "u504669764"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN, K := sc.NextInt(), sc.NextInt()\n\tx := sc.NextIntArray()\n\n\tmn := -1\n\tfor i := 0; i+K-1 < N; i++ {\n\t\tj := i + K - 1\n\t\tA := 0\n\t\tif x[i] < 0 && x[j] > 0 {\n\t\t\tA = abs(x[i])*2 + abs(x[j])\n\t\t} else {\n\t\t\tA = max(abs(x[i]), abs(x[j]))\n\t\t}\n\n\t\tB := 0\n\t\tif x[i] < 0 && x[j] > 0 {\n\t\t\tB = abs(x[i]) + abs(x[j])*2\n\t\t} else {\n\t\t\tB = max(abs(x[i]), abs(x[j]))\n\t\t}\n\n\t\tC := min(A, B)\n\n\t\tif mn == -1 || mn > C {\n\t\t\tmn = C\n\t\t}\n\t}\n\n\tfmt.Println(mn)\n\n}\nfunc max(a int, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "sample_input": "5 3\n-30 -10 10 20 50\n"}, "reference_outputs": ["40\n"], "source_document_id": "p03276", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2551, "cpu_time_ms": 25, "memory_kb": 7168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s909017276", "group_id": "codeNet:p03280", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\tfmt.Println((A * B) - (A + B - 1))\n}\n", "language": "Go", "metadata": {"date": 1572336442, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03280.html", "problem_id": "p03280", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03280/input.txt", "sample_output_relpath": "derived/input_output/data/p03280/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03280/Go/s909017276.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909017276", "user_id": "u902409225"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\tfmt.Println((A * B) - (A + B - 1))\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)\n\nWhat is the area of this yard excluding the roads? Find it.\n\nNote\n\nIt can be proved that the positions of the roads do not affect the area.\n\nConstraints\n\nA is an integer between 2 and 100 (inclusive).\n\nB is an integer between 2 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the area of this yard excluding the roads (in square yards).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n1\n\nIn this case, the area is 1 square yard.\n\nSample Input 2\n\n5 7\n\nSample Output 2\n\n24\n\nIn this case, the area is 24 square yards.", "sample_input": "2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03280", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)\n\nWhat is the area of this yard excluding the roads? Find it.\n\nNote\n\nIt can be proved that the positions of the roads do not affect the area.\n\nConstraints\n\nA is an integer between 2 and 100 (inclusive).\n\nB is an integer between 2 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the area of this yard excluding the roads (in square yards).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n1\n\nIn this case, the area is 1 square yard.\n\nSample Input 2\n\n5 7\n\nSample Output 2\n\n24\n\nIn this case, the area is 24 square yards.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 112, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s483916003", "group_id": "codeNet:p03281", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\n\tcnt := 0\n\tfor i := 1; i <= n; i += 2 {\n\t\tif numDivSlow(i) == 8 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\n}\n\n// 約数の数をカウントする(愚直)\nfunc numDivSlow(a int) int {\n\tcnt := 1\n\tfor i := 1; i <= a/2; i++ {\n\t\tif a%i == 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\n// ---- readfunc\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1598733056, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03281.html", "problem_id": "p03281", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03281/input.txt", "sample_output_relpath": "derived/input_output/data/p03281/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03281/Go/s483916003.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s483916003", "user_id": "u756000295"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\n\tcnt := 0\n\tfor i := 1; i <= n; i += 2 {\n\t\tif numDivSlow(i) == 8 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\n}\n\n// 約数の数をカウントする(愚直)\nfunc numDivSlow(a int) int {\n\tcnt := 1\n\tfor i := 1; i <= a/2; i++ {\n\t\tif a%i == 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\n// ---- readfunc\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 702, "cpu_time_ms": 11, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s499908767", "group_id": "codeNet:p03281", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := readInt()\n\n\tans := 0\n\tfor i := 1; i <= n; i += 2 {\n\t\tif countDivisor(i) == 8 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc countDivisor(n int) int {\n\tcount := 0\n\tfor i := 1; i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n", "language": "Go", "metadata": {"date": 1586121227, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03281.html", "problem_id": "p03281", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03281/input.txt", "sample_output_relpath": "derived/input_output/data/p03281/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03281/Go/s499908767.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s499908767", "user_id": "u309370374"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := readInt()\n\n\tans := 0\n\tfor i := 1; i <= n; i += 2 {\n\t\tif countDivisor(i) == 8 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc countDivisor(n int) int {\n\tcount := 0\n\tfor i := 1; i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 493, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s228132512", "group_id": "codeNet:p03281", "input_text": "package main\n\nimport(\n \"fmt\"\n \"sort\"\n \"strings\"\n)\n\n\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n ans := 0\n for i:=1; i<=n; i+=2{\n cnt := 0\n for j:=1; j<=i; j++{\n if i%j==0{\n cnt++\n }\n }\n if cnt==8{\n ans++\n }\n }\n fmt.Println(ans)\n}\n\n\n\n\n\nfunc abs32(a int) int {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc abs64(a int64) int64 {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc min32(a, b int) int {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i0 {\n\t\trev = rev *10 + s%10\n\t\ts = s/10\n\t}\n\treturn rev\n}\n\n\t\n", "language": "Go", "metadata": {"date": 1534646403, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03282.html", "problem_id": "p03282", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03282/input.txt", "sample_output_relpath": "derived/input_output/data/p03282/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03282/Go/s742522919.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s742522919", "user_id": "u207125019"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s,k int\n\tfmt.Scan(&s, &k)\n\ts = reverse(s)\n\t\tdigist := s % 10\t\n\tif k == 1 {\n\t\tfmt.Println(digist)\n\t\treturn\n\t}else{\n\t\tdigist := (s /10)%10\n\t\tfmt.Println(digist)\n\t\treturn\n\n\t}\n}\n\nfunc reverse(s int) int {\n\tvar rev = 0\n\tfor s >0 {\n\t\trev = rev *10 + s%10\n\t\ts = s/10\n\t}\n\treturn rev\n}\n\n\t\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "sample_input": "1214\n4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03282", "source_text": "Score: 300 points\n\nProblem Statement\n\nMr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:\n\nEach occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.\n\nFor example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.\nYou are interested in what the string looks like after 5 \\times 10^{15} days. What is the K-th character from the left in the string after 5 \\times 10^{15} days?\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nK is an integer between 1 and 10^{18} (inclusive).\n\nThe length of the string after 5 \\times 10^{15} days is at least K.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the K-th character from the left in Mr. Infinity's string after 5 \\times 10^{15} days.\n\nSample Input 1\n\n1214\n4\n\nSample Output 1\n\n2\n\nThe string S changes as follows:\n\nNow: 1214\n\nAfter one day: 12214444\n\nAfter two days: 1222214444444444444444\n\nAfter three days: 12222222214444444444444444444444444444444444444444444444444444444444444444\n\nThe first five characters in the string after 5 \\times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.\n\nSample Input 2\n\n3\n157\n\nSample Output 2\n\n3\n\nThe initial string is 3. The string after 5 \\times 10^{15} days consists only of 3.\n\nSample Input 3\n\n299792458\n9460730472580800\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 332, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s157464762", "group_id": "codeNet:p03283", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, M, Q := scanInt(), scanInt(), scanInt()\n\tMap := make([][]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tMap[i] = make([]int, N+1)\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\tL, R := scanInt(), scanInt()\n\t\tMap[L][R]++\n\t}\n\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tMap[i][j] += Map[i][j-1]\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tp, q := scanInt(), scanInt()\n\t\tans := 0\n\t\tfor i := p; i <= q; i++ {\n\t\t\tans += Map[i][q] - Map[i][p-1]\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594317006, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03283.html", "problem_id": "p03283", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03283/input.txt", "sample_output_relpath": "derived/input_output/data/p03283/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03283/Go/s157464762.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s157464762", "user_id": "u941434715"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, M, Q := scanInt(), scanInt(), scanInt()\n\tMap := make([][]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tMap[i] = make([]int, N+1)\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\tL, R := scanInt(), scanInt()\n\t\tMap[L][R]++\n\t}\n\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tMap[i][j] += Map[i][j-1]\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tp, q := scanInt(), scanInt()\n\t\tans := 0\n\t\tfor i := p; i <= q; i++ {\n\t\t\tans += Map[i][q] - Map[i][p-1]\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "sample_input": "2 3 1\n1 1\n1 2\n2 2\n1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03283", "source_text": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 705, "cpu_time_ms": 519, "memory_kb": 6240}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s122037476", "group_id": "codeNet:p03283", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\n)\n\nconst WIDTH = 502\nconst HEIGHT = 502\n\n/*\nvar nrs = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLineToInt() []int {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := nrs.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n line := strings.Split(string(buf), \" \")\n var intLine []int\n for _, str := range line {\n n, _ := strconv.Atoi(str)\n intLine = append(intLine, n)\n }\n return intLine\n}\n*/\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readLineToInt() []int {\n sc.Scan()\n line := strings.Split(sc.Text(), \" \")\n var intLine []int\n for _, str := range line {\n n, _ := strconv.Atoi(str)\n intLine = append(intLine, n)\n }\n return intLine\n}\n\nfunc main() {\n var m, q int\n var l, r int\n var a, b int\n var mp [HEIGHT][WIDTH]int\n nmq := readLineToInt()\n _, m, q = nmq[0], nmq[1], nmq[2]\n //sc.Scan()\n //fmt.Sscanf(sc.Text(), \"%d %d %d\", &n, &m, &q)\n\n for i := 0; i < m; i++ {\n lr := readLineToInt()\n l, r = lr[0], lr[1]\n //sc.Scan()\n //fmt.Sscanf(sc.Text(), \"%d %d\", &l, &r)\n mp[l][r] += 1\n }\n\n for x := 0; x < WIDTH - 1; x++ {\n mp[0][x] += mp[0][x + 1]\n }\n\n for y := 1; y < HEIGHT; y++ {\n for x := 0; x < WIDTH - 1; x++ {\n mp[y][x + 1] += mp[y][x]\n mp[y][x] += mp[y - 1][x]\n }\n }\n\n for i := 0; i < q; i++ {\n ab := readLineToInt()\n a, b = ab[0], ab[1]\n //sc.Scan()\n //fmt.Sscanf(sc.Text(), \"%d %d\", &a, &b)\n fmt.Println(mp[b][b] - mp[b][a - 1] - mp[a - 1][b] + mp[a - 1][a - 1])\n }\n}", "language": "Go", "metadata": {"date": 1548290742, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03283.html", "problem_id": "p03283", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03283/input.txt", "sample_output_relpath": "derived/input_output/data/p03283/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03283/Go/s122037476.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s122037476", "user_id": "u145035045"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\n)\n\nconst WIDTH = 502\nconst HEIGHT = 502\n\n/*\nvar nrs = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLineToInt() []int {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := nrs.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n line := strings.Split(string(buf), \" \")\n var intLine []int\n for _, str := range line {\n n, _ := strconv.Atoi(str)\n intLine = append(intLine, n)\n }\n return intLine\n}\n*/\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readLineToInt() []int {\n sc.Scan()\n line := strings.Split(sc.Text(), \" \")\n var intLine []int\n for _, str := range line {\n n, _ := strconv.Atoi(str)\n intLine = append(intLine, n)\n }\n return intLine\n}\n\nfunc main() {\n var m, q int\n var l, r int\n var a, b int\n var mp [HEIGHT][WIDTH]int\n nmq := readLineToInt()\n _, m, q = nmq[0], nmq[1], nmq[2]\n //sc.Scan()\n //fmt.Sscanf(sc.Text(), \"%d %d %d\", &n, &m, &q)\n\n for i := 0; i < m; i++ {\n lr := readLineToInt()\n l, r = lr[0], lr[1]\n //sc.Scan()\n //fmt.Sscanf(sc.Text(), \"%d %d\", &l, &r)\n mp[l][r] += 1\n }\n\n for x := 0; x < WIDTH - 1; x++ {\n mp[0][x] += mp[0][x + 1]\n }\n\n for y := 1; y < HEIGHT; y++ {\n for x := 0; x < WIDTH - 1; x++ {\n mp[y][x + 1] += mp[y][x]\n mp[y][x] += mp[y - 1][x]\n }\n }\n\n for i := 0; i < q; i++ {\n ab := readLineToInt()\n a, b = ab[0], ab[1]\n //sc.Scan()\n //fmt.Sscanf(sc.Text(), \"%d %d\", &a, &b)\n fmt.Println(mp[b][b] - mp[b][a - 1] - mp[a - 1][b] + mp[a - 1][a - 1])\n }\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "sample_input": "2 3 1\n1 1\n1 2\n2 2\n1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03283", "source_text": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1790, "cpu_time_ms": 414, "memory_kb": 8192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s664841132", "group_id": "codeNet:p03283", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\n)\n\nconst WIDTH = 502\nconst HEIGHT = 502\n\nvar nrs = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLineToInt() []int {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := nrs.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n line := strings.Split(string(buf), \" \")\n var intLine []int\n for _, str := range line {\n n, _ := strconv.Atoi(str)\n intLine = append(intLine, n)\n }\n return intLine\n}\n\nfunc main() {\n nmq := readLineToInt()\n _, m, q := nmq[0], nmq[1], nmq[2]\n var mp [HEIGHT][WIDTH]int\n\n for i := 0; i < m; i++ {\n lr := readLineToInt()\n l, r := lr[0], lr[1]\n mp[l][r] += 1\n }\n\n for x := 0; x < WIDTH - 1; x++ {\n mp[0][x] += mp[0][x + 1]\n }\n\n for y := 1; y < HEIGHT; y++ {\n for x := 0; x < WIDTH - 1; x++ {\n mp[y][x + 1] += mp[y][x]\n mp[y][x] += mp[y - 1][x]\n }\n }\n\n for i := 0; i < q; i++ {\n ab := readLineToInt()\n a, b := ab[0], ab[1]\n fmt.Println(mp[b][b] - mp[b][a - 1] - mp[a - 1][b] + mp[a - 1][a - 1])\n }\n}", "language": "Go", "metadata": {"date": 1548289583, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03283.html", "problem_id": "p03283", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03283/input.txt", "sample_output_relpath": "derived/input_output/data/p03283/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03283/Go/s664841132.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s664841132", "user_id": "u145035045"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\n)\n\nconst WIDTH = 502\nconst HEIGHT = 502\n\nvar nrs = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLineToInt() []int {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := nrs.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n line := strings.Split(string(buf), \" \")\n var intLine []int\n for _, str := range line {\n n, _ := strconv.Atoi(str)\n intLine = append(intLine, n)\n }\n return intLine\n}\n\nfunc main() {\n nmq := readLineToInt()\n _, m, q := nmq[0], nmq[1], nmq[2]\n var mp [HEIGHT][WIDTH]int\n\n for i := 0; i < m; i++ {\n lr := readLineToInt()\n l, r := lr[0], lr[1]\n mp[l][r] += 1\n }\n\n for x := 0; x < WIDTH - 1; x++ {\n mp[0][x] += mp[0][x + 1]\n }\n\n for y := 1; y < HEIGHT; y++ {\n for x := 0; x < WIDTH - 1; x++ {\n mp[y][x + 1] += mp[y][x]\n mp[y][x] += mp[y - 1][x]\n }\n }\n\n for i := 0; i < q; i++ {\n ab := readLineToInt()\n a, b := ab[0], ab[1]\n fmt.Println(mp[b][b] - mp[b][a - 1] - mp[a - 1][b] + mp[a - 1][a - 1])\n }\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "sample_input": "2 3 1\n1 1\n1 2\n2 2\n1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03283", "source_text": "Score: 400 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (it is possible that L_i = R_i).\nTakahashi the king is interested in the following Q matters:\n\nThe number of the trains that runs strictly within the section from City p_i to City q_i, that is, the number of trains j such that p_i \\leq L_j and R_j \\leq q_i.\n\nAlthough he is genius, this is too much data to process by himself. Find the answer for each of these Q queries to help him.\n\nConstraints\n\nN is an integer between 1 and 500 (inclusive).\n\nM is an integer between 1 and 200 \\ 000 (inclusive).\n\nQ is an integer between 1 and 100 \\ 000 (inclusive).\n\n1 \\leq L_i \\leq R_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq p_i \\leq q_i \\leq N (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\nL_1 R_1\nL_2 R_2\n:\nL_M R_M\np_1 q_1\np_2 q_2\n:\np_Q q_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the number of the trains that runs strictly within the section from City p_i to City q_i.\n\nSample Input 1\n\n2 3 1\n1 1\n1 2\n2 2\n1 2\n\nSample Output 1\n\n3\n\nAs all the trains runs within the section from City 1 to City 2, the answer to the only query is 3.\n\nSample Input 2\n\n10 3 2\n1 5\n2 8\n7 10\n1 7\n3 10\n\nSample Output 2\n\n1\n1\n\nThe first query is on the section from City 1 to 7. There is only one train that runs strictly within that section: Train 1.\nThe second query is on the section from City 3 to 10. There is only one train that runs strictly within that section: Train 3.\n\nSample Input 3\n\n10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n\nSample Output 3\n\n7\n9\n10\n6\n8\n9\n6\n7\n8\n10", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1257, "cpu_time_ms": 3160, "memory_kb": 20864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s034395861", "group_id": "codeNet:p03284", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tif n%k == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tfmt.Println(1)\n}\n", "language": "Go", "metadata": {"date": 1563199246, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03284.html", "problem_id": "p03284", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03284/input.txt", "sample_output_relpath": "derived/input_output/data/p03284/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03284/Go/s034395861.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s034395861", "user_id": "u461993794"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tif n%k == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tfmt.Println(1)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "sample_input": "7 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03284", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 137, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s416899622", "group_id": "codeNet:p03284", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tif n%k != 0 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tfmt.Println(0)\n}\n", "language": "Go", "metadata": {"date": 1551299215, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03284.html", "problem_id": "p03284", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03284/input.txt", "sample_output_relpath": "derived/input_output/data/p03284/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03284/Go/s416899622.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s416899622", "user_id": "u543933043"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tif n%k != 0 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tfmt.Println(0)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "sample_input": "7 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03284", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nConstraints\n\n1 \\leq N,K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.\n\nSample Input 1\n\n7 3\n\nSample Output 1\n\n1\n\nWhen the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.\n\nSample Input 2\n\n100 10\n\nSample Output 2\n\n0\n\nThe crackers can be distributed evenly.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 137, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s447648044", "group_id": "codeNet:p03285", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tfor i := 0; i <= 25; i++ {\n\t\tfor e :=0; e <= 15; e++ {\n\t\t\tsum := 4 * i + e * 7\n\t\t\tif sum == n {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n\n\n}", "language": "Go", "metadata": {"date": 1576691206, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03285.html", "problem_id": "p03285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03285/input.txt", "sample_output_relpath": "derived/input_output/data/p03285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03285/Go/s447648044.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s447648044", "user_id": "u078274014"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tfor i := 0; i <= 25; i++ {\n\t\tfor e :=0; e <= 15; e++ {\n\t\t\tsum := 4 * i + e * 7\n\t\t\tif sum == n {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "sample_input": "11\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03285", "source_text": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s792628073", "group_id": "codeNet:p03285", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tans := \"No\"\n\ta, b := N%4, N%7\n\tif a%7 == 0 || b%4 == 0 {\n\t\tans = \"Yes\"\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1572504046, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03285.html", "problem_id": "p03285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03285/input.txt", "sample_output_relpath": "derived/input_output/data/p03285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03285/Go/s792628073.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s792628073", "user_id": "u902409225"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tans := \"No\"\n\ta, b := N%4, N%7\n\tif a%7 == 0 || b%4 == 0 {\n\t\tans = \"Yes\"\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "sample_input": "11\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03285", "source_text": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 162, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448595793", "group_id": "codeNet:p03285", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tbuffsize := 1000000\n\tbuff := make([]byte, buffsize)\n\tsc.Buffer(buff, buffsize)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc loadint() (result int) {\n\tsc.Scan()\n\tresult, _ = strconv.Atoi(sc.Text())\n\treturn\n}\n\nfunc main() {\n\tn := loadint()\n\tvar j int\nEXIT:\n\tfor i := 0; i <= n; i += 4 {\n\t\tfor j = i; j <= n; j += 7 {\n\t\t\tif j == n {\n\t\t\t\tbreak EXIT\n\t\t\t}\n\t\t}\n\t}\n\tif j == n {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1538274234, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03285.html", "problem_id": "p03285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03285/input.txt", "sample_output_relpath": "derived/input_output/data/p03285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03285/Go/s448595793.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448595793", "user_id": "u808427016"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tbuffsize := 1000000\n\tbuff := make([]byte, buffsize)\n\tsc.Buffer(buff, buffsize)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc loadint() (result int) {\n\tsc.Scan()\n\tresult, _ = strconv.Atoi(sc.Text())\n\treturn\n}\n\nfunc main() {\n\tn := loadint()\n\tvar j int\nEXIT:\n\tfor i := 0; i <= n; i += 4 {\n\t\tfor j = i; j <= n; j += 7 {\n\t\t\tif j == n {\n\t\t\t\tbreak EXIT\n\t\t\t}\n\t\t}\n\t}\n\tif j == n {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "sample_input": "11\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03285", "source_text": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 542, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s557536622", "group_id": "codeNet:p03286", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getNextLine(scanner *bufio.Reader) string {\n\tvar buffer string\n\tfor {\n\t\tline, isPrefix, _ := scanner.ReadLine()\n\t\tbuffer += string(line)\n\t\tif isPrefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buffer\n}\n\nfunc getIntList(scanner *bufio.Reader) []int {\n\tlist := strings.Split(getNextLine(scanner), \" \")\n\tl := len(list)\n\tresult := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tresult[i], _ = strconv.Atoi(list[i])\n\t}\n\treturn result\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := bufio.NewReader(fp)\n\n\tvar n int\n\n\tfmt.Sscan(getNextLine(scanner), &n)\n\n\tif n == 0 {\n\t\tfmt.Println(\"0\")\n\t\treturn\n\t}\n\n\tans := \"\"\n\tbase := -2\n\tfor i := 1; n != 0; i *= base {\n\t\tbit := (n / i) % base\n\t\tbit = (bit + 2) % 2\n\t\tans = fmt.Sprintf(\"%d\", bit) + ans\n\t\tn -= bit * i\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1557717773, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03286.html", "problem_id": "p03286", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03286/input.txt", "sample_output_relpath": "derived/input_output/data/p03286/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03286/Go/s557536622.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s557536622", "user_id": "u150542210"}, "prompt_components": {"gold_output": "1011\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getNextLine(scanner *bufio.Reader) string {\n\tvar buffer string\n\tfor {\n\t\tline, isPrefix, _ := scanner.ReadLine()\n\t\tbuffer += string(line)\n\t\tif isPrefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buffer\n}\n\nfunc getIntList(scanner *bufio.Reader) []int {\n\tlist := strings.Split(getNextLine(scanner), \" \")\n\tl := len(list)\n\tresult := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tresult[i], _ = strconv.Atoi(list[i])\n\t}\n\treturn result\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := bufio.NewReader(fp)\n\n\tvar n int\n\n\tfmt.Sscan(getNextLine(scanner), &n)\n\n\tif n == 0 {\n\t\tfmt.Println(\"0\")\n\t\treturn\n\t}\n\n\tans := \"\"\n\tbase := -2\n\tfor i := 1; n != 0; i *= base {\n\t\tbit := (n / i) % base\n\t\tbit = (bit + 2) % 2\n\t\tans = fmt.Sprintf(\"%d\", bit) + ans\n\t\tn -= bit * i\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven an integer N, find the base -2 representation of N.\n\nHere, S is the base -2 representation of N when the following are all satisfied:\n\nS is a string consisting of 0 and 1.\n\nUnless S = 0, the initial character of S is 1.\n\nLet S = S_k S_{k-1} ... S_0, then S_0 \\times (-2)^0 + S_1 \\times (-2)^1 + ... + S_k \\times (-2)^k = N.\n\nIt can be proved that, for any integer M, the base -2 representation of M is uniquely determined.\n\nConstraints\n\nEvery value in input is integer.\n\n-10^9 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the base -2 representation of N.\n\nSample Input 1\n\n-9\n\nSample Output 1\n\n1011\n\nAs (-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9, 1011 is the base -2 representation of -9.\n\nSample Input 2\n\n123456789\n\nSample Output 2\n\n11000101011001101110100010101\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "-9\n"}, "reference_outputs": ["1011\n"], "source_document_id": "p03286", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven an integer N, find the base -2 representation of N.\n\nHere, S is the base -2 representation of N when the following are all satisfied:\n\nS is a string consisting of 0 and 1.\n\nUnless S = 0, the initial character of S is 1.\n\nLet S = S_k S_{k-1} ... S_0, then S_0 \\times (-2)^0 + S_1 \\times (-2)^1 + ... + S_k \\times (-2)^k = N.\n\nIt can be proved that, for any integer M, the base -2 representation of M is uniquely determined.\n\nConstraints\n\nEvery value in input is integer.\n\n-10^9 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the base -2 representation of N.\n\nSample Input 1\n\n-9\n\nSample Output 1\n\n1011\n\nAs (-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9, 1011 is the base -2 representation of -9.\n\nSample Input 2\n\n123456789\n\nSample Output 2\n\n11000101011001101110100010101\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 888, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s176863648", "group_id": "codeNet:p03286", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := IOInitialize()\n\tN := Int(s)\n\tl2 := []int{}\n\tfor i := 0; i <= 31; i++ {\n\t\tl2 = append(l2, pow(-2, i))\n\t}\n\tposSumLis := []int{}\n\tnegaSumLis := []int{}\n\tposSum := 0\n\tnegaSum := 0\n\tfor i, num := range l2 {\n\t\tif i == 0 {\n\t\t\tposSum += num\n\t\t\tposSumLis = append(posSumLis, posSum)\n\t\t\tcontinue\n\t\t}\n\t\tif i%2 == 0 {\n\t\t\tposSum += num\n\t\t\tposSumLis = append(posSumLis, posSum)\n\t\t} else {\n\t\t\tnegaSum += num\n\t\t\tnegaSumLis = append(negaSumLis, negaSum)\n\t\t}\n\t}\n\tif N == 0 {\n\t\tfmt.Println(\"0\")\n\t\treturn\n\t}\n\tindexes := getIndexes(N, l2, posSumLis, negaSumLis)\n\tmaxIndex := indexes[0]\n\tres := \"\"\n\tfor i := 0; i <= maxIndex; i++ {\n\t\tif isInSlice(indexes, i) {\n\t\t\tres = \"1\" + res\n\t\t} else {\n\t\t\tres = \"0\" + res\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n\nfunc isInSlice(slice []int, num int) bool {\n\tfor _, _num := range slice {\n\t\tif num == _num {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc serachIndex(N int, posSumLis []int, negaSumLis []int) int {\n\tvar index int\n\tif N > 0 {\n\t\tfor i, num := range posSumLis {\n\t\t\tif N == 1 {\n\t\t\t\tindex = 0\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif num >= N && posSumLis[i-1] < N {\n\t\t\t\tindex = i * 2\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i, num := range negaSumLis {\n\t\t\tif N == -1 || N == -2 {\n\t\t\t\tindex = 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif num <= N && posSumLis[i-1] > N {\n\t\t\t\tindex = i*2 + 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn index\n}\n\nfunc getIndexes(N int, l2 []int, posSumLis []int, negaSumLis []int) []int {\n\tindexes := []int{}\n\tindex := serachIndex(N, posSumLis, negaSumLis)\n\tindexes = append(indexes, index)\n\tif l2[index] == N {\n\t\treturn indexes\n\t}\n\t_indexes := getIndexes(N-l2[index], l2, posSumLis, negaSumLis)\n\tindexes = append(indexes, _indexes...)\n\treturn indexes\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc IOInitialize() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc Int(s *bufio.Scanner) int {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\tvalue, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(\"text to int error\")\n\t}\n\treturn value\n}\n", "language": "Go", "metadata": {"date": 1534040546, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03286.html", "problem_id": "p03286", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03286/input.txt", "sample_output_relpath": "derived/input_output/data/p03286/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03286/Go/s176863648.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s176863648", "user_id": "u029329478"}, "prompt_components": {"gold_output": "1011\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := IOInitialize()\n\tN := Int(s)\n\tl2 := []int{}\n\tfor i := 0; i <= 31; i++ {\n\t\tl2 = append(l2, pow(-2, i))\n\t}\n\tposSumLis := []int{}\n\tnegaSumLis := []int{}\n\tposSum := 0\n\tnegaSum := 0\n\tfor i, num := range l2 {\n\t\tif i == 0 {\n\t\t\tposSum += num\n\t\t\tposSumLis = append(posSumLis, posSum)\n\t\t\tcontinue\n\t\t}\n\t\tif i%2 == 0 {\n\t\t\tposSum += num\n\t\t\tposSumLis = append(posSumLis, posSum)\n\t\t} else {\n\t\t\tnegaSum += num\n\t\t\tnegaSumLis = append(negaSumLis, negaSum)\n\t\t}\n\t}\n\tif N == 0 {\n\t\tfmt.Println(\"0\")\n\t\treturn\n\t}\n\tindexes := getIndexes(N, l2, posSumLis, negaSumLis)\n\tmaxIndex := indexes[0]\n\tres := \"\"\n\tfor i := 0; i <= maxIndex; i++ {\n\t\tif isInSlice(indexes, i) {\n\t\t\tres = \"1\" + res\n\t\t} else {\n\t\t\tres = \"0\" + res\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n\nfunc isInSlice(slice []int, num int) bool {\n\tfor _, _num := range slice {\n\t\tif num == _num {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc serachIndex(N int, posSumLis []int, negaSumLis []int) int {\n\tvar index int\n\tif N > 0 {\n\t\tfor i, num := range posSumLis {\n\t\t\tif N == 1 {\n\t\t\t\tindex = 0\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif num >= N && posSumLis[i-1] < N {\n\t\t\t\tindex = i * 2\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i, num := range negaSumLis {\n\t\t\tif N == -1 || N == -2 {\n\t\t\t\tindex = 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif num <= N && posSumLis[i-1] > N {\n\t\t\t\tindex = i*2 + 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn index\n}\n\nfunc getIndexes(N int, l2 []int, posSumLis []int, negaSumLis []int) []int {\n\tindexes := []int{}\n\tindex := serachIndex(N, posSumLis, negaSumLis)\n\tindexes = append(indexes, index)\n\tif l2[index] == N {\n\t\treturn indexes\n\t}\n\t_indexes := getIndexes(N-l2[index], l2, posSumLis, negaSumLis)\n\tindexes = append(indexes, _indexes...)\n\treturn indexes\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc IOInitialize() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc Int(s *bufio.Scanner) int {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\tvalue, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(\"text to int error\")\n\t}\n\treturn value\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven an integer N, find the base -2 representation of N.\n\nHere, S is the base -2 representation of N when the following are all satisfied:\n\nS is a string consisting of 0 and 1.\n\nUnless S = 0, the initial character of S is 1.\n\nLet S = S_k S_{k-1} ... S_0, then S_0 \\times (-2)^0 + S_1 \\times (-2)^1 + ... + S_k \\times (-2)^k = N.\n\nIt can be proved that, for any integer M, the base -2 representation of M is uniquely determined.\n\nConstraints\n\nEvery value in input is integer.\n\n-10^9 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the base -2 representation of N.\n\nSample Input 1\n\n-9\n\nSample Output 1\n\n1011\n\nAs (-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9, 1011 is the base -2 representation of -9.\n\nSample Input 2\n\n123456789\n\nSample Output 2\n\n11000101011001101110100010101\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "-9\n"}, "reference_outputs": ["1011\n"], "source_document_id": "p03286", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven an integer N, find the base -2 representation of N.\n\nHere, S is the base -2 representation of N when the following are all satisfied:\n\nS is a string consisting of 0 and 1.\n\nUnless S = 0, the initial character of S is 1.\n\nLet S = S_k S_{k-1} ... S_0, then S_0 \\times (-2)^0 + S_1 \\times (-2)^1 + ... + S_k \\times (-2)^k = N.\n\nIt can be proved that, for any integer M, the base -2 representation of M is uniquely determined.\n\nConstraints\n\nEvery value in input is integer.\n\n-10^9 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the base -2 representation of N.\n\nSample Input 1\n\n-9\n\nSample Output 1\n\n1011\n\nAs (-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9, 1011 is the base -2 representation of -9.\n\nSample Input 2\n\n123456789\n\nSample Output 2\n\n11000101011001101110100010101\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2083, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s113316522", "group_id": "codeNet:p03289", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\nfunc count(s string, r rune) int {\n\treturn count_range(s, r, 0, len(s))\n}\n\nfunc count_range(s string, r rune, from, to int) int {\n\tvar cnt int\n\tfor _, v := range s[from:to] {\n\t\tif v == r {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\nfunc count_lowers(s string) int {\n\tvar cnt int\n\tfor _, v := range s {\n\t\tif unicode.IsLower(v) {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif s[0] == 'A' && count(s, 'C') == 1 && count_range(s, 'C', 2, len(s)-1) == 1 &&\n\t\tcount(s, 'A') == 1 && count_lowers(s) == len(s)-2 {\n\t\tfmt.Println(\"AC\")\n\t} else {\n\t\tfmt.Println(\"WA\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1548624710, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03289.html", "problem_id": "p03289", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03289/input.txt", "sample_output_relpath": "derived/input_output/data/p03289/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03289/Go/s113316522.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s113316522", "user_id": "u113872560"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\nfunc count(s string, r rune) int {\n\treturn count_range(s, r, 0, len(s))\n}\n\nfunc count_range(s string, r rune, from, to int) int {\n\tvar cnt int\n\tfor _, v := range s[from:to] {\n\t\tif v == r {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\nfunc count_lowers(s string) int {\n\tvar cnt int\n\tfor _, v := range s {\n\t\tif unicode.IsLower(v) {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif s[0] == 'A' && count(s, 'C') == 1 && count_range(s, 'C', 2, len(s)-1) == 1 &&\n\t\tcount(s, 'A') == 1 && count_lowers(s) == len(s)-2 {\n\t\tfmt.Println(\"AC\")\n\t} else {\n\t\tfmt.Println(\"WA\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "sample_input": "AtCoder\n"}, "reference_outputs": ["AC\n"], "source_document_id": "p03289", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 624, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s296157318", "group_id": "codeNet:p03289", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tvar str string\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%s\", &str)\n\tchars := strings.Split(str, \"\")\n\n\tans := true\n\tcond2 := false\n\tfor i := 0; i < len(chars); i++ {\n\t\tif i == 0 {\n\t\t\tif chars[i] != \"A\" {\n\t\t\t\tans = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif 2 <= i && i <= len(chars)-2 {\n\t\t\tif chars[i] == \"C\" && !cond2 {\n\t\t\t\tcond2 = true\n\t\t\t\tcontinue\n\t\t\t} else if chars[i] == \"C\" && cond2 {\n\t\t\t\tans = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif strings.ToLower(chars[i]) != chars[i] {\n\t\t\tans = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ans && cond2 {\n\t\tfmt.Println(\"AC\")\n\t} else {\n\t\tfmt.Println(\"WA\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1547695286, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03289.html", "problem_id": "p03289", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03289/input.txt", "sample_output_relpath": "derived/input_output/data/p03289/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03289/Go/s296157318.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s296157318", "user_id": "u381572327"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tvar str string\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%s\", &str)\n\tchars := strings.Split(str, \"\")\n\n\tans := true\n\tcond2 := false\n\tfor i := 0; i < len(chars); i++ {\n\t\tif i == 0 {\n\t\t\tif chars[i] != \"A\" {\n\t\t\t\tans = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif 2 <= i && i <= len(chars)-2 {\n\t\t\tif chars[i] == \"C\" && !cond2 {\n\t\t\t\tcond2 = true\n\t\t\t\tcontinue\n\t\t\t} else if chars[i] == \"C\" && cond2 {\n\t\t\t\tans = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif strings.ToLower(chars[i]) != chars[i] {\n\t\t\tans = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ans && cond2 {\n\t\tfmt.Println(\"AC\")\n\t} else {\n\t\tfmt.Println(\"WA\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "sample_input": "AtCoder\n"}, "reference_outputs": ["AC\n"], "source_document_id": "p03289", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 692, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s696699335", "group_id": "codeNet:p03293", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tS, T := sc.nextRuneSlice(), sc.nextRuneSlice()\n\tlength := len(S)\n\tcount := 0\n\tfor count <= length {\n\t\tif string(S) == string(T) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t\tfirst := S[0]\n\t\tS = S[1:]\n\t\tS = append(S, first)\n\t\tcount++\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1573657295, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03293.html", "problem_id": "p03293", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03293/input.txt", "sample_output_relpath": "derived/input_output/data/p03293/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03293/Go/s696699335.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s696699335", "user_id": "u924691798"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tS, T := sc.nextRuneSlice(), sc.nextRuneSlice()\n\tlength := len(S)\n\tcount := 0\n\tfor count <= length {\n\t\tif string(S) == string(T) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t\tfirst := S[0]\n\t\tS = S[1:]\n\t\tS = append(S, first)\n\t\tcount++\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "sample_input": "kyoto\ntokyo\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03293", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 939, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s141644205", "group_id": "codeNet:p03294", "input_text": "package main\nimport \"fmt\"\n\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\treturn gcd(b, a%b)\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar a []int\n\tvar ans int64 = 0\n\tfor i := 0; i < n; i++ {\n\t\tvar v int\n\t\tfmt.Scan(&v)\n\t\ta = append(a, v)\n\t}\n\n\tvar g int = 1\n\tfor _, v := range a{\n\t\tg = gcd(g, v)\n\t}\n\n\tfor _, v := range a{\n\t\tans += int64(v / g -1)\n\t}\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1532225994, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03294.html", "problem_id": "p03294", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03294/input.txt", "sample_output_relpath": "derived/input_output/data/p03294/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03294/Go/s141644205.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s141644205", "user_id": "u085110627"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\treturn gcd(b, a%b)\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar a []int\n\tvar ans int64 = 0\n\tfor i := 0; i < n; i++ {\n\t\tvar v int\n\t\tfmt.Scan(&v)\n\t\ta = append(a, v)\n\t}\n\n\tvar g int = 1\n\tfor _, v := range a{\n\t\tg = gcd(g, v)\n\t}\n\n\tfor _, v := range a{\n\t\tans += int64(v / g -1)\n\t}\n\n\tfmt.Println(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given N positive integers a_1, a_2, ..., a_N.\n\nFor a non-negative integer m, let f(m) = (m\\ mod\\ a_1) + (m\\ mod\\ a_2) + ... + (m\\ mod\\ a_N).\n\nHere, X\\ mod\\ Y denotes the remainder of the division of X by Y.\n\nFind the maximum value of f.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 3000\n\n2 \\leq a_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum value of f.\n\nSample Input 1\n\n3\n3 4 6\n\nSample Output 1\n\n10\n\nf(11) = (11\\ mod\\ 3) + (11\\ mod\\ 4) + (11\\ mod\\ 6) = 10 is the maximum value of f.\n\nSample Input 2\n\n5\n7 46 11 20 11\n\nSample Output 2\n\n90\n\nSample Input 3\n\n7\n994 518 941 851 647 2 581\n\nSample Output 3\n\n4527", "sample_input": "3\n3 4 6\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03294", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given N positive integers a_1, a_2, ..., a_N.\n\nFor a non-negative integer m, let f(m) = (m\\ mod\\ a_1) + (m\\ mod\\ a_2) + ... + (m\\ mod\\ a_N).\n\nHere, X\\ mod\\ Y denotes the remainder of the division of X by Y.\n\nFind the maximum value of f.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 3000\n\n2 \\leq a_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum value of f.\n\nSample Input 1\n\n3\n3 4 6\n\nSample Output 1\n\n10\n\nf(11) = (11\\ mod\\ 3) + (11\\ mod\\ 4) + (11\\ mod\\ 6) = 10 is the maximum value of f.\n\nSample Input 2\n\n5\n7 46 11 20 11\n\nSample Output 2\n\n90\n\nSample Input 3\n\n7\n994 518 941 851 647 2 581\n\nSample Output 3\n\n4527", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 378, "cpu_time_ms": 15, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s244063238", "group_id": "codeNet:p03295", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype AB struct {\n\tA int\n\tB int\n}\n\ntype ABS []AB\n\nfunc (abs ABS) Len() int {\n\treturn len(abs)\n}\n\nfunc (abs ABS) Swap(i, j int) {\n\tabs[i], abs[j] = abs[j], abs[i]\n}\n\nfunc (abs ABS) Less(i, j int) bool {\n\treturn abs[i].B < abs[j].B\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\tslice := make([]AB, m)\n\tfor i := 0; i < m; i++ {\n\t\tslice[i] = AB{A: nextInt(), B: nextInt()}\n\t}\n\tn++\n\n\tsort.Sort(ABS(slice))\n\n\tres := 0\n\tend := 0 // 最後に選んだ島の位置\n\tfor i := 0; i < m; i++ {\n\t\tif slice[i].A >= end {\n\t\t\tend = slice[i].B\n\t\t\tres++\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1563902544, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03295.html", "problem_id": "p03295", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03295/input.txt", "sample_output_relpath": "derived/input_output/data/p03295/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03295/Go/s244063238.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s244063238", "user_id": "u710190793"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype AB struct {\n\tA int\n\tB int\n}\n\ntype ABS []AB\n\nfunc (abs ABS) Len() int {\n\treturn len(abs)\n}\n\nfunc (abs ABS) Swap(i, j int) {\n\tabs[i], abs[j] = abs[j], abs[i]\n}\n\nfunc (abs ABS) Less(i, j int) bool {\n\treturn abs[i].B < abs[j].B\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\tslice := make([]AB, m)\n\tfor i := 0; i < m; i++ {\n\t\tslice[i] = AB{A: nextInt(), B: nextInt()}\n\t}\n\tn++\n\n\tsort.Sort(ABS(slice))\n\n\tres := 0\n\tend := 0 // 最後に選んだ島の位置\n\tfor i := 0; i < m; i++ {\n\t\tif slice[i].A >= end {\n\t\t\tend = slice[i].B\n\t\t\tres++\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "sample_input": "5 2\n1 4\n2 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03295", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 804, "cpu_time_ms": 58, "memory_kb": 3456}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s882283596", "group_id": "codeNet:p03296", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\n////////////////////////////////////////\n/// templates ///\n////////////////////////////////////////\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() string {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := rdr.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}\n\nfunc strSprit(str string) []string {\n cols := strings.Split(str, \" \")\n return cols\n}\n\nfunc parseInt(str string) int {\n n, _ := strconv.Atoi(str)\n return n\n}\n\nfunc intSprit(str string) []int {\n strs := strSprit(str)\n cols := make([]int, len(strs))\n for i, v := range strs {\n cols[i] = parseInt(v)\n }\n return cols\n}\n\ntype SortSlice []int\n\nfunc (s SortSlice) Len() int {\n return len(s)\n}\n\nfunc (s SortSlice) Swap(i, j int) {\n s[i], s[j] = s[j], s[i]\n}\n\nfunc (s SortSlice) Less(i, j int) bool {\n return s[i] < s[j]\n}\n\nfunc reverseString(str string) string {\n buf := []rune(str)\n for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 {\n buf[i], buf[j] = buf[j], buf[i]\n }\n return string(buf)\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\n\nfunc countLen(i int, a []int) int {\n r := 1\n for t := i; t < len(a)-1; t++ {\n if a[t] != a[t+1] {\n break\n }\n r++\n }\n return r\n}\n\nfunc main() {\n line := nextLine()\n N := parseInt(line)\n\n line = nextLine()\n spl := strSprit(line)\n\n a := make([]int, N)\n\n for i := 0; i < N; i++ {\n a[i] = parseInt(spl[i])\n }\n\n idx := 0\n c := 0\n for idx < N-1 {\n if a[idx] == a[idx+1] {\n d := countLen(idx, a)\n idx += d - 1\n c += d / 2\n }\n idx++\n }\n fmt.Println(c)\n\n}\n\n", "language": "Go", "metadata": {"date": 1531618607, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03296.html", "problem_id": "p03296", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03296/input.txt", "sample_output_relpath": "derived/input_output/data/p03296/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03296/Go/s882283596.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s882283596", "user_id": "u925392563"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\n////////////////////////////////////////\n/// templates ///\n////////////////////////////////////////\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() string {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := rdr.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}\n\nfunc strSprit(str string) []string {\n cols := strings.Split(str, \" \")\n return cols\n}\n\nfunc parseInt(str string) int {\n n, _ := strconv.Atoi(str)\n return n\n}\n\nfunc intSprit(str string) []int {\n strs := strSprit(str)\n cols := make([]int, len(strs))\n for i, v := range strs {\n cols[i] = parseInt(v)\n }\n return cols\n}\n\ntype SortSlice []int\n\nfunc (s SortSlice) Len() int {\n return len(s)\n}\n\nfunc (s SortSlice) Swap(i, j int) {\n s[i], s[j] = s[j], s[i]\n}\n\nfunc (s SortSlice) Less(i, j int) bool {\n return s[i] < s[j]\n}\n\nfunc reverseString(str string) string {\n buf := []rune(str)\n for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 {\n buf[i], buf[j] = buf[j], buf[i]\n }\n return string(buf)\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\n\nfunc countLen(i int, a []int) int {\n r := 1\n for t := i; t < len(a)-1; t++ {\n if a[t] != a[t+1] {\n break\n }\n r++\n }\n return r\n}\n\nfunc main() {\n line := nextLine()\n N := parseInt(line)\n\n line = nextLine()\n spl := strSprit(line)\n\n a := make([]int, N)\n\n for i := 0; i < N; i++ {\n a[i] = parseInt(spl[i])\n }\n\n idx := 0\n c := 0\n for idx < N-1 {\n if a[idx] == a[idx+1] {\n d := countLen(idx, a)\n idx += d - 1\n c += d / 2\n }\n idx++\n }\n fmt.Println(c)\n\n}\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.\n\nTakahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i.\nIf two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.\n\nTakahashi can change the color of one slime to any of the 10000 colors by one spell.\nHow many spells are required so that no slimes will start to combine themselves?\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq a_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of spells required.\n\nSample Input 1\n\n5\n1 1 2 2 2\n\nSample Output 1\n\n2\n\nFor example, if we change the color of the second slime from the left to 4, and the color of the fourth slime to 5, the colors of the slimes will be 1, 4, 2, 5, 2, which satisfy the condition.\n\nSample Input 2\n\n3\n1 2 1\n\nSample Output 2\n\n0\n\nAlthough the colors of the first and third slimes are the same, they are not adjacent, so no spell is required.\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n2\n\nFor example, if we change the colors of the second and fourth slimes from the left to 2, the colors of the slimes will be 1, 2, 1, 2, 1, which satisfy the condition.\n\nSample Input 4\n\n14\n1 2 2 3 3 3 4 4 4 4 1 2 3 4\n\nSample Output 4\n\n4", "sample_input": "5\n1 1 2 2 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03296", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.\n\nTakahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i.\nIf two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.\n\nTakahashi can change the color of one slime to any of the 10000 colors by one spell.\nHow many spells are required so that no slimes will start to combine themselves?\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq a_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of spells required.\n\nSample Input 1\n\n5\n1 1 2 2 2\n\nSample Output 1\n\n2\n\nFor example, if we change the color of the second slime from the left to 4, and the color of the fourth slime to 5, the colors of the slimes will be 1, 4, 2, 5, 2, which satisfy the condition.\n\nSample Input 2\n\n3\n1 2 1\n\nSample Output 2\n\n0\n\nAlthough the colors of the first and third slimes are the same, they are not adjacent, so no spell is required.\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n2\n\nFor example, if we change the colors of the second and fourth slimes from the left to 2, the colors of the slimes will be 1, 2, 1, 2, 1, which satisfy the condition.\n\nSample Input 4\n\n14\n1 2 2 3 3 3 4 4 4 4 1 2 3 4\n\nSample Output 4\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2452, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s126830125", "group_id": "codeNet:p03297", "input_text": "package main\nimport \"fmt\"\nfunc main() {\n var t int\n var a,b,c,d int64\n fmt.Scan(&t)\n for i:=0;i= 0; i-- {\n\t\tco[i] = min(co[i], co[i+1])\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(1e15 - co[i])\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc dijkstra(g [][]Edge, from int) []int {\n\tn := len(g)\n\td := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\td[i] = 1e15\n\t}\n\n\tvar pq PriorityQueue\n\theap.Init(&pq)\n\n\theap.Push(&pq, &Item{pos: from, cost: 0})\n\td[from] = 0\n\n\tfor len(pq) > 0 {\n\t\ts := heap.Pop(&pq).(*Item)\n\t\tif d[s.pos] < s.cost {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e := range g[s.pos] {\n\t\t\tif d[e.to] > s.cost+e.cost {\n\t\t\t\td[e.to] = s.cost + e.cost\n\t\t\t\theap.Push(&pq, &Item{pos: e.to, cost: d[e.to]})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn d\n}\n\n// Edge .\ntype Edge struct {\n\tto, cost int\n}\n\n// https://golang.org/pkg/container/heap/\n\n// An Item is something we manage in a priority queue.\ntype Item struct {\n\tpos int // The value of the item; arbitrary.\n\tcost int // The priority of the item in the queue.\n\t// The index is needed by update and is maintained by the heap.Interface methods.\n\tindex int // The index of the item in the heap.\n}\n\n// A PriorityQueue implements heap.Interface and holds Items.\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// We want Pop to give us the highest, not lowest, priority so we use greater than here.\n\treturn pq[i].cost < pq[j].cost\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\n// Push .\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\n// Pop .\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1579989452, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03305.html", "problem_id": "p03305", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03305/input.txt", "sample_output_relpath": "derived/input_output/data/p03305/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03305/Go/s383369976.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s383369976", "user_id": "u902409225"}, "prompt_components": {"gold_output": "999999999999998\n999999999999989\n999999999999979\n999999999999897\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\n\tvar n, m, s, t int\n\tfmt.Scan(&n, &m, &s, &t)\n\ts, t = s-1, t-1\n\n\tgy := make([][]Edge, n)\n\tgs := make([][]Edge, n)\n\tfor i := 0; i < n; i++ {\n\t\tgy[i] = make([]Edge, 0)\n\t\tgs[i] = make([]Edge, 0)\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tu, v, a, b := nextInt()-1, nextInt()-1, nextInt(), nextInt()\n\t\tgy[u] = append(gy[u], Edge{to: v, cost: a})\n\t\tgy[v] = append(gy[v], Edge{to: u, cost: a})\n\t\tgs[u] = append(gs[u], Edge{to: v, cost: b})\n\t\tgs[v] = append(gs[v], Edge{to: u, cost: b})\n\t}\n\n\tcy := dijkstra(gy, s)\n\tcs := dijkstra(gs, t)\n\tco := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tco[i] = cy[i] + cs[i]\n\t}\n\tfor i := n - 2; i >= 0; i-- {\n\t\tco[i] = min(co[i], co[i+1])\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(1e15 - co[i])\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc dijkstra(g [][]Edge, from int) []int {\n\tn := len(g)\n\td := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\td[i] = 1e15\n\t}\n\n\tvar pq PriorityQueue\n\theap.Init(&pq)\n\n\theap.Push(&pq, &Item{pos: from, cost: 0})\n\td[from] = 0\n\n\tfor len(pq) > 0 {\n\t\ts := heap.Pop(&pq).(*Item)\n\t\tif d[s.pos] < s.cost {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e := range g[s.pos] {\n\t\t\tif d[e.to] > s.cost+e.cost {\n\t\t\t\td[e.to] = s.cost + e.cost\n\t\t\t\theap.Push(&pq, &Item{pos: e.to, cost: d[e.to]})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn d\n}\n\n// Edge .\ntype Edge struct {\n\tto, cost int\n}\n\n// https://golang.org/pkg/container/heap/\n\n// An Item is something we manage in a priority queue.\ntype Item struct {\n\tpos int // The value of the item; arbitrary.\n\tcost int // The priority of the item in the queue.\n\t// The index is needed by update and is maintained by the heap.Interface methods.\n\tindex int // The index of the item in the heap.\n}\n\n// A PriorityQueue implements heap.Interface and holds Items.\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// We want Pop to give us the highest, not lowest, priority so we use greater than here.\n\treturn pq[i].cost < pq[j].cost\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\n// Push .\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\n// Pop .\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nKenkoooo is planning a trip in Republic of Snuke.\nIn this country, there are n cities and m trains running.\nThe cities are numbered 1 through n, and the i-th train connects City u_i and v_i bidirectionally.\nAny city can be reached from any city by changing trains.\n\nTwo currencies are used in the country: yen and snuuk.\nAny train fare can be paid by both yen and snuuk.\nThe fare of the i-th train is a_i yen if paid in yen, and b_i snuuk if paid in snuuk.\n\nIn a city with a money exchange office, you can change 1 yen into 1 snuuk.\nHowever, when you do a money exchange, you have to change all your yen into snuuk.\nThat is, if Kenkoooo does a money exchange when he has X yen, he will then have X snuuk.\nCurrently, there is a money exchange office in every city, but the office in City i will shut down in i years and can never be used in and after that year.\n\nKenkoooo is planning to depart City s with 10^{15} yen in his pocket and head for City t, and change his yen into snuuk in some city while traveling.\nIt is acceptable to do the exchange in City s or City t.\n\nKenkoooo would like to have as much snuuk as possible when he reaches City t by making the optimal choices for the route to travel and the city to do the exchange.\nFor each i=0,...,n-1, find the maximum amount of snuuk that Kenkoooo has when he reaches City t if he goes on a trip from City s to City t after i years.\nYou can assume that the trip finishes within the year.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n1 \\leq m \\leq 10^5\n\n1 \\leq s,t \\leq n\n\ns \\neq t\n\n1 \\leq u_i < v_i \\leq n\n\n1 \\leq a_i,b_i \\leq 10^9\n\nIf i\\neq j, then u_i \\neq u_j or v_i \\neq v_j.\n\nAny city can be reached from any city by changing trains.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m s t\nu_1 v_1 a_1 b_1\n:\nu_m v_m a_m b_m\n\nOutput\n\nPrint n lines.\nIn the i-th line, print the maximum amount of snuuk that Kenkoooo has when he reaches City t if he goes on a trip from City s to City t after i-1 years.\n\nSample Input 1\n\n4 3 2 3\n1 4 1 100\n1 2 1 10\n1 3 20 1\n\nSample Output 1\n\n999999999999998\n999999999999989\n999999999999979\n999999999999897\n\nAfter 0 years, it is optimal to do the exchange in City 1.\n\nAfter 1 years, it is optimal to do the exchange in City 2.\n\nNote that City 1 can still be visited even after the exchange office is closed.\nAlso note that, if it was allowed to keep 1 yen when do the exchange in City 2 and change the remaining yen into snuuk, we could reach City 3 with 999999999999998 snuuk, but this is NOT allowed.\n\nAfter 2 years, it is optimal to do the exchange in City 3.\n\nAfter 3 years, it is optimal to do the exchange in City 4.\nNote that the same train can be used multiple times.\n\nSample Input 2\n\n8 12 3 8\n2 8 685087149 857180777\n6 7 298270585 209942236\n2 4 346080035 234079976\n2 5 131857300 22507157\n4 8 30723332 173476334\n2 6 480845267 448565596\n1 4 181424400 548830121\n4 5 57429995 195056405\n7 8 160277628 479932440\n1 6 475692952 203530153\n3 5 336869679 160714712\n2 7 389775999 199123879\n\nSample Output 2\n\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994", "sample_input": "4 3 2 3\n1 4 1 100\n1 2 1 10\n1 3 20 1\n"}, "reference_outputs": ["999999999999998\n999999999999989\n999999999999979\n999999999999897\n"], "source_document_id": "p03305", "source_text": "Score : 400 points\n\nProblem Statement\n\nKenkoooo is planning a trip in Republic of Snuke.\nIn this country, there are n cities and m trains running.\nThe cities are numbered 1 through n, and the i-th train connects City u_i and v_i bidirectionally.\nAny city can be reached from any city by changing trains.\n\nTwo currencies are used in the country: yen and snuuk.\nAny train fare can be paid by both yen and snuuk.\nThe fare of the i-th train is a_i yen if paid in yen, and b_i snuuk if paid in snuuk.\n\nIn a city with a money exchange office, you can change 1 yen into 1 snuuk.\nHowever, when you do a money exchange, you have to change all your yen into snuuk.\nThat is, if Kenkoooo does a money exchange when he has X yen, he will then have X snuuk.\nCurrently, there is a money exchange office in every city, but the office in City i will shut down in i years and can never be used in and after that year.\n\nKenkoooo is planning to depart City s with 10^{15} yen in his pocket and head for City t, and change his yen into snuuk in some city while traveling.\nIt is acceptable to do the exchange in City s or City t.\n\nKenkoooo would like to have as much snuuk as possible when he reaches City t by making the optimal choices for the route to travel and the city to do the exchange.\nFor each i=0,...,n-1, find the maximum amount of snuuk that Kenkoooo has when he reaches City t if he goes on a trip from City s to City t after i years.\nYou can assume that the trip finishes within the year.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n1 \\leq m \\leq 10^5\n\n1 \\leq s,t \\leq n\n\ns \\neq t\n\n1 \\leq u_i < v_i \\leq n\n\n1 \\leq a_i,b_i \\leq 10^9\n\nIf i\\neq j, then u_i \\neq u_j or v_i \\neq v_j.\n\nAny city can be reached from any city by changing trains.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m s t\nu_1 v_1 a_1 b_1\n:\nu_m v_m a_m b_m\n\nOutput\n\nPrint n lines.\nIn the i-th line, print the maximum amount of snuuk that Kenkoooo has when he reaches City t if he goes on a trip from City s to City t after i-1 years.\n\nSample Input 1\n\n4 3 2 3\n1 4 1 100\n1 2 1 10\n1 3 20 1\n\nSample Output 1\n\n999999999999998\n999999999999989\n999999999999979\n999999999999897\n\nAfter 0 years, it is optimal to do the exchange in City 1.\n\nAfter 1 years, it is optimal to do the exchange in City 2.\n\nNote that City 1 can still be visited even after the exchange office is closed.\nAlso note that, if it was allowed to keep 1 yen when do the exchange in City 2 and change the remaining yen into snuuk, we could reach City 3 with 999999999999998 snuuk, but this is NOT allowed.\n\nAfter 2 years, it is optimal to do the exchange in City 3.\n\nAfter 3 years, it is optimal to do the exchange in City 4.\nNote that the same train can be used multiple times.\n\nSample Input 2\n\n8 12 3 8\n2 8 685087149 857180777\n6 7 298270585 209942236\n2 4 346080035 234079976\n2 5 131857300 22507157\n4 8 30723332 173476334\n2 6 480845267 448565596\n1 4 181424400 548830121\n4 5 57429995 195056405\n7 8 160277628 479932440\n1 6 475692952 203530153\n3 5 336869679 160714712\n2 7 389775999 199123879\n\nSample Output 2\n\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994\n999999574976994", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2741, "cpu_time_ms": 513, "memory_kb": 27264}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s828994912", "group_id": "codeNet:p03307", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%2 == 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tfmt.Println(n * 2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1569210301, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03307.html", "problem_id": "p03307", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03307/input.txt", "sample_output_relpath": "derived/input_output/data/p03307/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03307/Go/s828994912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s828994912", "user_id": "u117348081"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%2 == 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tfmt.Println(n * 2)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03307", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 135, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s820017061", "group_id": "codeNet:p03309", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc vi(n int, args ...int) []int {\n\tres := make([]int, n)\n\tif len(args) == 0 {\n\t\treturn res\n\t}\n\tv := args[0]\n\tif v == 0 {\n\t\treturn res\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = v\n\t}\n\treturn res\n}\n\nfunc vvi(n int, args ...int) [][]int {\n\tres := make([][]int, n)\n\tm := n\n\tif len(args) > 0 {\n\t\tm = args[0]\n\t}\n\tv := 0\n\tif len(args) > 1 {\n\t\tv = args[1]\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = vi(m, v)\n\t}\n\treturn res\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\ta := make([]int64, n)\n\tavg := float64(0)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt64() - int64(i+1)\n\t\tavg += float64(a[i]) / float64(n)\n\t}\n\tvar ans uint64 = math.MaxUint64\nouter:\n\tfor i := int64(avg - 100); i < int64(avg+100); i++ {\n\t\tb := make([]int64, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tb[j] = abs(a[j] - i)\n\t\t}\n\t\tvar sum uint64\n\t\tfor j := 0; j < n; j++ {\n\t\t\ttmp := sum + uint64(b[j])\n\t\t\tif tmp < sum {\n\t\t\t\tcontinue outer\n\t\t\t}\n\t\t\tsum = tmp\n\t\t}\n\t\tif sum < ans {\n\t\t\tans = sum\n\t\t}\n\t}\n\n\tprintln(uint64(ans))\n\n}\n", "language": "Go", "metadata": {"date": 1530495065, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03309.html", "problem_id": "p03309", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03309/input.txt", "sample_output_relpath": "derived/input_output/data/p03309/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03309/Go/s820017061.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s820017061", "user_id": "u705974985"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc vi(n int, args ...int) []int {\n\tres := make([]int, n)\n\tif len(args) == 0 {\n\t\treturn res\n\t}\n\tv := args[0]\n\tif v == 0 {\n\t\treturn res\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = v\n\t}\n\treturn res\n}\n\nfunc vvi(n int, args ...int) [][]int {\n\tres := make([][]int, n)\n\tm := n\n\tif len(args) > 0 {\n\t\tm = args[0]\n\t}\n\tv := 0\n\tif len(args) > 1 {\n\t\tv = args[1]\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = vi(m, v)\n\t}\n\treturn res\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\ta := make([]int64, n)\n\tavg := float64(0)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt64() - int64(i+1)\n\t\tavg += float64(a[i]) / float64(n)\n\t}\n\tvar ans uint64 = math.MaxUint64\nouter:\n\tfor i := int64(avg - 100); i < int64(avg+100); i++ {\n\t\tb := make([]int64, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tb[j] = abs(a[j] - i)\n\t\t}\n\t\tvar sum uint64\n\t\tfor j := 0; j < n; j++ {\n\t\t\ttmp := sum + uint64(b[j])\n\t\t\tif tmp < sum {\n\t\t\t\tcontinue outer\n\t\t\t}\n\t\t\tsum = tmp\n\t\t}\n\t\tif sum < ans {\n\t\t\tans = sum\n\t\t}\n\t}\n\n\tprintln(uint64(ans))\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "sample_input": "5\n2 2 3 5 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03309", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2302, "cpu_time_ms": 390, "memory_kb": 19200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s066972797", "group_id": "codeNet:p03316", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value is EQUAL TO AND LARGER THAN A KEY VALUE.\nfunc LowerBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value is EQUAL TO AND SMALLER THAN A KEY VALUE.\nfunc UpperBound(s []int, key int) int {\n\tisSmaller := func(index, key int) bool {\n\t\tif s[index] <= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isSmaller(mid, key) {\n\t\t\tleft = mid\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t}\n\n\treturn left\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 0 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\tif n == 1 {\n\t\treturn map[int]int{1: 1}\n\t}\n\n\tp := map[int]int{}\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nvar n int\n\nfunc main() {\n\tn = ReadInt()\n\tsn := sub(n)\n\tif n%sn == 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc sub(n int) int {\n\tres := 0\n\tfor n != 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1546747326, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03316.html", "problem_id": "p03316", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03316/input.txt", "sample_output_relpath": "derived/input_output/data/p03316/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03316/Go/s066972797.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s066972797", "user_id": "u103600314"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value is EQUAL TO AND LARGER THAN A KEY VALUE.\nfunc LowerBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value is EQUAL TO AND SMALLER THAN A KEY VALUE.\nfunc UpperBound(s []int, key int) int {\n\tisSmaller := func(index, key int) bool {\n\t\tif s[index] <= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isSmaller(mid, key) {\n\t\t\tleft = mid\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t}\n\n\treturn left\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 0 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\tif n == 1 {\n\t\treturn map[int]int{1: 1}\n\t}\n\n\tp := map[int]int{}\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nvar n int\n\nfunc main() {\n\tn = ReadInt()\n\tsn := sub(n)\n\tif n%sn == 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc sub(n int) int {\n\tres := 0\n\tfor n != 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\treturn res\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(101) = 1 + 0 + 1 = 2.\n\nGiven an integer N, determine if S(N) divides N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf S(N) divides N, print Yes; if it does not, print No.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nIn this input, N=12.\nAs S(12) = 1 + 2 = 3, S(N) divides N.\n\nSample Input 2\n\n101\n\nSample Output 2\n\nNo\n\nAs S(101) = 1 + 0 + 1 = 2, S(N) does not divide N.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\nYes", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03316", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(101) = 1 + 0 + 1 = 2.\n\nGiven an integer N, determine if S(N) divides N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf S(N) divides N, print Yes; if it does not, print No.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nIn this input, N=12.\nAs S(12) = 1 + 2 = 3, S(N) divides N.\n\nSample Input 2\n\n101\n\nSample Output 2\n\nNo\n\nAs S(101) = 1 + 0 + 1 = 2, S(N) does not divide N.\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6415, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s084348736", "group_id": "codeNet:p03317", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value is EQUAL TO AND LARGER THAN A KEY VALUE.\nfunc LowerBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value is EQUAL TO AND SMALLER THAN A KEY VALUE.\nfunc UpperBound(s []int, key int) int {\n\tisSmaller := func(index, key int) bool {\n\t\tif s[index] <= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isSmaller(mid, key) {\n\t\t\tleft = mid\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t}\n\n\treturn left\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 0 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\tif n == 1 {\n\t\treturn map[int]int{1: 1}\n\t}\n\n\tp := map[int]int{}\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nvar n, k int\nvar A []int\n\nfunc main() {\n\tn, k = ReadInt(), ReadInt()\n\tA = ReadIntSlice(n)\n\n\tidxOfOne := -1\n\tfor i, a := range A {\n\t\tif a == 1 {\n\t\t\tidxOfOne = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tx := idxOfOne\n\ty := (n - 1) - idxOfOne\n\n\tif n == k {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tans := 0\n\tif (x >= k-1 && y >= k-1) || x == 0 || y == 0 {\n\t\tans = CeilInt(x, k-1) + CeilInt(y, k-1)\n\t} else if x < y {\n\t\tans++\n\t\ty -= k - (x + 1)\n\t\tans += CeilInt(y, k-1)\n\t} else {\n\t\tans++\n\t\tx -= k - (y + 1)\n\t\tans += CeilInt(x, k-1)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc CeilInt(a, b int) int {\n\tvar ans int\n\tif a%b == 0 {\n\t\tans = a / b\n\t} else {\n\t\tans = a/b + 1\n\t}\n\treturn ans\n}\n", "language": "Go", "metadata": {"date": 1546750386, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03317.html", "problem_id": "p03317", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03317/input.txt", "sample_output_relpath": "derived/input_output/data/p03317/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03317/Go/s084348736.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s084348736", "user_id": "u103600314"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value is EQUAL TO AND LARGER THAN A KEY VALUE.\nfunc LowerBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value is EQUAL TO AND SMALLER THAN A KEY VALUE.\nfunc UpperBound(s []int, key int) int {\n\tisSmaller := func(index, key int) bool {\n\t\tif s[index] <= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isSmaller(mid, key) {\n\t\t\tleft = mid\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t}\n\n\treturn left\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 0 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\tif n == 1 {\n\t\treturn map[int]int{1: 1}\n\t}\n\n\tp := map[int]int{}\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nvar n, k int\nvar A []int\n\nfunc main() {\n\tn, k = ReadInt(), ReadInt()\n\tA = ReadIntSlice(n)\n\n\tidxOfOne := -1\n\tfor i, a := range A {\n\t\tif a == 1 {\n\t\t\tidxOfOne = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tx := idxOfOne\n\ty := (n - 1) - idxOfOne\n\n\tif n == k {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tans := 0\n\tif (x >= k-1 && y >= k-1) || x == 0 || y == 0 {\n\t\tans = CeilInt(x, k-1) + CeilInt(y, k-1)\n\t} else if x < y {\n\t\tans++\n\t\ty -= k - (x + 1)\n\t\tans += CeilInt(y, k-1)\n\t} else {\n\t\tans++\n\t\tx -= k - (y + 1)\n\t\tans += CeilInt(x, k-1)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc CeilInt(a, b int) int {\n\tvar ans int\n\tif a%b == 0 {\n\t\tans = a / b\n\t} else {\n\t\tans = a/b + 1\n\t}\n\treturn ans\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N.\n\nOn this sequence, Snuke can perform the following operation:\n\nChoose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements.\n\nSnuke would like to make all the elements in this sequence equal by repeating the operation above some number of times.\nFind the minimum number of operations required.\nIt can be proved that, Under the constraints of this problem, this objective is always achievable.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 100000\n\nA_1, A_2, ..., A_N is a permutation of 1, 2, ..., N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 3\n2 3 1 4\n\nSample Output 1\n\n2\n\nOne optimal strategy is as follows:\n\nIn the first operation, choose the first, second and third elements. The sequence A becomes 1, 1, 1, 4.\n\nIn the second operation, choose the second, third and fourth elements. The sequence A becomes 1, 1, 1, 1.\n\nSample Input 2\n\n3 3\n1 2 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n8 3\n7 3 1 8 4 6 2 5\n\nSample Output 3\n\n4", "sample_input": "4 3\n2 3 1 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03317", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N.\n\nOn this sequence, Snuke can perform the following operation:\n\nChoose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements.\n\nSnuke would like to make all the elements in this sequence equal by repeating the operation above some number of times.\nFind the minimum number of operations required.\nIt can be proved that, Under the constraints of this problem, this objective is always achievable.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 100000\n\nA_1, A_2, ..., A_N is a permutation of 1, 2, ..., N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 3\n2 3 1 4\n\nSample Output 1\n\n2\n\nOne optimal strategy is as follows:\n\nIn the first operation, choose the first, second and third elements. The sequence A becomes 1, 1, 1, 4.\n\nIn the second operation, choose the second, third and fourth elements. The sequence A becomes 1, 1, 1, 1.\n\nSample Input 2\n\n3 3\n1 2 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n8 3\n7 3 1 8 4 6 2 5\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6832, "cpu_time_ms": 20, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s943426163", "group_id": "codeNet:p03317", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Tue Jun 26 02:16:19 2018\n//\npackage main\n\nimport \"fmt\"\n\nvar N, K int\nvar arr []int\n\nfunc main() {\n\tfmt.Scan(&N, &K)\n\n\tvar index int\n\tarr := make([]int, N)\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i])\n\t\tif arr[i] == 1 {\n\t\t\tindex = i\n\t\t}\n\t}\n\n\tif N == K {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tK--\n\tleft := index\n\tright := N - 1 - index\n\t//fmt.Println(K, left, right)\n\tfmt.Println((left+K-1)/K + (right+K-1)/K)\n}\n", "language": "Go", "metadata": {"date": 1529994599, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03317.html", "problem_id": "p03317", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03317/input.txt", "sample_output_relpath": "derived/input_output/data/p03317/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03317/Go/s943426163.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s943426163", "user_id": "u802614675"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Tue Jun 26 02:16:19 2018\n//\npackage main\n\nimport \"fmt\"\n\nvar N, K int\nvar arr []int\n\nfunc main() {\n\tfmt.Scan(&N, &K)\n\n\tvar index int\n\tarr := make([]int, N)\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i])\n\t\tif arr[i] == 1 {\n\t\t\tindex = i\n\t\t}\n\t}\n\n\tif N == K {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tK--\n\tleft := index\n\tright := N - 1 - index\n\t//fmt.Println(K, left, right)\n\tfmt.Println((left+K-1)/K + (right+K-1)/K)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N.\n\nOn this sequence, Snuke can perform the following operation:\n\nChoose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements.\n\nSnuke would like to make all the elements in this sequence equal by repeating the operation above some number of times.\nFind the minimum number of operations required.\nIt can be proved that, Under the constraints of this problem, this objective is always achievable.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 100000\n\nA_1, A_2, ..., A_N is a permutation of 1, 2, ..., N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 3\n2 3 1 4\n\nSample Output 1\n\n2\n\nOne optimal strategy is as follows:\n\nIn the first operation, choose the first, second and third elements. The sequence A becomes 1, 1, 1, 4.\n\nIn the second operation, choose the second, third and fourth elements. The sequence A becomes 1, 1, 1, 1.\n\nSample Input 2\n\n3 3\n1 2 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n8 3\n7 3 1 8 4 6 2 5\n\nSample Output 3\n\n4", "sample_input": "4 3\n2 3 1 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03317", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N.\n\nOn this sequence, Snuke can perform the following operation:\n\nChoose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements.\n\nSnuke would like to make all the elements in this sequence equal by repeating the operation above some number of times.\nFind the minimum number of operations required.\nIt can be proved that, Under the constraints of this problem, this objective is always achievable.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 100000\n\nA_1, A_2, ..., A_N is a permutation of 1, 2, ..., N.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4 3\n2 3 1 4\n\nSample Output 1\n\n2\n\nOne optimal strategy is as follows:\n\nIn the first operation, choose the first, second and third elements. The sequence A becomes 1, 1, 1, 4.\n\nIn the second operation, choose the second, third and fourth elements. The sequence A becomes 1, 1, 1, 1.\n\nSample Input 2\n\n3 3\n1 2 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n8 3\n7 3 1 8 4 6 2 5\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 481, "cpu_time_ms": 442, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s668528781", "group_id": "codeNet:p03318", "input_text": "package main\n\nimport \"os\"\nimport \"fmt\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main() {\n var sc = bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n sc.Scan()\n k, _ := strconv.Atoi(sc.Text())\n a := []int{}\n for i := 1; true; i++ {\n if sunuke(i, i + 1) {\n a = append(a, i)\n }\n if len(a) >= k {\n break\n }\n }\n\n for i := 0; i < len(a); i++ {\n for j := i + 1; j < len(a); j++ {\n if a[i] > a[j] {\n tmp := a[j]\n a[j] = a[i]\n a[i] = tmp\n }\n }\n }\n\n for i := 0; i < len(a); i++ {\n fmt.Printf(\"%d\\n\", a[i])\n }\n}\n\nfunc sunuke(n int, m int) bool {\n if m > n {\n if (n / fn(n)) <= (m / fn(m)) {\n return true\n }\n }\n return false\n}\n\nfunc fn(v int) int {\n r := 0\n for i := 0; v >= 10; i++ {\n r = r + (v - (v / 10 * 10))\n v = v / 10\n }\n r = r + v\n return r\n}\n", "language": "Go", "metadata": {"date": 1529807612, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03318.html", "problem_id": "p03318", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03318/input.txt", "sample_output_relpath": "derived/input_output/data/p03318/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03318/Go/s668528781.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s668528781", "user_id": "u857135230"}, "prompt_components": {"gold_output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n19\n", "input_to_evaluate": "package main\n\nimport \"os\"\nimport \"fmt\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main() {\n var sc = bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n sc.Scan()\n k, _ := strconv.Atoi(sc.Text())\n a := []int{}\n for i := 1; true; i++ {\n if sunuke(i, i + 1) {\n a = append(a, i)\n }\n if len(a) >= k {\n break\n }\n }\n\n for i := 0; i < len(a); i++ {\n for j := i + 1; j < len(a); j++ {\n if a[i] > a[j] {\n tmp := a[j]\n a[j] = a[i]\n a[i] = tmp\n }\n }\n }\n\n for i := 0; i < len(a); i++ {\n fmt.Printf(\"%d\\n\", a[i])\n }\n}\n\nfunc sunuke(n int, m int) bool {\n if m > n {\n if (n / fn(n)) <= (m / fn(m)) {\n return true\n }\n }\n return false\n}\n\nfunc fn(v int) int {\n r := 0\n for i := 0; v >= 10; i++ {\n r = r + (v - (v / 10 * 10))\n v = v / 10\n }\n r = r + v\n return r\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(123) = 1 + 2 + 3 = 6.\n\nWe will call an integer n a Snuke number when, for all positive integers m such that m > n, \\frac{n}{S(n)} \\leq \\frac{m}{S(m)} holds.\n\nGiven an integer K, list the K smallest Snuke numbers.\n\nConstraints\n\n1 \\leq K\n\nThe K-th smallest Snuke number is not greater than 10^{15}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th smallest Snuke number.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n1\n2\n3\n4\n5\n6\n7\n8\n9\n19", "sample_input": "10\n"}, "reference_outputs": ["1\n2\n3\n4\n5\n6\n7\n8\n9\n19\n"], "source_document_id": "p03318", "source_text": "Score : 500 points\n\nProblem Statement\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(123) = 1 + 2 + 3 = 6.\n\nWe will call an integer n a Snuke number when, for all positive integers m such that m > n, \\frac{n}{S(n)} \\leq \\frac{m}{S(m)} holds.\n\nGiven an integer K, list the K smallest Snuke numbers.\n\nConstraints\n\n1 \\leq K\n\nThe K-th smallest Snuke number is not greater than 10^{15}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th smallest Snuke number.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n1\n2\n3\n4\n5\n6\n7\n8\n9\n19", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 976, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s549178314", "group_id": "codeNet:p03323", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tA := getInt()\n\tB := getInt()\n\n\tif A <= 8 && B <= 8 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1587338571, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03323.html", "problem_id": "p03323", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03323/input.txt", "sample_output_relpath": "derived/input_output/data/p03323/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03323/Go/s549178314.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s549178314", "user_id": "u964273035"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tA := getInt()\n\tB := getInt()\n\n\tif A <= 8 && B <= 8 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "sample_input": "5 4\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03323", "source_text": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5122, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s806480952", "group_id": "codeNet:p03323", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a < 9 && b < 9 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1546089215, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03323.html", "problem_id": "p03323", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03323/input.txt", "sample_output_relpath": "derived/input_output/data/p03323/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03323/Go/s806480952.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s806480952", "user_id": "u113872560"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a < 9 && b < 9 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\n\t}\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "sample_input": "5 4\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03323", "source_text": "Score: 100 points\n\nProblem Statement\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\n\nE869120 and square1001 were just about to eat A and B of those pieces, respectively,\n\nwhen they found a note attached to the cake saying that \"the same person should not take two adjacent pieces of cake\".\n\nCan both of them obey the instruction in the note and take desired numbers of pieces of cake?\n\nConstraints\n\nA and B are integers between 1 and 16 (inclusive).\n\nA+B is at most 16.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.\n\nSample Input 1\n\n5 4\n\nSample Output 1\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 2\n\n8 8\n\nSample Output 2\n\nYay!\n\nBoth of them can take desired number of pieces as follows:\n\nSample Input 3\n\n11 4\n\nSample Output 3\n\n:(\n\nIn this case, there is no way for them to take desired number of pieces, unfortunately.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 152, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s983291658", "group_id": "codeNet:p03327", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\t\n\tif N < 1000 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ABD\")\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1587352968, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03327.html", "problem_id": "p03327", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03327/input.txt", "sample_output_relpath": "derived/input_output/data/p03327/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03327/Go/s983291658.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s983291658", "user_id": "u964273035"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\t\n\tif N < 1000 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ABD\")\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "sample_input": "999\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03327", "source_text": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5100, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s134449973", "group_id": "codeNet:p03327", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n < 1000 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ABD\")\n\t}\n}", "language": "Go", "metadata": {"date": 1571313988, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03327.html", "problem_id": "p03327", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03327/input.txt", "sample_output_relpath": "derived/input_output/data/p03327/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03327/Go/s134449973.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s134449973", "user_id": "u390374229"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n < 1000 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ABD\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "sample_input": "999\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03327", "source_text": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 144, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s699584685", "group_id": "codeNet:p03327", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n < 1000 {\n\t\tfmt.Printf(\"%s%v\", \"ABC\", n)\n\t} else {\n\t\tfmt.Printf(\"%s%v\\n\", \"ABD\", n-999)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564804584, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03327.html", "problem_id": "p03327", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03327/input.txt", "sample_output_relpath": "derived/input_output/data/p03327/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03327/Go/s699584685.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s699584685", "user_id": "u550296200"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n < 1000 {\n\t\tfmt.Printf(\"%s%v\", \"ABC\", n)\n\t} else {\n\t\tfmt.Printf(\"%s%v\\n\", \"ABD\", n-999)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "sample_input": "999\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03327", "source_text": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 166, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s953087260", "group_id": "codeNet:p03327", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nvar dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1, 0}\nvar dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1, 0}\n\nvar inf = math.MaxInt64\n\n// var mod = 1000000007\nvar next = newScanner()\n\n// ---------------------------------------------------------\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\trand.Seed(time.Now().UnixNano())\n}\n\nfunc main() {\n\tN := next.Int()\n\tif N < 1000 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ABD\")\n\t}\n}\n\n// ---------------------------------------------------------\n\n// Pair is...\ntype Pair struct {\n\ta, b int\n}\n\n// Pairs is sorted by []Pair struct\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[i].b\n}\n\n// func (p Pairs) Less(i, j int) bool {\n// \tif p[i].a < p[j].a {\n// \t\treturn true\n// \t} else if p[i].a == p[j].a {\n// \t\treturn p[i].b < p[j].b\n// \t}\n// \treturn false\n// }\n\n// ------int method-------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\nfunc out(c, a, z int) bool {\n\treturn !in(c, a, z)\n}\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\nfunc itob(a int) bool {\n\treturn a != 0\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc pro(a []int) int {\n\tr := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tr *= a[i]\n\t}\n\treturn r\n}\n\nfunc fill(a []int, n int) []int {\n\tfor i := range a {\n\t\ta[i] = n\n\t}\n\treturn a\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n//\n//func abs(a int) int {\n//\tmask := a >> 63\n//\treturn (a ^ mask) - mask\n//}\n\nfunc ceil(a, b int) int {\n\tif a%b != 0 {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc printStrings(out []string) {\n\tfor i := range out {\n\t\tfmt.Print(out[i])\n\t\tif i != len(out)-1 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n\tfmt.Print(\"\\n\")\n}\nfunc printInts(out []int) {\n\tfor i := range out {\n\t\tfmt.Print(out[i])\n\t\tif i != len(out)-1 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n\tfmt.Print(\"\\n\")\n}\n\n// ---------- buffered scanner -----------------------------------------\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\nfunc (s *scanner) Int() int {\n\tv, err := strconv.Atoi(s.next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Ints(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = s.Int()\n\t}\n\treturn r\n}\nfunc (s *scanner) Int64() int64 {\n\tv, err := strconv.ParseInt(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Uint64() uint64 {\n\tv, err := strconv.ParseUint(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Float64() float64 {\n\tv, err := strconv.ParseFloat(s.next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1528678927, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03327.html", "problem_id": "p03327", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03327/input.txt", "sample_output_relpath": "derived/input_output/data/p03327/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03327/Go/s953087260.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s953087260", "user_id": "u696272993"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nvar dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1, 0}\nvar dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1, 0}\n\nvar inf = math.MaxInt64\n\n// var mod = 1000000007\nvar next = newScanner()\n\n// ---------------------------------------------------------\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\trand.Seed(time.Now().UnixNano())\n}\n\nfunc main() {\n\tN := next.Int()\n\tif N < 1000 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ABD\")\n\t}\n}\n\n// ---------------------------------------------------------\n\n// Pair is...\ntype Pair struct {\n\ta, b int\n}\n\n// Pairs is sorted by []Pair struct\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[i].b\n}\n\n// func (p Pairs) Less(i, j int) bool {\n// \tif p[i].a < p[j].a {\n// \t\treturn true\n// \t} else if p[i].a == p[j].a {\n// \t\treturn p[i].b < p[j].b\n// \t}\n// \treturn false\n// }\n\n// ------int method-------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\nfunc out(c, a, z int) bool {\n\treturn !in(c, a, z)\n}\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\nfunc itob(a int) bool {\n\treturn a != 0\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc pro(a []int) int {\n\tr := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tr *= a[i]\n\t}\n\treturn r\n}\n\nfunc fill(a []int, n int) []int {\n\tfor i := range a {\n\t\ta[i] = n\n\t}\n\treturn a\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n//\n//func abs(a int) int {\n//\tmask := a >> 63\n//\treturn (a ^ mask) - mask\n//}\n\nfunc ceil(a, b int) int {\n\tif a%b != 0 {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc printStrings(out []string) {\n\tfor i := range out {\n\t\tfmt.Print(out[i])\n\t\tif i != len(out)-1 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n\tfmt.Print(\"\\n\")\n}\nfunc printInts(out []int) {\n\tfor i := range out {\n\t\tfmt.Print(out[i])\n\t\tif i != len(out)-1 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n\tfmt.Print(\"\\n\")\n}\n\n// ---------- buffered scanner -----------------------------------------\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\nfunc (s *scanner) Int() int {\n\tv, err := strconv.Atoi(s.next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Ints(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = s.Int()\n\t}\n\treturn r\n}\nfunc (s *scanner) Int64() int64 {\n\tv, err := strconv.ParseInt(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Uint64() uint64 {\n\tv, err := strconv.ParseUint(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Float64() float64 {\n\tv, err := strconv.ParseFloat(s.next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "sample_input": "999\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03327", "source_text": "Score : 100 points\n\nProblem Statement\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\n\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?\n\nIn the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.\n\nYou are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nConstraints\n\n1 \\leq N \\leq 1998\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n\nSample Input 1\n\n999\n\nSample Output 1\n\nABC\n\nThe 999-th round of AtCoder Beginner Contest is labeled as ABC999.\n\nSample Input 2\n\n1000\n\nSample Output 2\n\nABD\n\nThe 1000-th round of AtCoder Beginner Contest is labeled as ABD001.\n\nSample Input 3\n\n1481\n\nSample Output 3\n\nABD\n\nThe 1481-th round of AtCoder Beginner Contest is labeled as ABD482.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3887, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s307249898", "group_id": "codeNet:p03329", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tN, e := strconv.Atoi(sc.Text())\n\tvar res = N\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\tfor i := 0; i <= N; i++ {\n\t\tcc := 0\n\t\tt := i\n\t\tfor t > 0 {\n\t\t\tcc+=t%6\n\t\t\tt/=6\n\t\t}\n\t\tt=N-i\n\t\tfor t > 0 {\n\t\t\tcc+=t%9\n\t\t\tt/=9\n\t\t}\n\t\tif res > cc{\n\t\t\tres = cc\n\t\t}\n\t}\n\tfmt.Print(res)\n}", "language": "Go", "metadata": {"date": 1529350051, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03329.html", "problem_id": "p03329", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03329/input.txt", "sample_output_relpath": "derived/input_output/data/p03329/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03329/Go/s307249898.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s307249898", "user_id": "u781152930"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tN, e := strconv.Atoi(sc.Text())\n\tvar res = N\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\tfor i := 0; i <= N; i++ {\n\t\tcc := 0\n\t\tt := i\n\t\tfor t > 0 {\n\t\t\tcc+=t%6\n\t\t\tt/=6\n\t\t}\n\t\tt=N-i\n\t\tfor t > 0 {\n\t\t\tcc+=t%9\n\t\t\tt/=9\n\t\t}\n\t\tif res > cc{\n\t\t\tres = cc\n\t\t}\n\t}\n\tfmt.Print(res)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTo make it difficult to withdraw money, a certain bank allows its customers to withdraw only one of the following amounts in one operation:\n\n1 yen (the currency of Japan)\n\n6 yen, 6^2(=36) yen, 6^3(=216) yen, ...\n\n9 yen, 9^2(=81) yen, 9^3(=729) yen, ...\n\nAt least how many operations are required to withdraw exactly N yen in total?\n\nIt is not allowed to re-deposit the money you withdrew.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf at least x operations are required to withdraw exactly N yen in total, print x.\n\nSample Input 1\n\n127\n\nSample Output 1\n\n4\n\nBy withdrawing 1 yen, 9 yen, 36(=6^2) yen and 81(=9^2) yen, we can withdraw 127 yen in four operations.\n\nSample Input 2\n\n3\n\nSample Output 2\n\n3\n\nBy withdrawing 1 yen three times, we can withdraw 3 yen in three operations.\n\nSample Input 3\n\n44852\n\nSample Output 3\n\n16", "sample_input": "127\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03329", "source_text": "Score : 300 points\n\nProblem Statement\n\nTo make it difficult to withdraw money, a certain bank allows its customers to withdraw only one of the following amounts in one operation:\n\n1 yen (the currency of Japan)\n\n6 yen, 6^2(=36) yen, 6^3(=216) yen, ...\n\n9 yen, 9^2(=81) yen, 9^3(=729) yen, ...\n\nAt least how many operations are required to withdraw exactly N yen in total?\n\nIt is not allowed to re-deposit the money you withdrew.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf at least x operations are required to withdraw exactly N yen in total, print x.\n\nSample Input 1\n\n127\n\nSample Output 1\n\n4\n\nBy withdrawing 1 yen, 9 yen, 36(=6^2) yen and 81(=9^2) yen, we can withdraw 127 yen in four operations.\n\nSample Input 2\n\n3\n\nSample Output 2\n\n3\n\nBy withdrawing 1 yen three times, we can withdraw 3 yen in three operations.\n\nSample Input 3\n\n44852\n\nSample Output 3\n\n16", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 374, "cpu_time_ms": 5, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s799543480", "group_id": "codeNet:p03329", "input_text": "///\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Jun 10 21:06:08 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar N int\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) int {\n\tans := 1\n\tfor i := 0; i < b; i++ {\n\t\tans *= a\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tfmt.Scan(&N)\n\n\tarr := []int{1, pow(6, 1), pow(6, 2), pow(6, 3), pow(6, 4), pow(6, 5), pow(6, 6), pow(6, 7), pow(9, 1), pow(9, 2), pow(9, 3), pow(9, 4), pow(9, 5), pow(9, 6)}\n\tsort.Ints(arr)\n\n\tdp := make([]int, N+1)\n\tfor i := range dp {\n\t\tdp[i] = 1 << 30\n\t}\n\tdp[0] = 0\n\tfor i := range dp {\n\t\tfor j := range arr {\n\t\t\tif i-arr[j] >= 0 {\n\t\t\t\tdp[i] = min(dp[i], dp[i-arr[j]]+1)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[N])\n}\n", "language": "Go", "metadata": {"date": 1528680109, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03329.html", "problem_id": "p03329", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03329/input.txt", "sample_output_relpath": "derived/input_output/data/p03329/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03329/Go/s799543480.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s799543480", "user_id": "u802614675"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "///\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Jun 10 21:06:08 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar N int\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) int {\n\tans := 1\n\tfor i := 0; i < b; i++ {\n\t\tans *= a\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tfmt.Scan(&N)\n\n\tarr := []int{1, pow(6, 1), pow(6, 2), pow(6, 3), pow(6, 4), pow(6, 5), pow(6, 6), pow(6, 7), pow(9, 1), pow(9, 2), pow(9, 3), pow(9, 4), pow(9, 5), pow(9, 6)}\n\tsort.Ints(arr)\n\n\tdp := make([]int, N+1)\n\tfor i := range dp {\n\t\tdp[i] = 1 << 30\n\t}\n\tdp[0] = 0\n\tfor i := range dp {\n\t\tfor j := range arr {\n\t\t\tif i-arr[j] >= 0 {\n\t\t\t\tdp[i] = min(dp[i], dp[i-arr[j]]+1)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[N])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTo make it difficult to withdraw money, a certain bank allows its customers to withdraw only one of the following amounts in one operation:\n\n1 yen (the currency of Japan)\n\n6 yen, 6^2(=36) yen, 6^3(=216) yen, ...\n\n9 yen, 9^2(=81) yen, 9^3(=729) yen, ...\n\nAt least how many operations are required to withdraw exactly N yen in total?\n\nIt is not allowed to re-deposit the money you withdrew.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf at least x operations are required to withdraw exactly N yen in total, print x.\n\nSample Input 1\n\n127\n\nSample Output 1\n\n4\n\nBy withdrawing 1 yen, 9 yen, 36(=6^2) yen and 81(=9^2) yen, we can withdraw 127 yen in four operations.\n\nSample Input 2\n\n3\n\nSample Output 2\n\n3\n\nBy withdrawing 1 yen three times, we can withdraw 3 yen in three operations.\n\nSample Input 3\n\n44852\n\nSample Output 3\n\n16", "sample_input": "127\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03329", "source_text": "Score : 300 points\n\nProblem Statement\n\nTo make it difficult to withdraw money, a certain bank allows its customers to withdraw only one of the following amounts in one operation:\n\n1 yen (the currency of Japan)\n\n6 yen, 6^2(=36) yen, 6^3(=216) yen, ...\n\n9 yen, 9^2(=81) yen, 9^3(=729) yen, ...\n\nAt least how many operations are required to withdraw exactly N yen in total?\n\nIt is not allowed to re-deposit the money you withdrew.\n\nConstraints\n\n1 \\leq N \\leq 100000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf at least x operations are required to withdraw exactly N yen in total, print x.\n\nSample Input 1\n\n127\n\nSample Output 1\n\n4\n\nBy withdrawing 1 yen, 9 yen, 36(=6^2) yen and 81(=9^2) yen, we can withdraw 127 yen in four operations.\n\nSample Input 2\n\n3\n\nSample Output 2\n\n3\n\nBy withdrawing 1 yen three times, we can withdraw 3 yen in three operations.\n\nSample Input 3\n\n44852\n\nSample Output 3\n\n16", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 714, "cpu_time_ms": 7, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s323626959", "group_id": "codeNet:p03330", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getNextLine(scanner *bufio.Reader) string {\n\tvar buffer string\n\tfor {\n\t\tline, isPrefix, _ := scanner.ReadLine()\n\t\tbuffer += string(line)\n\t\tif isPrefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buffer\n}\n\nfunc getIntList(scanner *bufio.Reader) []int {\n\tlist := strings.Split(getNextLine(scanner), \" \")\n\tl := len(list)\n\tresult := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tresult[i], _ = strconv.Atoi(list[i])\n\t}\n\treturn result\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := bufio.NewReader(fp)\n\n\tvar n, c int\n\tfmt.Sscan(getNextLine(scanner), &n, &c)\n\tdd := make([][]int, c)\n\tcc := make([][]int, n)\n\tcounts := make([][]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tcounts[i] = make([]int, c)\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tdd[i] = getIntList(scanner)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tcc[i] = getIntList(scanner)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tcc[i][j]--\n\t\t\tcounts[(i+j)%3][cc[i][j]]++\n\t\t}\n\t}\n\tmin := -1\n\tfor i := 0; i < c; i++ {\n\t\tfor ii := 0; ii < c; ii++ {\n\t\t\tif i == ii {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor iii := 0; iii < c; iii++ {\n\t\t\t\tif i == iii || ii == iii {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tds := 0\n\t\t\t\tfor ci := 0; ci < c; ci++ {\n\t\t\t\t\tds += dd[ci][i] * counts[0][ci]\n\t\t\t\t\tds += dd[ci][ii] * counts[1][ci]\n\t\t\t\t\tds += dd[ci][iii] * counts[2][ci]\n\t\t\t\t}\n\t\t\t\tif min == -1 || min > ds {\n\t\t\t\t\tmin = ds\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(min)\n}\n", "language": "Go", "metadata": {"date": 1558663601, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03330.html", "problem_id": "p03330", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03330/input.txt", "sample_output_relpath": "derived/input_output/data/p03330/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03330/Go/s323626959.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s323626959", "user_id": "u150542210"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getNextLine(scanner *bufio.Reader) string {\n\tvar buffer string\n\tfor {\n\t\tline, isPrefix, _ := scanner.ReadLine()\n\t\tbuffer += string(line)\n\t\tif isPrefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buffer\n}\n\nfunc getIntList(scanner *bufio.Reader) []int {\n\tlist := strings.Split(getNextLine(scanner), \" \")\n\tl := len(list)\n\tresult := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tresult[i], _ = strconv.Atoi(list[i])\n\t}\n\treturn result\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := bufio.NewReader(fp)\n\n\tvar n, c int\n\tfmt.Sscan(getNextLine(scanner), &n, &c)\n\tdd := make([][]int, c)\n\tcc := make([][]int, n)\n\tcounts := make([][]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tcounts[i] = make([]int, c)\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tdd[i] = getIntList(scanner)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tcc[i] = getIntList(scanner)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tcc[i][j]--\n\t\t\tcounts[(i+j)%3][cc[i][j]]++\n\t\t}\n\t}\n\tmin := -1\n\tfor i := 0; i < c; i++ {\n\t\tfor ii := 0; ii < c; ii++ {\n\t\t\tif i == ii {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor iii := 0; iii < c; iii++ {\n\t\t\t\tif i == iii || ii == iii {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tds := 0\n\t\t\t\tfor ci := 0; ci < c; ci++ {\n\t\t\t\t\tds += dd[ci][i] * counts[0][ci]\n\t\t\t\t\tds += dd[ci][ii] * counts[1][ci]\n\t\t\t\t\tds += dd[ci][iii] * counts[2][ci]\n\t\t\t\t}\n\t\t\t\tif min == -1 || min > ds {\n\t\t\t\t\tmin = ds\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(min)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left.\n\nThese squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painted in Color c_{i,j}.\n\nWe say the grid is a good grid when the following condition is met for all i,j,x,y satisfying 1 \\leq i,j,x,y \\leq N:\n\nIf (i+j) \\% 3=(x+y) \\% 3, the color of (i,j) and the color of (x,y) are the same.\n\nIf (i+j) \\% 3 \\neq (x+y) \\% 3, the color of (i,j) and the color of (x,y) are different.\n\nHere, X \\% Y represents X modulo Y.\n\nWe will repaint zero or more squares so that the grid will be a good grid.\n\nFor a square, the wrongness when the color of the square is X before repainting and Y after repainting, is D_{X,Y}.\n\nFind the minimum possible sum of the wrongness of all the squares.\n\nConstraints\n\n1 \\leq N \\leq 500\n\n3 \\leq C \\leq 30\n\n1 \\leq D_{i,j} \\leq 1000 (i \\neq j),D_{i,j}=0 (i=j)\n\n1 \\leq c_{i,j} \\leq C\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nD_{1,1} ... D_{1,C}\n:\nD_{C,1} ... D_{C,C}\nc_{1,1} ... c_{1,N}\n:\nc_{N,1} ... c_{N,N}\n\nOutput\n\nIf the minimum possible sum of the wrongness of all the squares is x, print x.\n\nSample Input 1\n\n2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n\nSample Output 1\n\n3\n\nRepaint (1,1) to Color 2. The wrongness of (1,1) becomes D_{1,2}=1.\n\nRepaint (1,2) to Color 3. The wrongness of (1,2) becomes D_{2,3}=1.\n\nRepaint (2,2) to Color 1. The wrongness of (2,2) becomes D_{3,1}=1.\n\nIn this case, the sum of the wrongness of all the squares is 3.\n\nNote that D_{i,j} \\neq D_{j,i} is possible.\n\nSample Input 2\n\n4 3\n0 12 71\n81 0 53\n14 92 0\n1 1 2 1\n2 1 1 2\n2 2 1 3\n1 1 2 2\n\nSample Output 2\n\n428", "sample_input": "2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03330", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left.\n\nThese squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painted in Color c_{i,j}.\n\nWe say the grid is a good grid when the following condition is met for all i,j,x,y satisfying 1 \\leq i,j,x,y \\leq N:\n\nIf (i+j) \\% 3=(x+y) \\% 3, the color of (i,j) and the color of (x,y) are the same.\n\nIf (i+j) \\% 3 \\neq (x+y) \\% 3, the color of (i,j) and the color of (x,y) are different.\n\nHere, X \\% Y represents X modulo Y.\n\nWe will repaint zero or more squares so that the grid will be a good grid.\n\nFor a square, the wrongness when the color of the square is X before repainting and Y after repainting, is D_{X,Y}.\n\nFind the minimum possible sum of the wrongness of all the squares.\n\nConstraints\n\n1 \\leq N \\leq 500\n\n3 \\leq C \\leq 30\n\n1 \\leq D_{i,j} \\leq 1000 (i \\neq j),D_{i,j}=0 (i=j)\n\n1 \\leq c_{i,j} \\leq C\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nD_{1,1} ... D_{1,C}\n:\nD_{C,1} ... D_{C,C}\nc_{1,1} ... c_{1,N}\n:\nc_{N,1} ... c_{N,N}\n\nOutput\n\nIf the minimum possible sum of the wrongness of all the squares is x, print x.\n\nSample Input 1\n\n2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n\nSample Output 1\n\n3\n\nRepaint (1,1) to Color 2. The wrongness of (1,1) becomes D_{1,2}=1.\n\nRepaint (1,2) to Color 3. The wrongness of (1,2) becomes D_{2,3}=1.\n\nRepaint (2,2) to Color 1. The wrongness of (2,2) becomes D_{3,1}=1.\n\nIn this case, the sum of the wrongness of all the squares is 3.\n\nNote that D_{i,j} \\neq D_{j,i} is possible.\n\nSample Input 2\n\n4 3\n0 12 71\n81 0 53\n14 92 0\n1 1 2 1\n2 1 1 2\n2 2 1 3\n1 1 2 2\n\nSample Output 2\n\n428", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1433, "cpu_time_ms": 25, "memory_kb": 4864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s584705788", "group_id": "codeNet:p03337", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tadd := a + b\n\tsub := a - b\n\tmul := a * b\n\n\tfmt.Println(max(add, sub, mul))\n}\n\nfunc max(args ...int) int {\n\tmax := -100000000\n\tfor _, v := range args {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n", "language": "Go", "metadata": {"date": 1574133800, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03337.html", "problem_id": "p03337", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03337/input.txt", "sample_output_relpath": "derived/input_output/data/p03337/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03337/Go/s584705788.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s584705788", "user_id": "u367259152"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tadd := a + b\n\tsub := a - b\n\tmul := a * b\n\n\tfmt.Println(max(add, sub, mul))\n}\n\nfunc max(args ...int) int {\n\tmax := -100000000\n\tfor _, v := range args {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "sample_input": "3 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03337", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 274, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s759393282", "group_id": "codeNet:p03337", "input_text": "package main\n\nimport \"fmt\"\n\nfunc getMax(nums ...int) (max int){\n max = nums[0]\n for i:=0; i max {\n max = nums[i]\n }\n }\n return\n}\n\nfunc main(){\n var a, b int\n fmt.Scan(&a, &b)\n fmt.Println(getMax(a + b, a * b, a - b))\n}\n", "language": "Go", "metadata": {"date": 1556336108, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03337.html", "problem_id": "p03337", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03337/input.txt", "sample_output_relpath": "derived/input_output/data/p03337/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03337/Go/s759393282.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s759393282", "user_id": "u004288099"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc getMax(nums ...int) (max int){\n max = nums[0]\n for i:=0; i max {\n max = nums[i]\n }\n }\n return\n}\n\nfunc main(){\n var a, b int\n fmt.Scan(&a, &b)\n fmt.Println(getMax(a + b, a * b, a - b))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "sample_input": "3 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03337", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s577481826", "group_id": "codeNet:p03337", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, _ := strconv.Atoi(read())\n\tb, _ := strconv.Atoi(read())\n\n\tret := a + b\n\n\tif ret < (a - b) {\n\t\tret = a - b\n\t}\n\tif ret < (a * b) {\n\t\tret = a * b\n\t}\n\n\tfmt.Println(ret)\n}\n", "language": "Go", "metadata": {"date": 1528569379, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03337.html", "problem_id": "p03337", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03337/input.txt", "sample_output_relpath": "derived/input_output/data/p03337/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03337/Go/s577481826.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s577481826", "user_id": "u982036481"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, _ := strconv.Atoi(read())\n\tb, _ := strconv.Atoi(read())\n\n\tret := a + b\n\n\tif ret < (a - b) {\n\t\tret = a - b\n\t}\n\tif ret < (a * b) {\n\t\tret = a * b\n\t}\n\n\tfmt.Println(ret)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "sample_input": "3 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03337", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B.\nFind the largest value among A+B, A-B and A \\times B.\n\nConstraints\n\n-1000 \\leq A,B \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest value among A+B, A-B and A \\times B.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\n4\n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\nSample Input 2\n\n4 -2\n\nSample Output 2\n\n6\n\nThe largest is 4 - (-2) = 6.\n\nSample Input 3\n\n0 0\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 361, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s840288089", "group_id": "codeNet:p03345", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C, K, ans int\n\tfmt.Scan(&A, &B, &C, &K)\n\tif K%2 == 0 {\n\t\tans = A - B\n\t} else {\n\t\tans = B - A\n\t}\n\tif ans > 1e18 || ans < -1e18 {\n\t\tfmt.Println(\"Unfair\")\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584686538, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03345.html", "problem_id": "p03345", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03345/input.txt", "sample_output_relpath": "derived/input_output/data/p03345/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03345/Go/s840288089.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s840288089", "user_id": "u605443479"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C, K, ans int\n\tfmt.Scan(&A, &B, &C, &K)\n\tif K%2 == 0 {\n\t\tans = A - B\n\t} else {\n\t\tans = B - A\n\t}\n\tif ans > 1e18 || ans < -1e18 {\n\t\tfmt.Println(\"Unfair\")\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively.\nAfter repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:\n\nEach of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.\n\nHowever, if the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nConstraints\n\n1 \\leq A,B,C \\leq 10^9\n\n0 \\leq K \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the integer Takahashi will get minus the integer Nakahashi will get, after repeating the following operation K times.\nIf the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nSample Input 1\n\n1 2 3 1\n\nSample Output 1\n\n1\n\nAfter one operation, Takahashi, Nakahashi and Hikuhashi have 5, 4 and 3, respectively. We should print 5-4=1.\n\nSample Input 2\n\n2 3 2 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n1000000000 1000000000 1000000000 1000000000000000000\n\nSample Output 3\n\n0", "sample_input": "1 2 3 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03345", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi, Nakahashi and Hikuhashi have integers A, B and C, respectively.\nAfter repeating the following operation K times, find the integer Takahashi will get minus the integer Nakahashi will get:\n\nEach of them simultaneously calculate the sum of the integers that the other two people have, then replace his own integer with the result.\n\nHowever, if the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nConstraints\n\n1 \\leq A,B,C \\leq 10^9\n\n0 \\leq K \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the integer Takahashi will get minus the integer Nakahashi will get, after repeating the following operation K times.\nIf the absolute value of the answer exceeds 10^{18}, print Unfair instead.\n\nSample Input 1\n\n1 2 3 1\n\nSample Output 1\n\n1\n\nAfter one operation, Takahashi, Nakahashi and Hikuhashi have 5, 4 and 3, respectively. We should print 5-4=1.\n\nSample Input 2\n\n2 3 2 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n1000000000 1000000000 1000000000 1000000000000000000\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 244, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s403590854", "group_id": "codeNet:p03352", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\n\tresult := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfor j := 1; j <= x; j++ {\n\t\t\tif i == j*j {\n\t\t\t\tresult = i\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1589983868, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03352.html", "problem_id": "p03352", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03352/input.txt", "sample_output_relpath": "derived/input_output/data/p03352/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03352/Go/s403590854.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s403590854", "user_id": "u346986631"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\n\tresult := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfor j := 1; j <= x; j++ {\n\t\t\tif i == j*j {\n\t\t\t\tresult = i\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.\n\nConstraints\n\n1 ≤ X ≤ 1000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the largest perfect power that is at most X.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9.\nWe should print the largest among them, 9.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n999\n\nSample Output 3\n\n961", "sample_input": "10\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03352", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.\n\nConstraints\n\n1 ≤ X ≤ 1000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the largest perfect power that is at most X.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9.\nWe should print the largest among them, 9.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n999\n\nSample Output 3\n\n961", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 209, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s100187589", "group_id": "codeNet:p03353", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main(){\n\tvar s string\n\tfmt.Scan(&s)\n\tvar K int\n\tfmt.Scan(&K)\n\tsli := []string{}\n\tl := len(s)\n\tfor i:=0; i= K {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tch = true\n\t\t\tfor x := range sli {\n\t\t\t\tif string(sli[x]) == tmp{\n\t\t\t\t\tch = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ch {\n\t\t\t\tsli = append(sli, tmp)\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Strings(sli)\n\tfmt.Println(sli[K-1])\n}", "language": "Go", "metadata": {"date": 1529513922, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03353.html", "problem_id": "p03353", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03353/input.txt", "sample_output_relpath": "derived/input_output/data/p03353/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03353/Go/s100187589.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s100187589", "user_id": "u781152930"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main(){\n\tvar s string\n\tfmt.Scan(&s)\n\tvar K int\n\tfmt.Scan(&K)\n\tsli := []string{}\n\tl := len(s)\n\tfor i:=0; i= K {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tch = true\n\t\t\tfor x := range sli {\n\t\t\t\tif string(sli[x]) == tmp{\n\t\t\t\t\tch = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ch {\n\t\t\t\tsli = append(sli, tmp)\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Strings(sli)\n\tfmt.Println(sli[K-1])\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string s.\nAmong the different substrings of s, print the K-th lexicographically smallest one.\n\nA substring of s is a string obtained by taking out a non-empty contiguous part in s.\nFor example, if s = ababc, a, bab and ababc are substrings of s, while ac, z and an empty string are not.\nAlso, we say that substrings are different when they are different as strings.\n\nLet X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "sample_input": "aba\n4\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03353", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string s.\nAmong the different substrings of s, print the K-th lexicographically smallest one.\n\nA substring of s is a string obtained by taking out a non-empty contiguous part in s.\nFor example, if s = ababc, a, bab and ababc are substrings of s, while ac, z and an empty string are not.\nAlso, we say that substrings are different when they are different as strings.\n\nLet X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 607, "cpu_time_ms": 2108, "memory_kb": 12032}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s043302058", "group_id": "codeNet:p03353", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar s string\nvar K int\n\nfunc main() {\n\tfmt.Scanf(\"%s\", &s)\n\tfmt.Scanf(\"%d\", &K)\n\n\tss := []rune(s)\n\n\tset := make(map[string]struct{})\n\tfor i := 0; i < len(ss); i++ {\n\t\tfor j := i; j < i+K && j < len(ss); j++ {\n\t\t\tset[string(ss[i:j+1])] = struct{}{}\n\t\t}\n\t}\n\n\tstrs := make([]string, 0, K*len(ss))\n\n\tfor k := range set {\n\t\tstrs = append(strs, k)\n\t}\n\n\tsort.Strings(strs)\n\n\tfmt.Println(strs[K-1])\n}\n", "language": "Go", "metadata": {"date": 1526192562, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03353.html", "problem_id": "p03353", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03353/input.txt", "sample_output_relpath": "derived/input_output/data/p03353/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03353/Go/s043302058.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s043302058", "user_id": "u434572230"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar s string\nvar K int\n\nfunc main() {\n\tfmt.Scanf(\"%s\", &s)\n\tfmt.Scanf(\"%d\", &K)\n\n\tss := []rune(s)\n\n\tset := make(map[string]struct{})\n\tfor i := 0; i < len(ss); i++ {\n\t\tfor j := i; j < i+K && j < len(ss); j++ {\n\t\t\tset[string(ss[i:j+1])] = struct{}{}\n\t\t}\n\t}\n\n\tstrs := make([]string, 0, K*len(ss))\n\n\tfor k := range set {\n\t\tstrs = append(strs, k)\n\t}\n\n\tsort.Strings(strs)\n\n\tfmt.Println(strs[K-1])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string s.\nAmong the different substrings of s, print the K-th lexicographically smallest one.\n\nA substring of s is a string obtained by taking out a non-empty contiguous part in s.\nFor example, if s = ababc, a, bab and ababc are substrings of s, while ac, z and an empty string are not.\nAlso, we say that substrings are different when they are different as strings.\n\nLet X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "sample_input": "aba\n4\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03353", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string s.\nAmong the different substrings of s, print the K-th lexicographically smallest one.\n\nA substring of s is a string obtained by taking out a non-empty contiguous part in s.\nFor example, if s = ababc, a, bab and ababc are substrings of s, while ac, z and an empty string are not.\nAlso, we say that substrings are different when they are different as strings.\n\nLet X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 434, "cpu_time_ms": 16, "memory_kb": 2432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s543659170", "group_id": "codeNet:p03355", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\ts, k := next(), nextInt()\n\tn := len(s)\n\n\tsubs := make([]string, 0)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i; j < n && j-i < k; j++ {\n\t\t\tsub := string(s[i : j+1])\n\t\t\tsubs = append(subs, sub)\n\t\t}\n\t}\n\tsort.Sort(sort.StringSlice(subs))\n\n\tfor i, cnt := 0, 1; cnt <= k; i, cnt = i+1, cnt+1 {\n\t\tif cnt == k {\n\t\t\tputs(subs[i])\n\t\t\tbreak\n\t\t}\n\t\tfor i+1 < len(subs) && subs[i+1] == subs[i] {\n\t\t\ti++\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588190698, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03355.html", "problem_id": "p03355", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03355/input.txt", "sample_output_relpath": "derived/input_output/data/p03355/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03355/Go/s543659170.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s543659170", "user_id": "u502813058"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\ts, k := next(), nextInt()\n\tn := len(s)\n\n\tsubs := make([]string, 0)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i; j < n && j-i < k; j++ {\n\t\t\tsub := string(s[i : j+1])\n\t\t\tsubs = append(subs, sub)\n\t\t}\n\t}\n\tsort.Sort(sort.StringSlice(subs))\n\n\tfor i, cnt := 0, 1; cnt <= k; i, cnt = i+1, cnt+1 {\n\t\tif cnt == k {\n\t\t\tputs(subs[i])\n\t\t\tbreak\n\t\t}\n\t\tfor i+1 < len(subs) && subs[i+1] == subs[i] {\n\t\t\ti++\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string s.\nAmong the different substrings of s, print the K-th lexicographically smallest one.\n\nA substring of s is a string obtained by taking out a non-empty contiguous part in s.\nFor example, if s = ababc, a, bab and ababc are substrings of s, while ac, z and an empty string are not.\nAlso, we say that substrings are different when they are different as strings.\n\nLet X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "sample_input": "aba\n4\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03355", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string s.\nAmong the different substrings of s, print the K-th lexicographically smallest one.\n\nA substring of s is a string obtained by taking out a non-empty contiguous part in s.\nFor example, if s = ababc, a, bab and ababc are substrings of s, while ac, z and an empty string are not.\nAlso, we say that substrings are different when they are different as strings.\n\nLet X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \\neq y_{j}.\n\nConstraints\n\n1 ≤ |s| ≤ 5000\n\ns consists of lowercase English letters.\n\n1 ≤ K ≤ 5\n\ns has at least K different substrings.\n\nPartial Score\n\n200 points will be awarded as a partial score for passing the test set satisfying |s| ≤ 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the K-th lexicographically smallest substring of K.\n\nSample Input 1\n\naba\n4\n\nSample Output 1\n\nb\n\ns has five substrings: a, b, ab, ba and aba.\nAmong them, we should print the fourth smallest one, b.\nNote that we do not count a twice.\n\nSample Input 2\n\natcoderandatcodeer\n5\n\nSample Output 2\n\nandat\n\nSample Input 3\n\nz\n1\n\nSample Output 3\n\nz", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 887, "cpu_time_ms": 11, "memory_kb": 2816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s415150279", "group_id": "codeNet:p03359", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif b >= a {\n\t\tfmt.Println(a)\n\t\treturn\n\t}\n\tfmt.Println(a - 1)\n}\n", "language": "Go", "metadata": {"date": 1566442607, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03359.html", "problem_id": "p03359", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03359/input.txt", "sample_output_relpath": "derived/input_output/data/p03359/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03359/Go/s415150279.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s415150279", "user_id": "u937220467"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif b >= a {\n\t\tfmt.Println(a)\n\t\treturn\n\t}\n\tfmt.Println(a - 1)\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder Kingdom, Gregorian calendar is used, and dates are written in the \"year-month-day\" order, or the \"month-day\" order without the year.\n\nFor example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.\n\nIn this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi.\n\nHow many days from 2018-1-1 through 2018-a-b are Takahashi?\n\nConstraints\n\na is an integer between 1 and 12 (inclusive).\n\nb is an integer between 1 and 31 (inclusive).\n\n2018-a-b is a valid date in Gregorian calendar.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the number of days from 2018-1-1 through 2018-a-b that are Takahashi.\n\nSample Input 1\n\n5 5\n\nSample Output 1\n\n5\n\nThere are five days that are Takahashi: 1-1, 2-2, 3-3, 4-4 and 5-5.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\n1\n\nThere is only one day that is Takahashi: 1-1.\n\nSample Input 3\n\n11 30\n\nSample Output 3\n\n11\n\nThere are eleven days that are Takahashi: 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10 and 11-11.", "sample_input": "5 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03359", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder Kingdom, Gregorian calendar is used, and dates are written in the \"year-month-day\" order, or the \"month-day\" order without the year.\n\nFor example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.\n\nIn this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi.\n\nHow many days from 2018-1-1 through 2018-a-b are Takahashi?\n\nConstraints\n\na is an integer between 1 and 12 (inclusive).\n\nb is an integer between 1 and 31 (inclusive).\n\n2018-a-b is a valid date in Gregorian calendar.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint the number of days from 2018-1-1 through 2018-a-b that are Takahashi.\n\nSample Input 1\n\n5 5\n\nSample Output 1\n\n5\n\nThere are five days that are Takahashi: 1-1, 2-2, 3-3, 4-4 and 5-5.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\n1\n\nThere is only one day that is Takahashi: 1-1.\n\nSample Input 3\n\n11 30\n\nSample Output 3\n\n11\n\nThere are eleven days that are Takahashi: 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10 and 11-11.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 138, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s445734136", "group_id": "codeNet:p03360", "input_text": "package main\n\nimport(\n \"fmt\"\n \"sort\"\n \"strings\"\n)\n\n\n\nfunc main() {\n var a,b,c int64\n var k uint\n fmt.Scan(&a,&b,&c,&k)\n ans := a + b + c + (max64(a,max64(b,c))<= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc scanNums(len int) (nums []int){\n var num int\n for i:=0; i= w {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif y+dy[k] < 0 || y+dy[k] >= h {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif s[y+dy[k]][x+dx[k]] == \"#\" {\n\t\t\t\t\tb = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !b {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}", "language": "Go", "metadata": {"date": 1559999991, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03361.html", "problem_id": "p03361", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03361/input.txt", "sample_output_relpath": "derived/input_output/data/p03361/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03361/Go/s175466742.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s175466742", "user_id": "u298152049"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tvar t string\n\tdy := []int{-1, 0, 1, 0}\n\tdx := []int{0, 1, 0, -1}\n\tfmt.Scan(&h, &w)\n\n\ts := make([][]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&t)\n\t\tws := make([]string, w)\n\t\tfor j, v := range t {\n\t\t\tws[j] = string(v)\n\t\t}\n\t\ts[i] = ws\n\t}\n\tfor y := 0; y < h; y++ {\n\t\tfor x := 0; x < w; x++ {\n\t\t\tif s[y][x] == \".\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tb := false\n\t\t\tfor k := 0; k < 4; k++ {\n\t\t\t\tif x+dx[k] < 0 || x+dx[k] >= w {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif y+dy[k] < 0 || y+dy[k] >= h {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif s[y+dy[k]][x+dx[k]] == \"#\" {\n\t\t\t\t\tb = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !b {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a canvas divided into a grid with H rows and W columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j).\n\nInitially, all the squares are white. square1001 wants to draw a picture with black paint. His specific objective is to make Square (i, j) black when s_{i, j}= #, and to make Square (i, j) white when s_{i, j}= ..\n\nHowever, since he is not a good painter, he can only choose two squares that are horizontally or vertically adjacent and paint those squares black, for some number of times (possibly zero). He may choose squares that are already painted black, in which case the color of those squares remain black.\n\nDetermine if square1001 can achieve his objective.\n\nConstraints\n\nH is an integer between 1 and 50 (inclusive).\n\nW is an integer between 1 and 50 (inclusive).\n\nFor every (i, j) (1 \\leq i \\leq H, 1 \\leq j \\leq W), s_{i, j} is # or ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1} s_{1, 2} s_{1, 3} ... s_{1, W}\ns_{2, 1} s_{2, 2} s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1} s_{H, 2} s_{H, 3} ... s_{H, W}\n\nOutput\n\nIf square1001 can achieve his objective, print Yes; if he cannot, print No.\n\nSample Input 1\n\n3 3\n.#.\n###\n.#.\n\nSample Output 1\n\nYes\n\nOne possible way to achieve the objective is shown in the figure below. Here, the squares being painted are marked by stars.\n\nSample Input 2\n\n5 5\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n\nSample Output 2\n\nNo\n\nsquare1001 cannot achieve his objective here.\n\nSample Input 3\n\n11 11\n...#####...\n.##.....##.\n#..##.##..#\n#..##.##..#\n#.........#\n#...###...#\n.#########.\n.#.#.#.#.#.\n##.#.#.#.##\n..##.#.##..\n.##..#..##.\n\nSample Output 3\n\nYes", "sample_input": "3 3\n.#.\n###\n.#.\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03361", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a canvas divided into a grid with H rows and W columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j).\n\nInitially, all the squares are white. square1001 wants to draw a picture with black paint. His specific objective is to make Square (i, j) black when s_{i, j}= #, and to make Square (i, j) white when s_{i, j}= ..\n\nHowever, since he is not a good painter, he can only choose two squares that are horizontally or vertically adjacent and paint those squares black, for some number of times (possibly zero). He may choose squares that are already painted black, in which case the color of those squares remain black.\n\nDetermine if square1001 can achieve his objective.\n\nConstraints\n\nH is an integer between 1 and 50 (inclusive).\n\nW is an integer between 1 and 50 (inclusive).\n\nFor every (i, j) (1 \\leq i \\leq H, 1 \\leq j \\leq W), s_{i, j} is # or ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1} s_{1, 2} s_{1, 3} ... s_{1, W}\ns_{2, 1} s_{2, 2} s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1} s_{H, 2} s_{H, 3} ... s_{H, W}\n\nOutput\n\nIf square1001 can achieve his objective, print Yes; if he cannot, print No.\n\nSample Input 1\n\n3 3\n.#.\n###\n.#.\n\nSample Output 1\n\nYes\n\nOne possible way to achieve the objective is shown in the figure below. Here, the squares being painted are marked by stars.\n\nSample Input 2\n\n5 5\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n\nSample Output 2\n\nNo\n\nsquare1001 cannot achieve his objective here.\n\nSample Input 3\n\n11 11\n...#####...\n.##.....##.\n#..##.##..#\n#..##.##..#\n#.........#\n#...###...#\n.#########.\n.#.#.#.#.#.\n##.#.#.#.##\n..##.#.##..\n.##..#..##.\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 697, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s137777343", "group_id": "codeNet:p03361", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() (int, []int) {\n\tn := readInt()\n\treturn n, readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc isPaintable(s [][]byte, i, j int) bool {\n\tif s[i][j] == '.' {\n\t\treturn true\n\t}\n\n\tx := []int{-1, 0, 1, 0}\n\ty := []int{0, -1, 0, 1}\n\th := len(s)\n\tw := len(s[i])\n\n\tfor d := range x {\n\t\tnx := i + x[d]\n\t\tny := j + y[d]\n\t\tif nx < 0 || h <= nx || ny < 0 || w <= ny {\n\t\t\tcontinue\n\t\t}\n\t\tif s[nx][ny] == '#' {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\th := readInt()\n\t_ = readInt()\n\ts := make([][]byte, h)\n\tfor i := range s {\n\t\ts[i] = []byte(readString())\n\t}\n\tfor i := range s {\n\t\tfor j := range s[i] {\n\t\t\tif !isPaintable(s, i, j) {\n\t\t\t\tprintln(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tprintln(\"Yes\")\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1541211173, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03361.html", "problem_id": "p03361", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03361/input.txt", "sample_output_relpath": "derived/input_output/data/p03361/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03361/Go/s137777343.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s137777343", "user_id": "u705974985"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() (int, []int) {\n\tn := readInt()\n\treturn n, readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc isPaintable(s [][]byte, i, j int) bool {\n\tif s[i][j] == '.' {\n\t\treturn true\n\t}\n\n\tx := []int{-1, 0, 1, 0}\n\ty := []int{0, -1, 0, 1}\n\th := len(s)\n\tw := len(s[i])\n\n\tfor d := range x {\n\t\tnx := i + x[d]\n\t\tny := j + y[d]\n\t\tif nx < 0 || h <= nx || ny < 0 || w <= ny {\n\t\t\tcontinue\n\t\t}\n\t\tif s[nx][ny] == '#' {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\th := readInt()\n\t_ = readInt()\n\ts := make([][]byte, h)\n\tfor i := range s {\n\t\ts[i] = []byte(readString())\n\t}\n\tfor i := range s {\n\t\tfor j := range s[i] {\n\t\t\tif !isPaintable(s, i, j) {\n\t\t\t\tprintln(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tprintln(\"Yes\")\n}\n\n// -----------------------------------------------------------------------------\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a canvas divided into a grid with H rows and W columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j).\n\nInitially, all the squares are white. square1001 wants to draw a picture with black paint. His specific objective is to make Square (i, j) black when s_{i, j}= #, and to make Square (i, j) white when s_{i, j}= ..\n\nHowever, since he is not a good painter, he can only choose two squares that are horizontally or vertically adjacent and paint those squares black, for some number of times (possibly zero). He may choose squares that are already painted black, in which case the color of those squares remain black.\n\nDetermine if square1001 can achieve his objective.\n\nConstraints\n\nH is an integer between 1 and 50 (inclusive).\n\nW is an integer between 1 and 50 (inclusive).\n\nFor every (i, j) (1 \\leq i \\leq H, 1 \\leq j \\leq W), s_{i, j} is # or ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1} s_{1, 2} s_{1, 3} ... s_{1, W}\ns_{2, 1} s_{2, 2} s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1} s_{H, 2} s_{H, 3} ... s_{H, W}\n\nOutput\n\nIf square1001 can achieve his objective, print Yes; if he cannot, print No.\n\nSample Input 1\n\n3 3\n.#.\n###\n.#.\n\nSample Output 1\n\nYes\n\nOne possible way to achieve the objective is shown in the figure below. Here, the squares being painted are marked by stars.\n\nSample Input 2\n\n5 5\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n\nSample Output 2\n\nNo\n\nsquare1001 cannot achieve his objective here.\n\nSample Input 3\n\n11 11\n...#####...\n.##.....##.\n#..##.##..#\n#..##.##..#\n#.........#\n#...###...#\n.#########.\n.#.#.#.#.#.\n##.#.#.#.##\n..##.#.##..\n.##..#..##.\n\nSample Output 3\n\nYes", "sample_input": "3 3\n.#.\n###\n.#.\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03361", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a canvas divided into a grid with H rows and W columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j).\n\nInitially, all the squares are white. square1001 wants to draw a picture with black paint. His specific objective is to make Square (i, j) black when s_{i, j}= #, and to make Square (i, j) white when s_{i, j}= ..\n\nHowever, since he is not a good painter, he can only choose two squares that are horizontally or vertically adjacent and paint those squares black, for some number of times (possibly zero). He may choose squares that are already painted black, in which case the color of those squares remain black.\n\nDetermine if square1001 can achieve his objective.\n\nConstraints\n\nH is an integer between 1 and 50 (inclusive).\n\nW is an integer between 1 and 50 (inclusive).\n\nFor every (i, j) (1 \\leq i \\leq H, 1 \\leq j \\leq W), s_{i, j} is # or ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1} s_{1, 2} s_{1, 3} ... s_{1, W}\ns_{2, 1} s_{2, 2} s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1} s_{H, 2} s_{H, 3} ... s_{H, W}\n\nOutput\n\nIf square1001 can achieve his objective, print Yes; if he cannot, print No.\n\nSample Input 1\n\n3 3\n.#.\n###\n.#.\n\nSample Output 1\n\nYes\n\nOne possible way to achieve the objective is shown in the figure below. Here, the squares being painted are marked by stars.\n\nSample Input 2\n\n5 5\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n\nSample Output 2\n\nNo\n\nsquare1001 cannot achieve his objective here.\n\nSample Input 3\n\n11 11\n...#####...\n.##.....##.\n#..##.##..#\n#..##.##..#\n#.........#\n#...###...#\n.#########.\n.#.#.#.#.#.\n##.#.#.#.##\n..##.#.##..\n.##..#..##.\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2007, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s823213639", "group_id": "codeNet:p03362", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nvar p = []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891, 17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971, 17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059, 18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143, 18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233, 18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313, 18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427, 18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517, 18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637, 18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749, 18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899, 18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009, 19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121, 19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219, 19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319, 19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423, 19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477, 19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571, 19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699, 19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793, 19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891, 19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991, 19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071, 20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149, 20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261, 20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357, 20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443, 20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551, 20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693, 20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771, 20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897, 20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983, 21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067, 21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169, 21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277, 21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383, 21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491, 21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563, 21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647, 21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751, 21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841, 21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943, 21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039, 22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123, 22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229, 22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307, 22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441, 22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543, 22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643, 22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727, 22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817, 22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943, 22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029, 23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099, 23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203, 23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321, 23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447, 23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561, 23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629, 23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743, 23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827, 23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909, 23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007, 24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091, 24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169, 24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281, 24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413, 24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517, 24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659, 24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767, 24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877, 24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977, 24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097, 25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183, 25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303, 25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391, 25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471, 25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603, 25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693, 25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799, 25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913, 25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999, 26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111, 26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203, 26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297, 26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399, 26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497, 26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633, 26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711, 26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801, 26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891, 26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987, 26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077, 27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211, 27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329, 27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449, 27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551, 27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691, 27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767, 27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827, 27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947, 27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051, 28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151, 28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283, 28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403, 28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499, 28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579, 28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649, 28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729, 28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837, 28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933, 28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059, 29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167, 29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251, 29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363, 29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443, 29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573, 29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671, 29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819, 29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921, 29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059, 30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137, 30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241, 30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341, 30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469, 30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559, 30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689, 30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803, 30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871, 30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983, 31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091, 31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183, 31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259, 31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357, 31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511, 31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601, 31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721, 31723, 31727, 31729, 31741, 31751, 31769, 31771, 31793, 31799, 31817, 31847, 31849, 31859, 31873, 31883, 31891, 31907, 31957, 31963, 31973, 31981, 31991, 32003, 32009, 32027, 32029, 32051, 32057, 32059, 32063, 32069, 32077, 32083, 32089, 32099, 32117, 32119, 32141, 32143, 32159, 32173, 32183, 32189, 32191, 32203, 32213, 32233, 32237, 32251, 32257, 32261, 32297, 32299, 32303, 32309, 32321, 32323, 32327, 32341, 32353, 32359, 32363, 32369, 32371, 32377, 32381, 32401, 32411, 32413, 32423, 32429, 32441, 32443, 32467, 32479, 32491, 32497, 32503, 32507, 32531, 32533, 32537, 32561, 32563, 32569, 32573, 32579, 32587, 32603, 32609, 32611, 32621, 32633, 32647, 32653, 32687, 32693, 32707, 32713, 32717, 32719, 32749, 32771, 32779, 32783, 32789, 32797, 32801, 32803, 32831, 32833, 32839, 32843, 32869, 32887, 32909, 32911, 32917, 32933, 32939, 32941, 32957, 32969, 32971, 32983, 32987, 32993, 32999, 33013, 33023, 33029, 33037, 33049, 33053, 33071, 33073, 33083, 33091, 33107, 33113, 33119, 33149, 33151, 33161, 33179, 33181, 33191, 33199, 33203, 33211, 33223, 33247, 33287, 33289, 33301, 33311, 33317, 33329, 33331, 33343, 33347, 33349, 33353, 33359, 33377, 33391, 33403, 33409, 33413, 33427, 33457, 33461, 33469, 33479, 33487, 33493, 33503, 33521, 33529, 33533, 33547, 33563, 33569, 33577, 33581, 33587, 33589, 33599, 33601, 33613, 33617, 33619, 33623, 33629, 33637, 33641, 33647, 33679, 33703, 33713, 33721, 33739, 33749, 33751, 33757, 33767, 33769, 33773, 33791, 33797, 33809, 33811, 33827, 33829, 33851, 33857, 33863, 33871, 33889, 33893, 33911, 33923, 33931, 33937, 33941, 33961, 33967, 33997, 34019, 34031, 34033, 34039, 34057, 34061, 34123, 34127, 34129, 34141, 34147, 34157, 34159, 34171, 34183, 34211, 34213, 34217, 34231, 34253, 34259, 34261, 34267, 34273, 34283, 34297, 34301, 34303, 34313, 34319, 34327, 34337, 34351, 34361, 34367, 34369, 34381, 34403, 34421, 34429, 34439, 34457, 34469, 34471, 34483, 34487, 34499, 34501, 34511, 34513, 34519, 34537, 34543, 34549, 34583, 34589, 34591, 34603, 34607, 34613, 34631, 34649, 34651, 34667, 34673, 34679, 34687, 34693, 34703, 34721, 34729, 34739, 34747, 34757, 34759, 34763, 34781, 34807, 34819, 34841, 34843, 34847, 34849, 34871, 34877, 34883, 34897, 34913, 34919, 34939, 34949, 34961, 34963, 34981, 35023, 35027, 35051, 35053, 35059, 35069, 35081, 35083, 35089, 35099, 35107, 35111, 35117, 35129, 35141, 35149, 35153, 35159, 35171, 35201, 35221, 35227, 35251, 35257, 35267, 35279, 35281, 35291, 35311, 35317, 35323, 35327, 35339, 35353, 35363, 35381, 35393, 35401, 35407, 35419, 35423, 35437, 35447, 35449, 35461, 35491, 35507, 35509, 35521, 35527, 35531, 35533, 35537, 35543, 35569, 35573, 35591, 35593, 35597, 35603, 35617, 35671, 35677, 35729, 35731, 35747, 35753, 35759, 35771, 35797, 35801, 35803, 35809, 35831, 35837, 35839, 35851, 35863, 35869, 35879, 35897, 35899, 35911, 35923, 35933, 35951, 35963, 35969, 35977, 35983, 35993, 35999, 36007, 36011, 36013, 36017, 36037, 36061, 36067, 36073, 36083, 36097, 36107, 36109, 36131, 36137, 36151, 36161, 36187, 36191, 36209, 36217, 36229, 36241, 36251, 36263, 36269, 36277, 36293, 36299, 36307, 36313, 36319, 36341, 36343, 36353, 36373, 36383, 36389, 36433, 36451, 36457, 36467, 36469, 36473, 36479, 36493, 36497, 36523, 36527, 36529, 36541, 36551, 36559, 36563, 36571, 36583, 36587, 36599, 36607, 36629, 36637, 36643, 36653, 36671, 36677, 36683, 36691, 36697, 36709, 36713, 36721, 36739, 36749, 36761, 36767, 36779, 36781, 36787, 36791, 36793, 36809, 36821, 36833, 36847, 36857, 36871, 36877, 36887, 36899, 36901, 36913, 36919, 36923, 36929, 36931, 36943, 36947, 36973, 36979, 36997, 37003, 37013, 37019, 37021, 37039, 37049, 37057, 37061, 37087, 37097, 37117, 37123, 37139, 37159, 37171, 37181, 37189, 37199, 37201, 37217, 37223, 37243, 37253, 37273, 37277, 37307, 37309, 37313, 37321, 37337, 37339, 37357, 37361, 37363, 37369, 37379, 37397, 37409, 37423, 37441, 37447, 37463, 37483, 37489, 37493, 37501, 37507, 37511, 37517, 37529, 37537, 37547, 37549, 37561, 37567, 37571, 37573, 37579, 37589, 37591, 37607, 37619, 37633, 37643, 37649, 37657, 37663, 37691, 37693, 37699, 37717, 37747, 37781, 37783, 37799, 37811, 37813, 37831, 37847, 37853, 37861, 37871, 37879, 37889, 37897, 37907, 37951, 37957, 37963, 37967, 37987, 37991, 37993, 37997, 38011, 38039, 38047, 38053, 38069, 38083, 38113, 38119, 38149, 38153, 38167, 38177, 38183, 38189, 38197, 38201, 38219, 38231, 38237, 38239, 38261, 38273, 38281, 38287, 38299, 38303, 38317, 38321, 38327, 38329, 38333, 38351, 38371, 38377, 38393, 38431, 38447, 38449, 38453, 38459, 38461, 38501, 38543, 38557, 38561, 38567, 38569, 38593, 38603, 38609, 38611, 38629, 38639, 38651, 38653, 38669, 38671, 38677, 38693, 38699, 38707, 38711, 38713, 38723, 38729, 38737, 38747, 38749, 38767, 38783, 38791, 38803, 38821, 38833, 38839, 38851, 38861, 38867, 38873, 38891, 38903, 38917, 38921, 38923, 38933, 38953, 38959, 38971, 38977, 38993, 39019, 39023, 39041, 39043, 39047, 39079, 39089, 39097, 39103, 39107, 39113, 39119, 39133, 39139, 39157, 39161, 39163, 39181, 39191, 39199, 39209, 39217, 39227, 39229, 39233, 39239, 39241, 39251, 39293, 39301, 39313, 39317, 39323, 39341, 39343, 39359, 39367, 39371, 39373, 39383, 39397, 39409, 39419, 39439, 39443, 39451, 39461, 39499, 39503, 39509, 39511, 39521, 39541, 39551, 39563, 39569, 39581, 39607, 39619, 39623, 39631, 39659, 39667, 39671, 39679, 39703, 39709, 39719, 39727, 39733, 39749, 39761, 39769, 39779, 39791, 39799, 39821, 39827, 39829, 39839, 39841, 39847, 39857, 39863, 39869, 39877, 39883, 39887, 39901, 39929, 39937, 39953, 39971, 39979, 39983, 39989, 40009, 40013, 40031, 40037, 40039, 40063, 40087, 40093, 40099, 40111, 40123, 40127, 40129, 40151, 40153, 40163, 40169, 40177, 40189, 40193, 40213, 40231, 40237, 40241, 40253, 40277, 40283, 40289, 40343, 40351, 40357, 40361, 40387, 40423, 40427, 40429, 40433, 40459, 40471, 40483, 40487, 40493, 40499, 40507, 40519, 40529, 40531, 40543, 40559, 40577, 40583, 40591, 40597, 40609, 40627, 40637, 40639, 40693, 40697, 40699, 40709, 40739, 40751, 40759, 40763, 40771, 40787, 40801, 40813, 40819, 40823, 40829, 40841, 40847, 40849, 40853, 40867, 40879, 40883, 40897, 40903, 40927, 40933, 40939, 40949, 40961, 40973, 40993, 41011, 41017, 41023, 41039, 41047, 41051, 41057, 41077, 41081, 41113, 41117, 41131, 41141, 41143, 41149, 41161, 41177, 41179, 41183, 41189, 41201, 41203, 41213, 41221, 41227, 41231, 41233, 41243, 41257, 41263, 41269, 41281, 41299, 41333, 41341, 41351, 41357, 41381, 41387, 41389, 41399, 41411, 41413, 41443, 41453, 41467, 41479, 41491, 41507, 41513, 41519, 41521, 41539, 41543, 41549, 41579, 41593, 41597, 41603, 41609, 41611, 41617, 41621, 41627, 41641, 41647, 41651, 41659, 41669, 41681, 41687, 41719, 41729, 41737, 41759, 41761, 41771, 41777, 41801, 41809, 41813, 41843, 41849, 41851, 41863, 41879, 41887, 41893, 41897, 41903, 41911, 41927, 41941, 41947, 41953, 41957, 41959, 41969, 41981, 41983, 41999, 42013, 42017, 42019, 42023, 42043, 42061, 42071, 42073, 42083, 42089, 42101, 42131, 42139, 42157, 42169, 42179, 42181, 42187, 42193, 42197, 42209, 42221, 42223, 42227, 42239, 42257, 42281, 42283, 42293, 42299, 42307, 42323, 42331, 42337, 42349, 42359, 42373, 42379, 42391, 42397, 42403, 42407, 42409, 42433, 42437, 42443, 42451, 42457, 42461, 42463, 42467, 42473, 42487, 42491, 42499, 42509, 42533, 42557, 42569, 42571, 42577, 42589, 42611, 42641, 42643, 42649, 42667, 42677, 42683, 42689, 42697, 42701, 42703, 42709, 42719, 42727, 42737, 42743, 42751, 42767, 42773, 42787, 42793, 42797, 42821, 42829, 42839, 42841, 42853, 42859, 42863, 42899, 42901, 42923, 42929, 42937, 42943, 42953, 42961, 42967, 42979, 42989, 43003, 43013, 43019, 43037, 43049, 43051, 43063, 43067, 43093, 43103, 43117, 43133, 43151, 43159, 43177, 43189, 43201, 43207, 43223, 43237, 43261, 43271, 43283, 43291, 43313, 43319, 43321, 43331, 43391, 43397, 43399, 43403, 43411, 43427, 43441, 43451, 43457, 43481, 43487, 43499, 43517, 43541, 43543, 43573, 43577, 43579, 43591, 43597, 43607, 43609, 43613, 43627, 43633, 43649, 43651, 43661, 43669, 43691, 43711, 43717, 43721, 43753, 43759, 43777, 43781, 43783, 43787, 43789, 43793, 43801, 43853, 43867, 43889, 43891, 43913, 43933, 43943, 43951, 43961, 43963, 43969, 43973, 43987, 43991, 43997, 44017, 44021, 44027, 44029, 44041, 44053, 44059, 44071, 44087, 44089, 44101, 44111, 44119, 44123, 44129, 44131, 44159, 44171, 44179, 44189, 44201, 44203, 44207, 44221, 44249, 44257, 44263, 44267, 44269, 44273, 44279, 44281, 44293, 44351, 44357, 44371, 44381, 44383, 44389, 44417, 44449, 44453, 44483, 44491, 44497, 44501, 44507, 44519, 44531, 44533, 44537, 44543, 44549, 44563, 44579, 44587, 44617, 44621, 44623, 44633, 44641, 44647, 44651, 44657, 44683, 44687, 44699, 44701, 44711, 44729, 44741, 44753, 44771, 44773, 44777, 44789, 44797, 44809, 44819, 44839, 44843, 44851, 44867, 44879, 44887, 44893, 44909, 44917, 44927, 44939, 44953, 44959, 44963, 44971, 44983, 44987, 45007, 45013, 45053, 45061, 45077, 45083, 45119, 45121, 45127, 45131, 45137, 45139, 45161, 45179, 45181, 45191, 45197, 45233, 45247, 45259, 45263, 45281, 45289, 45293, 45307, 45317, 45319, 45329, 45337, 45341, 45343, 45361, 45377, 45389, 45403, 45413, 45427, 45433, 45439, 45481, 45491, 45497, 45503, 45523, 45533, 45541, 45553, 45557, 45569, 45587, 45589, 45599, 45613, 45631, 45641, 45659, 45667, 45673, 45677, 45691, 45697, 45707, 45737, 45751, 45757, 45763, 45767, 45779, 45817, 45821, 45823, 45827, 45833, 45841, 45853, 45863, 45869, 45887, 45893, 45943, 45949, 45953, 45959, 45971, 45979, 45989, 46021, 46027, 46049, 46051, 46061, 46073, 46091, 46093, 46099, 46103, 46133, 46141, 46147, 46153, 46171, 46181, 46183, 46187, 46199, 46219, 46229, 46237, 46261, 46271, 46273, 46279, 46301, 46307, 46309, 46327, 46337, 46349, 46351, 46381, 46399, 46411, 46439, 46441, 46447, 46451, 46457, 46471, 46477, 46489, 46499, 46507, 46511, 46523, 46549, 46559, 46567, 46573, 46589, 46591, 46601, 46619, 46633, 46639, 46643, 46649, 46663, 46679, 46681, 46687, 46691, 46703, 46723, 46727, 46747, 46751, 46757, 46769, 46771, 46807, 46811, 46817, 46819, 46829, 46831, 46853, 46861, 46867, 46877, 46889, 46901, 46919, 46933, 46957, 46993, 46997, 47017, 47041, 47051, 47057, 47059, 47087, 47093, 47111, 47119, 47123, 47129, 47137, 47143, 47147, 47149, 47161, 47189, 47207, 47221, 47237, 47251, 47269, 47279, 47287, 47293, 47297, 47303, 47309, 47317, 47339, 47351, 47353, 47363, 47381, 47387, 47389, 47407, 47417, 47419, 47431, 47441, 47459, 47491, 47497, 47501, 47507, 47513, 47521, 47527, 47533, 47543, 47563, 47569, 47581, 47591, 47599, 47609, 47623, 47629, 47639, 47653, 47657, 47659, 47681, 47699, 47701, 47711, 47713, 47717, 47737, 47741, 47743, 47777, 47779, 47791, 47797, 47807, 47809, 47819, 47837, 47843, 47857, 47869, 47881, 47903, 47911, 47917, 47933, 47939, 47947, 47951, 47963, 47969, 47977, 47981, 48017, 48023, 48029, 48049, 48073, 48079, 48091, 48109, 48119, 48121, 48131, 48157, 48163, 48179, 48187, 48193, 48197, 48221, 48239, 48247, 48259, 48271, 48281, 48299, 48311, 48313, 48337, 48341, 48353, 48371, 48383, 48397, 48407, 48409, 48413, 48437, 48449, 48463, 48473, 48479, 48481, 48487, 48491, 48497, 48523, 48527, 48533, 48539, 48541, 48563, 48571, 48589, 48593, 48611, 48619, 48623, 48647, 48649, 48661, 48673, 48677, 48679, 48731, 48733, 48751, 48757, 48761, 48767, 48779, 48781, 48787, 48799, 48809, 48817, 48821, 48823, 48847, 48857, 48859, 48869, 48871, 48883, 48889, 48907, 48947, 48953, 48973, 48989, 48991, 49003, 49009, 49019, 49031, 49033, 49037, 49043, 49057, 49069, 49081, 49103, 49109, 49117, 49121, 49123, 49139, 49157, 49169, 49171, 49177, 49193, 49199, 49201, 49207, 49211, 49223, 49253, 49261, 49277, 49279, 49297, 49307, 49331, 49333, 49339, 49363, 49367, 49369, 49391, 49393, 49409, 49411, 49417, 49429, 49433, 49451, 49459, 49463, 49477, 49481, 49499, 49523, 49529, 49531, 49537, 49547, 49549, 49559, 49597, 49603, 49613, 49627, 49633, 49639, 49663, 49667, 49669, 49681, 49697, 49711, 49727, 49739, 49741, 49747, 49757, 49783, 49787, 49789, 49801, 49807, 49811, 49823, 49831, 49843, 49853, 49871, 49877, 49891, 49919, 49921, 49927, 49937, 49939, 49943, 49957, 49991, 49993, 49999, 50021, 50023, 50033, 50047, 50051, 50053, 50069, 50077, 50087, 50093, 50101, 50111, 50119, 50123, 50129, 50131, 50147, 50153, 50159, 50177, 50207, 50221, 50227, 50231, 50261, 50263, 50273, 50287, 50291, 50311, 50321, 50329, 50333, 50341, 50359, 50363, 50377, 50383, 50387, 50411, 50417, 50423, 50441, 50459, 50461, 50497, 50503, 50513, 50527, 50539, 50543, 50549, 50551, 50581, 50587, 50591, 50593, 50599, 50627, 50647, 50651, 50671, 50683, 50707, 50723, 50741, 50753, 50767, 50773, 50777, 50789, 50821, 50833, 50839, 50849, 50857, 50867, 50873, 50891, 50893, 50909, 50923, 50929, 50951, 50957, 50969, 50971, 50989, 50993, 51001, 51031, 51043, 51047, 51059, 51061, 51071, 51109, 51131, 51133, 51137, 51151, 51157, 51169, 51193, 51197, 51199, 51203, 51217, 51229, 51239, 51241, 51257, 51263, 51283, 51287, 51307, 51329, 51341, 51343, 51347, 51349, 51361, 51383, 51407, 51413, 51419, 51421, 51427, 51431, 51437, 51439, 51449, 51461, 51473, 51479, 51481, 51487, 51503, 51511, 51517, 51521, 51539, 51551, 51563, 51577, 51581, 51593, 51599, 51607, 51613, 51631, 51637, 51647, 51659, 51673, 51679, 51683, 51691, 51713, 51719, 51721, 51749, 51767, 51769, 51787, 51797, 51803, 51817, 51827, 51829, 51839, 51853, 51859, 51869, 51871, 51893, 51899, 51907, 51913, 51929, 51941, 51949, 51971, 51973, 51977, 51991, 52009, 52021, 52027, 52051, 52057, 52067, 52069, 52081, 52103, 52121, 52127, 52147, 52153, 52163, 52177, 52181, 52183, 52189, 52201, 52223, 52237, 52249, 52253, 52259, 52267, 52289, 52291, 52301, 52313, 52321, 52361, 52363, 52369, 52379, 52387, 52391, 52433, 52453, 52457, 52489, 52501, 52511, 52517, 52529, 52541, 52543, 52553, 52561, 52567, 52571, 52579, 52583, 52609, 52627, 52631, 52639, 52667, 52673, 52691, 52697, 52709, 52711, 52721, 52727, 52733, 52747, 52757, 52769, 52783, 52807, 52813, 52817, 52837, 52859, 52861, 52879, 52883, 52889, 52901, 52903, 52919, 52937, 52951, 52957, 52963, 52967, 52973, 52981, 52999, 53003, 53017, 53047, 53051, 53069, 53077, 53087, 53089, 53093, 53101, 53113, 53117, 53129, 53147, 53149, 53161, 53171, 53173, 53189, 53197, 53201, 53231, 53233, 53239, 53267, 53269, 53279, 53281, 53299, 53309, 53323, 53327, 53353, 53359, 53377, 53381, 53401, 53407, 53411, 53419, 53437, 53441, 53453, 53479, 53503, 53507, 53527, 53549, 53551, 53569, 53591, 53593, 53597, 53609, 53611, 53617, 53623, 53629, 53633, 53639, 53653, 53657, 53681, 53693, 53699, 53717, 53719, 53731, 53759, 53773, 53777, 53783, 53791, 53813, 53819, 53831, 53849, 53857, 53861, 53881, 53887, 53891, 53897, 53899, 53917, 53923, 53927, 53939, 53951, 53959, 53987, 53993, 54001, 54011, 54013, 54037, 54049, 54059, 54083, 54091, 54101, 54121, 54133, 54139, 54151, 54163, 54167, 54181, 54193, 54217, 54251, 54269, 54277, 54287, 54293, 54311, 54319, 54323, 54331, 54347, 54361, 54367, 54371, 54377, 54401, 54403, 54409, 54413, 54419, 54421, 54437, 54443, 54449, 54469, 54493, 54497, 54499, 54503, 54517, 54521, 54539, 54541, 54547, 54559, 54563, 54577, 54581, 54583, 54601, 54617, 54623, 54629, 54631, 54647, 54667, 54673, 54679, 54709, 54713, 54721, 54727, 54751, 54767, 54773, 54779, 54787, 54799, 54829, 54833, 54851, 54869, 54877, 54881, 54907, 54917, 54919, 54941, 54949, 54959, 54973, 54979, 54983, 55001, 55009, 55021, 55049, 55051, 55057, 55061, 55073, 55079, 55103, 55109, 55117, 55127, 55147, 55163, 55171, 55201, 55207, 55213, 55217, 55219, 55229, 55243, 55249, 55259, 55291, 55313, 55331, 55333, 55337, 55339, 55343, 55351, 55373, 55381, 55399, 55411, 55439, 55441, 55457, 55469, 55487, 55501, 55511, 55529, 55541, 55547}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n fmt.Printf(\"%d\", p[5093])\n for i := 5094; i < 5093+n; i++ {\n fmt.Printf(\" %d\", p[i])\n }\n fmt.Printf(\"\\n\")\n}", "language": "Go", "metadata": {"date": 1525573764, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03362.html", "problem_id": "p03362", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03362/input.txt", "sample_output_relpath": "derived/input_output/data/p03362/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03362/Go/s823213639.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s823213639", "user_id": "u882460931"}, "prompt_components": {"gold_output": "3 5 7 11 31\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nvar p = []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891, 17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971, 17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059, 18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143, 18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233, 18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313, 18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427, 18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517, 18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637, 18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749, 18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899, 18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009, 19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121, 19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219, 19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319, 19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423, 19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477, 19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571, 19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699, 19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793, 19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891, 19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991, 19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071, 20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149, 20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261, 20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357, 20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443, 20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551, 20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693, 20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771, 20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897, 20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983, 21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067, 21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169, 21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277, 21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383, 21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491, 21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563, 21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647, 21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751, 21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841, 21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943, 21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039, 22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123, 22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229, 22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307, 22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441, 22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543, 22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643, 22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727, 22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817, 22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943, 22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029, 23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099, 23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203, 23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321, 23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447, 23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561, 23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629, 23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743, 23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827, 23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909, 23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007, 24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091, 24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169, 24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281, 24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413, 24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517, 24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659, 24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767, 24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877, 24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977, 24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097, 25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183, 25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303, 25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391, 25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471, 25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603, 25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693, 25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799, 25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913, 25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999, 26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111, 26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203, 26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297, 26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399, 26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497, 26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633, 26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711, 26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801, 26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891, 26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987, 26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077, 27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211, 27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329, 27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449, 27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551, 27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691, 27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767, 27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827, 27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947, 27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051, 28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151, 28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283, 28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403, 28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499, 28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579, 28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649, 28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729, 28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837, 28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933, 28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059, 29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167, 29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251, 29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363, 29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443, 29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573, 29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671, 29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819, 29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921, 29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059, 30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137, 30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241, 30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341, 30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469, 30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559, 30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689, 30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803, 30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871, 30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983, 31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091, 31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183, 31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259, 31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357, 31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511, 31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601, 31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721, 31723, 31727, 31729, 31741, 31751, 31769, 31771, 31793, 31799, 31817, 31847, 31849, 31859, 31873, 31883, 31891, 31907, 31957, 31963, 31973, 31981, 31991, 32003, 32009, 32027, 32029, 32051, 32057, 32059, 32063, 32069, 32077, 32083, 32089, 32099, 32117, 32119, 32141, 32143, 32159, 32173, 32183, 32189, 32191, 32203, 32213, 32233, 32237, 32251, 32257, 32261, 32297, 32299, 32303, 32309, 32321, 32323, 32327, 32341, 32353, 32359, 32363, 32369, 32371, 32377, 32381, 32401, 32411, 32413, 32423, 32429, 32441, 32443, 32467, 32479, 32491, 32497, 32503, 32507, 32531, 32533, 32537, 32561, 32563, 32569, 32573, 32579, 32587, 32603, 32609, 32611, 32621, 32633, 32647, 32653, 32687, 32693, 32707, 32713, 32717, 32719, 32749, 32771, 32779, 32783, 32789, 32797, 32801, 32803, 32831, 32833, 32839, 32843, 32869, 32887, 32909, 32911, 32917, 32933, 32939, 32941, 32957, 32969, 32971, 32983, 32987, 32993, 32999, 33013, 33023, 33029, 33037, 33049, 33053, 33071, 33073, 33083, 33091, 33107, 33113, 33119, 33149, 33151, 33161, 33179, 33181, 33191, 33199, 33203, 33211, 33223, 33247, 33287, 33289, 33301, 33311, 33317, 33329, 33331, 33343, 33347, 33349, 33353, 33359, 33377, 33391, 33403, 33409, 33413, 33427, 33457, 33461, 33469, 33479, 33487, 33493, 33503, 33521, 33529, 33533, 33547, 33563, 33569, 33577, 33581, 33587, 33589, 33599, 33601, 33613, 33617, 33619, 33623, 33629, 33637, 33641, 33647, 33679, 33703, 33713, 33721, 33739, 33749, 33751, 33757, 33767, 33769, 33773, 33791, 33797, 33809, 33811, 33827, 33829, 33851, 33857, 33863, 33871, 33889, 33893, 33911, 33923, 33931, 33937, 33941, 33961, 33967, 33997, 34019, 34031, 34033, 34039, 34057, 34061, 34123, 34127, 34129, 34141, 34147, 34157, 34159, 34171, 34183, 34211, 34213, 34217, 34231, 34253, 34259, 34261, 34267, 34273, 34283, 34297, 34301, 34303, 34313, 34319, 34327, 34337, 34351, 34361, 34367, 34369, 34381, 34403, 34421, 34429, 34439, 34457, 34469, 34471, 34483, 34487, 34499, 34501, 34511, 34513, 34519, 34537, 34543, 34549, 34583, 34589, 34591, 34603, 34607, 34613, 34631, 34649, 34651, 34667, 34673, 34679, 34687, 34693, 34703, 34721, 34729, 34739, 34747, 34757, 34759, 34763, 34781, 34807, 34819, 34841, 34843, 34847, 34849, 34871, 34877, 34883, 34897, 34913, 34919, 34939, 34949, 34961, 34963, 34981, 35023, 35027, 35051, 35053, 35059, 35069, 35081, 35083, 35089, 35099, 35107, 35111, 35117, 35129, 35141, 35149, 35153, 35159, 35171, 35201, 35221, 35227, 35251, 35257, 35267, 35279, 35281, 35291, 35311, 35317, 35323, 35327, 35339, 35353, 35363, 35381, 35393, 35401, 35407, 35419, 35423, 35437, 35447, 35449, 35461, 35491, 35507, 35509, 35521, 35527, 35531, 35533, 35537, 35543, 35569, 35573, 35591, 35593, 35597, 35603, 35617, 35671, 35677, 35729, 35731, 35747, 35753, 35759, 35771, 35797, 35801, 35803, 35809, 35831, 35837, 35839, 35851, 35863, 35869, 35879, 35897, 35899, 35911, 35923, 35933, 35951, 35963, 35969, 35977, 35983, 35993, 35999, 36007, 36011, 36013, 36017, 36037, 36061, 36067, 36073, 36083, 36097, 36107, 36109, 36131, 36137, 36151, 36161, 36187, 36191, 36209, 36217, 36229, 36241, 36251, 36263, 36269, 36277, 36293, 36299, 36307, 36313, 36319, 36341, 36343, 36353, 36373, 36383, 36389, 36433, 36451, 36457, 36467, 36469, 36473, 36479, 36493, 36497, 36523, 36527, 36529, 36541, 36551, 36559, 36563, 36571, 36583, 36587, 36599, 36607, 36629, 36637, 36643, 36653, 36671, 36677, 36683, 36691, 36697, 36709, 36713, 36721, 36739, 36749, 36761, 36767, 36779, 36781, 36787, 36791, 36793, 36809, 36821, 36833, 36847, 36857, 36871, 36877, 36887, 36899, 36901, 36913, 36919, 36923, 36929, 36931, 36943, 36947, 36973, 36979, 36997, 37003, 37013, 37019, 37021, 37039, 37049, 37057, 37061, 37087, 37097, 37117, 37123, 37139, 37159, 37171, 37181, 37189, 37199, 37201, 37217, 37223, 37243, 37253, 37273, 37277, 37307, 37309, 37313, 37321, 37337, 37339, 37357, 37361, 37363, 37369, 37379, 37397, 37409, 37423, 37441, 37447, 37463, 37483, 37489, 37493, 37501, 37507, 37511, 37517, 37529, 37537, 37547, 37549, 37561, 37567, 37571, 37573, 37579, 37589, 37591, 37607, 37619, 37633, 37643, 37649, 37657, 37663, 37691, 37693, 37699, 37717, 37747, 37781, 37783, 37799, 37811, 37813, 37831, 37847, 37853, 37861, 37871, 37879, 37889, 37897, 37907, 37951, 37957, 37963, 37967, 37987, 37991, 37993, 37997, 38011, 38039, 38047, 38053, 38069, 38083, 38113, 38119, 38149, 38153, 38167, 38177, 38183, 38189, 38197, 38201, 38219, 38231, 38237, 38239, 38261, 38273, 38281, 38287, 38299, 38303, 38317, 38321, 38327, 38329, 38333, 38351, 38371, 38377, 38393, 38431, 38447, 38449, 38453, 38459, 38461, 38501, 38543, 38557, 38561, 38567, 38569, 38593, 38603, 38609, 38611, 38629, 38639, 38651, 38653, 38669, 38671, 38677, 38693, 38699, 38707, 38711, 38713, 38723, 38729, 38737, 38747, 38749, 38767, 38783, 38791, 38803, 38821, 38833, 38839, 38851, 38861, 38867, 38873, 38891, 38903, 38917, 38921, 38923, 38933, 38953, 38959, 38971, 38977, 38993, 39019, 39023, 39041, 39043, 39047, 39079, 39089, 39097, 39103, 39107, 39113, 39119, 39133, 39139, 39157, 39161, 39163, 39181, 39191, 39199, 39209, 39217, 39227, 39229, 39233, 39239, 39241, 39251, 39293, 39301, 39313, 39317, 39323, 39341, 39343, 39359, 39367, 39371, 39373, 39383, 39397, 39409, 39419, 39439, 39443, 39451, 39461, 39499, 39503, 39509, 39511, 39521, 39541, 39551, 39563, 39569, 39581, 39607, 39619, 39623, 39631, 39659, 39667, 39671, 39679, 39703, 39709, 39719, 39727, 39733, 39749, 39761, 39769, 39779, 39791, 39799, 39821, 39827, 39829, 39839, 39841, 39847, 39857, 39863, 39869, 39877, 39883, 39887, 39901, 39929, 39937, 39953, 39971, 39979, 39983, 39989, 40009, 40013, 40031, 40037, 40039, 40063, 40087, 40093, 40099, 40111, 40123, 40127, 40129, 40151, 40153, 40163, 40169, 40177, 40189, 40193, 40213, 40231, 40237, 40241, 40253, 40277, 40283, 40289, 40343, 40351, 40357, 40361, 40387, 40423, 40427, 40429, 40433, 40459, 40471, 40483, 40487, 40493, 40499, 40507, 40519, 40529, 40531, 40543, 40559, 40577, 40583, 40591, 40597, 40609, 40627, 40637, 40639, 40693, 40697, 40699, 40709, 40739, 40751, 40759, 40763, 40771, 40787, 40801, 40813, 40819, 40823, 40829, 40841, 40847, 40849, 40853, 40867, 40879, 40883, 40897, 40903, 40927, 40933, 40939, 40949, 40961, 40973, 40993, 41011, 41017, 41023, 41039, 41047, 41051, 41057, 41077, 41081, 41113, 41117, 41131, 41141, 41143, 41149, 41161, 41177, 41179, 41183, 41189, 41201, 41203, 41213, 41221, 41227, 41231, 41233, 41243, 41257, 41263, 41269, 41281, 41299, 41333, 41341, 41351, 41357, 41381, 41387, 41389, 41399, 41411, 41413, 41443, 41453, 41467, 41479, 41491, 41507, 41513, 41519, 41521, 41539, 41543, 41549, 41579, 41593, 41597, 41603, 41609, 41611, 41617, 41621, 41627, 41641, 41647, 41651, 41659, 41669, 41681, 41687, 41719, 41729, 41737, 41759, 41761, 41771, 41777, 41801, 41809, 41813, 41843, 41849, 41851, 41863, 41879, 41887, 41893, 41897, 41903, 41911, 41927, 41941, 41947, 41953, 41957, 41959, 41969, 41981, 41983, 41999, 42013, 42017, 42019, 42023, 42043, 42061, 42071, 42073, 42083, 42089, 42101, 42131, 42139, 42157, 42169, 42179, 42181, 42187, 42193, 42197, 42209, 42221, 42223, 42227, 42239, 42257, 42281, 42283, 42293, 42299, 42307, 42323, 42331, 42337, 42349, 42359, 42373, 42379, 42391, 42397, 42403, 42407, 42409, 42433, 42437, 42443, 42451, 42457, 42461, 42463, 42467, 42473, 42487, 42491, 42499, 42509, 42533, 42557, 42569, 42571, 42577, 42589, 42611, 42641, 42643, 42649, 42667, 42677, 42683, 42689, 42697, 42701, 42703, 42709, 42719, 42727, 42737, 42743, 42751, 42767, 42773, 42787, 42793, 42797, 42821, 42829, 42839, 42841, 42853, 42859, 42863, 42899, 42901, 42923, 42929, 42937, 42943, 42953, 42961, 42967, 42979, 42989, 43003, 43013, 43019, 43037, 43049, 43051, 43063, 43067, 43093, 43103, 43117, 43133, 43151, 43159, 43177, 43189, 43201, 43207, 43223, 43237, 43261, 43271, 43283, 43291, 43313, 43319, 43321, 43331, 43391, 43397, 43399, 43403, 43411, 43427, 43441, 43451, 43457, 43481, 43487, 43499, 43517, 43541, 43543, 43573, 43577, 43579, 43591, 43597, 43607, 43609, 43613, 43627, 43633, 43649, 43651, 43661, 43669, 43691, 43711, 43717, 43721, 43753, 43759, 43777, 43781, 43783, 43787, 43789, 43793, 43801, 43853, 43867, 43889, 43891, 43913, 43933, 43943, 43951, 43961, 43963, 43969, 43973, 43987, 43991, 43997, 44017, 44021, 44027, 44029, 44041, 44053, 44059, 44071, 44087, 44089, 44101, 44111, 44119, 44123, 44129, 44131, 44159, 44171, 44179, 44189, 44201, 44203, 44207, 44221, 44249, 44257, 44263, 44267, 44269, 44273, 44279, 44281, 44293, 44351, 44357, 44371, 44381, 44383, 44389, 44417, 44449, 44453, 44483, 44491, 44497, 44501, 44507, 44519, 44531, 44533, 44537, 44543, 44549, 44563, 44579, 44587, 44617, 44621, 44623, 44633, 44641, 44647, 44651, 44657, 44683, 44687, 44699, 44701, 44711, 44729, 44741, 44753, 44771, 44773, 44777, 44789, 44797, 44809, 44819, 44839, 44843, 44851, 44867, 44879, 44887, 44893, 44909, 44917, 44927, 44939, 44953, 44959, 44963, 44971, 44983, 44987, 45007, 45013, 45053, 45061, 45077, 45083, 45119, 45121, 45127, 45131, 45137, 45139, 45161, 45179, 45181, 45191, 45197, 45233, 45247, 45259, 45263, 45281, 45289, 45293, 45307, 45317, 45319, 45329, 45337, 45341, 45343, 45361, 45377, 45389, 45403, 45413, 45427, 45433, 45439, 45481, 45491, 45497, 45503, 45523, 45533, 45541, 45553, 45557, 45569, 45587, 45589, 45599, 45613, 45631, 45641, 45659, 45667, 45673, 45677, 45691, 45697, 45707, 45737, 45751, 45757, 45763, 45767, 45779, 45817, 45821, 45823, 45827, 45833, 45841, 45853, 45863, 45869, 45887, 45893, 45943, 45949, 45953, 45959, 45971, 45979, 45989, 46021, 46027, 46049, 46051, 46061, 46073, 46091, 46093, 46099, 46103, 46133, 46141, 46147, 46153, 46171, 46181, 46183, 46187, 46199, 46219, 46229, 46237, 46261, 46271, 46273, 46279, 46301, 46307, 46309, 46327, 46337, 46349, 46351, 46381, 46399, 46411, 46439, 46441, 46447, 46451, 46457, 46471, 46477, 46489, 46499, 46507, 46511, 46523, 46549, 46559, 46567, 46573, 46589, 46591, 46601, 46619, 46633, 46639, 46643, 46649, 46663, 46679, 46681, 46687, 46691, 46703, 46723, 46727, 46747, 46751, 46757, 46769, 46771, 46807, 46811, 46817, 46819, 46829, 46831, 46853, 46861, 46867, 46877, 46889, 46901, 46919, 46933, 46957, 46993, 46997, 47017, 47041, 47051, 47057, 47059, 47087, 47093, 47111, 47119, 47123, 47129, 47137, 47143, 47147, 47149, 47161, 47189, 47207, 47221, 47237, 47251, 47269, 47279, 47287, 47293, 47297, 47303, 47309, 47317, 47339, 47351, 47353, 47363, 47381, 47387, 47389, 47407, 47417, 47419, 47431, 47441, 47459, 47491, 47497, 47501, 47507, 47513, 47521, 47527, 47533, 47543, 47563, 47569, 47581, 47591, 47599, 47609, 47623, 47629, 47639, 47653, 47657, 47659, 47681, 47699, 47701, 47711, 47713, 47717, 47737, 47741, 47743, 47777, 47779, 47791, 47797, 47807, 47809, 47819, 47837, 47843, 47857, 47869, 47881, 47903, 47911, 47917, 47933, 47939, 47947, 47951, 47963, 47969, 47977, 47981, 48017, 48023, 48029, 48049, 48073, 48079, 48091, 48109, 48119, 48121, 48131, 48157, 48163, 48179, 48187, 48193, 48197, 48221, 48239, 48247, 48259, 48271, 48281, 48299, 48311, 48313, 48337, 48341, 48353, 48371, 48383, 48397, 48407, 48409, 48413, 48437, 48449, 48463, 48473, 48479, 48481, 48487, 48491, 48497, 48523, 48527, 48533, 48539, 48541, 48563, 48571, 48589, 48593, 48611, 48619, 48623, 48647, 48649, 48661, 48673, 48677, 48679, 48731, 48733, 48751, 48757, 48761, 48767, 48779, 48781, 48787, 48799, 48809, 48817, 48821, 48823, 48847, 48857, 48859, 48869, 48871, 48883, 48889, 48907, 48947, 48953, 48973, 48989, 48991, 49003, 49009, 49019, 49031, 49033, 49037, 49043, 49057, 49069, 49081, 49103, 49109, 49117, 49121, 49123, 49139, 49157, 49169, 49171, 49177, 49193, 49199, 49201, 49207, 49211, 49223, 49253, 49261, 49277, 49279, 49297, 49307, 49331, 49333, 49339, 49363, 49367, 49369, 49391, 49393, 49409, 49411, 49417, 49429, 49433, 49451, 49459, 49463, 49477, 49481, 49499, 49523, 49529, 49531, 49537, 49547, 49549, 49559, 49597, 49603, 49613, 49627, 49633, 49639, 49663, 49667, 49669, 49681, 49697, 49711, 49727, 49739, 49741, 49747, 49757, 49783, 49787, 49789, 49801, 49807, 49811, 49823, 49831, 49843, 49853, 49871, 49877, 49891, 49919, 49921, 49927, 49937, 49939, 49943, 49957, 49991, 49993, 49999, 50021, 50023, 50033, 50047, 50051, 50053, 50069, 50077, 50087, 50093, 50101, 50111, 50119, 50123, 50129, 50131, 50147, 50153, 50159, 50177, 50207, 50221, 50227, 50231, 50261, 50263, 50273, 50287, 50291, 50311, 50321, 50329, 50333, 50341, 50359, 50363, 50377, 50383, 50387, 50411, 50417, 50423, 50441, 50459, 50461, 50497, 50503, 50513, 50527, 50539, 50543, 50549, 50551, 50581, 50587, 50591, 50593, 50599, 50627, 50647, 50651, 50671, 50683, 50707, 50723, 50741, 50753, 50767, 50773, 50777, 50789, 50821, 50833, 50839, 50849, 50857, 50867, 50873, 50891, 50893, 50909, 50923, 50929, 50951, 50957, 50969, 50971, 50989, 50993, 51001, 51031, 51043, 51047, 51059, 51061, 51071, 51109, 51131, 51133, 51137, 51151, 51157, 51169, 51193, 51197, 51199, 51203, 51217, 51229, 51239, 51241, 51257, 51263, 51283, 51287, 51307, 51329, 51341, 51343, 51347, 51349, 51361, 51383, 51407, 51413, 51419, 51421, 51427, 51431, 51437, 51439, 51449, 51461, 51473, 51479, 51481, 51487, 51503, 51511, 51517, 51521, 51539, 51551, 51563, 51577, 51581, 51593, 51599, 51607, 51613, 51631, 51637, 51647, 51659, 51673, 51679, 51683, 51691, 51713, 51719, 51721, 51749, 51767, 51769, 51787, 51797, 51803, 51817, 51827, 51829, 51839, 51853, 51859, 51869, 51871, 51893, 51899, 51907, 51913, 51929, 51941, 51949, 51971, 51973, 51977, 51991, 52009, 52021, 52027, 52051, 52057, 52067, 52069, 52081, 52103, 52121, 52127, 52147, 52153, 52163, 52177, 52181, 52183, 52189, 52201, 52223, 52237, 52249, 52253, 52259, 52267, 52289, 52291, 52301, 52313, 52321, 52361, 52363, 52369, 52379, 52387, 52391, 52433, 52453, 52457, 52489, 52501, 52511, 52517, 52529, 52541, 52543, 52553, 52561, 52567, 52571, 52579, 52583, 52609, 52627, 52631, 52639, 52667, 52673, 52691, 52697, 52709, 52711, 52721, 52727, 52733, 52747, 52757, 52769, 52783, 52807, 52813, 52817, 52837, 52859, 52861, 52879, 52883, 52889, 52901, 52903, 52919, 52937, 52951, 52957, 52963, 52967, 52973, 52981, 52999, 53003, 53017, 53047, 53051, 53069, 53077, 53087, 53089, 53093, 53101, 53113, 53117, 53129, 53147, 53149, 53161, 53171, 53173, 53189, 53197, 53201, 53231, 53233, 53239, 53267, 53269, 53279, 53281, 53299, 53309, 53323, 53327, 53353, 53359, 53377, 53381, 53401, 53407, 53411, 53419, 53437, 53441, 53453, 53479, 53503, 53507, 53527, 53549, 53551, 53569, 53591, 53593, 53597, 53609, 53611, 53617, 53623, 53629, 53633, 53639, 53653, 53657, 53681, 53693, 53699, 53717, 53719, 53731, 53759, 53773, 53777, 53783, 53791, 53813, 53819, 53831, 53849, 53857, 53861, 53881, 53887, 53891, 53897, 53899, 53917, 53923, 53927, 53939, 53951, 53959, 53987, 53993, 54001, 54011, 54013, 54037, 54049, 54059, 54083, 54091, 54101, 54121, 54133, 54139, 54151, 54163, 54167, 54181, 54193, 54217, 54251, 54269, 54277, 54287, 54293, 54311, 54319, 54323, 54331, 54347, 54361, 54367, 54371, 54377, 54401, 54403, 54409, 54413, 54419, 54421, 54437, 54443, 54449, 54469, 54493, 54497, 54499, 54503, 54517, 54521, 54539, 54541, 54547, 54559, 54563, 54577, 54581, 54583, 54601, 54617, 54623, 54629, 54631, 54647, 54667, 54673, 54679, 54709, 54713, 54721, 54727, 54751, 54767, 54773, 54779, 54787, 54799, 54829, 54833, 54851, 54869, 54877, 54881, 54907, 54917, 54919, 54941, 54949, 54959, 54973, 54979, 54983, 55001, 55009, 55021, 55049, 55051, 55057, 55061, 55073, 55079, 55103, 55109, 55117, 55127, 55147, 55163, 55171, 55201, 55207, 55213, 55217, 55219, 55229, 55243, 55249, 55259, 55291, 55313, 55331, 55333, 55337, 55339, 55343, 55351, 55373, 55381, 55399, 55411, 55439, 55441, 55457, 55469, 55487, 55501, 55511, 55529, 55541, 55547}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n fmt.Printf(\"%d\", p[5093])\n for i := 5094; i < 5093+n; i++ {\n fmt.Printf(\" %d\", p[i])\n }\n fmt.Printf(\"\\n\")\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nPrint a sequence a_1, a_2, ..., a_N whose length is N that satisfies the following conditions:\n\na_i (1 \\leq i \\leq N) is a prime number at most 55 555.\n\nThe values of a_1, a_2, ..., a_N are all different.\n\nIn every choice of five different integers from a_1, a_2, ..., a_N, the sum of those integers is a composite number.\n\nIf there are multiple such sequences, printing any of them is accepted.\n\nNotes\n\nAn integer N not less than 2 is called a prime number if it cannot be divided evenly by any integers except 1 and N, and called a composite number otherwise.\n\nConstraints\n\nN is an integer between 5 and 55 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N numbers a_1, a_2, a_3, ..., a_N in a line, with spaces in between.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3 5 7 11 31\n\nLet us see if this output actually satisfies the conditions.\n\nFirst, 3, 5, 7, 11 and 31 are all different, and all of them are prime numbers.\n\nThe only way to choose five among them is to choose all of them, whose sum is a_1+a_2+a_3+a_4+a_5=57, which is a composite number.\n\nThere are also other possible outputs, such as 2 3 5 7 13, 11 13 17 19 31 and 7 11 5 31 3.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n2 3 5 7 11 13\n\n2, 3, 5, 7, 11, 13 are all different prime numbers.\n\n2+3+5+7+11=28 is a composite number.\n\n2+3+5+7+13=30 is a composite number.\n\n2+3+5+11+13=34 is a composite number.\n\n2+3+7+11+13=36 is a composite number.\n\n2+5+7+11+13=38 is a composite number.\n\n3+5+7+11+13=39 is a composite number.\n\nThus, the sequence 2 3 5 7 11 13 satisfies the conditions.\n\nSample Input 3\n\n8\n\nSample Output 3\n\n2 5 7 13 19 37 67 79", "sample_input": "5\n"}, "reference_outputs": ["3 5 7 11 31\n"], "source_document_id": "p03362", "source_text": "Score: 400 points\n\nProblem Statement\n\nPrint a sequence a_1, a_2, ..., a_N whose length is N that satisfies the following conditions:\n\na_i (1 \\leq i \\leq N) is a prime number at most 55 555.\n\nThe values of a_1, a_2, ..., a_N are all different.\n\nIn every choice of five different integers from a_1, a_2, ..., a_N, the sum of those integers is a composite number.\n\nIf there are multiple such sequences, printing any of them is accepted.\n\nNotes\n\nAn integer N not less than 2 is called a prime number if it cannot be divided evenly by any integers except 1 and N, and called a composite number otherwise.\n\nConstraints\n\nN is an integer between 5 and 55 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N numbers a_1, a_2, a_3, ..., a_N in a line, with spaces in between.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3 5 7 11 31\n\nLet us see if this output actually satisfies the conditions.\n\nFirst, 3, 5, 7, 11 and 31 are all different, and all of them are prime numbers.\n\nThe only way to choose five among them is to choose all of them, whose sum is a_1+a_2+a_3+a_4+a_5=57, which is a composite number.\n\nThere are also other possible outputs, such as 2 3 5 7 13, 11 13 17 19 31 and 7 11 5 31 3.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n2 3 5 7 11 13\n\n2, 3, 5, 7, 11, 13 are all different prime numbers.\n\n2+3+5+7+11=28 is a composite number.\n\n2+3+5+7+13=30 is a composite number.\n\n2+3+5+11+13=34 is a composite number.\n\n2+3+7+11+13=36 is a composite number.\n\n2+5+7+11+13=38 is a composite number.\n\n3+5+7+11+13=39 is a composite number.\n\nThus, the sequence 2 3 5 7 11 13 satisfies the conditions.\n\nSample Input 3\n\n8\n\nSample Output 3\n\n2 5 7 13 19 37 67 79", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 38292, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s814715567", "group_id": "codeNet:p03363", "input_text": "package main\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"fmt\"\n)\n\nfunc Solve(in io.Reader, out io.Writer) {\n\tvar n int\n\tfmt.Fscan(in, &n)\n\n\ta := make([]int64, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(in, &a[i])\n\t}\n\n\tvar cnt int\n\tfor i := 0; i < n; i++ {\n\t\tsum := a[i]\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tsum += a[j]\n\t\t\tif sum == 0 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Fprintln(out, cnt)\n}\n\nfunc main() {\n\tSolve(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1524965665, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03363.html", "problem_id": "p03363", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03363/input.txt", "sample_output_relpath": "derived/input_output/data/p03363/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03363/Go/s814715567.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s814715567", "user_id": "u195981840"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"fmt\"\n)\n\nfunc Solve(in io.Reader, out io.Writer) {\n\tvar n int\n\tfmt.Fscan(in, &n)\n\n\ta := make([]int64, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(in, &a[i])\n\t}\n\n\tvar cnt int\n\tfor i := 0; i < n; i++ {\n\t\tsum := a[i]\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tsum += a[j]\n\t\t\tif sum == 0 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Fprintln(out, cnt)\n}\n\nfunc main() {\n\tSolve(os.Stdin, os.Stdout)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have an integer sequence A, whose length is N.\n\nFind the number of the non-empty contiguous subsequences of A whose sums are 0.\nNote that we are counting the ways to take out subsequences.\nThat is, even if the contents of some two subsequences are the same, they are counted individually if they are taken from different positions.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^9 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFind the number of the non-empty contiguous subsequences of A whose sum is 0.\n\nSample Input 1\n\n6\n1 3 -4 2 2 -2\n\nSample Output 1\n\n3\n\nThere are three contiguous subsequences whose sums are 0: (1,3,-4), (-4,2,2) and (2,-2).\n\nSample Input 2\n\n7\n1 -1 1 -1 1 -1 1\n\nSample Output 2\n\n12\n\nIn this case, some subsequences that have the same contents but are taken from different positions are counted individually.\nFor example, three occurrences of (1, -1) are counted.\n\nSample Input 3\n\n5\n1 -2 3 -4 5\n\nSample Output 3\n\n0\n\nThere are no contiguous subsequences whose sums are 0.", "sample_input": "6\n1 3 -4 2 2 -2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03363", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have an integer sequence A, whose length is N.\n\nFind the number of the non-empty contiguous subsequences of A whose sums are 0.\nNote that we are counting the ways to take out subsequences.\nThat is, even if the contents of some two subsequences are the same, they are counted individually if they are taken from different positions.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^9 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFind the number of the non-empty contiguous subsequences of A whose sum is 0.\n\nSample Input 1\n\n6\n1 3 -4 2 2 -2\n\nSample Output 1\n\n3\n\nThere are three contiguous subsequences whose sums are 0: (1,3,-4), (-4,2,2) and (2,-2).\n\nSample Input 2\n\n7\n1 -1 1 -1 1 -1 1\n\nSample Output 2\n\n12\n\nIn this case, some subsequences that have the same contents but are taken from different positions are counted individually.\nFor example, three occurrences of (1, -1) are counted.\n\nSample Input 3\n\n5\n1 -2 3 -4 5\n\nSample Output 3\n\n0\n\nThere are no contiguous subsequences whose sums are 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 407, "cpu_time_ms": 2108, "memory_kb": 7040}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s514362296", "group_id": "codeNet:p03369", "input_text": "package main\n\nimport (\n . \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var s string\n Scanf(\"%s\", &s)\n\n ans := 700\n sa := strings.Split(s, \"\")\n for _, v := range sa {\n if v == \"o\" {\n ans += 100\n }\n }\n\n Println(ans)\n }\n", "language": "Go", "metadata": {"date": 1591498615, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03369.html", "problem_id": "p03369", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03369/input.txt", "sample_output_relpath": "derived/input_output/data/p03369/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03369/Go/s514362296.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s514362296", "user_id": "u376366206"}, "prompt_components": {"gold_output": "900\n", "input_to_evaluate": "package main\n\nimport (\n . \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var s string\n Scanf(\"%s\", &s)\n\n ans := 700\n sa := strings.Split(s, \"\")\n for _, v := range sa {\n if v == \"o\" {\n ans += 100\n }\n }\n\n Println(ans)\n }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn \"Takahashi-ya\", a ramen restaurant, a bowl of ramen costs 700 yen (the currency of Japan), plus 100 yen for each kind of topping (boiled egg, sliced pork, green onions).\n\nA customer ordered a bowl of ramen and told which toppings to put on his ramen to a clerk. The clerk took a memo of the order as a string S. S is three characters long, and if the first character in S is o, it means the ramen should be topped with boiled egg; if that character is x, it means the ramen should not be topped with boiled egg. Similarly, the second and third characters in S mean the presence or absence of sliced pork and green onions on top of the ramen.\n\nWrite a program that, when S is given, prints the price of the corresponding bowl of ramen.\n\nConstraints\n\nS is a string of length 3.\n\nEach character in S is o or x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the price of the bowl of ramen corresponding to S.\n\nSample Input 1\n\noxo\n\nSample Output 1\n\n900\n\nThe price of a ramen topped with two kinds of toppings, boiled egg and green onions, is 700 + 100 \\times 2 = 900 yen.\n\nSample Input 2\n\nooo\n\nSample Output 2\n\n1000\n\nThe price of a ramen topped with all three kinds of toppings is 700 + 100 \\times 3 = 1000 yen.\n\nSample Input 3\n\nxxx\n\nSample Output 3\n\n700\n\nThe price of a ramen without any toppings is 700 yen.", "sample_input": "oxo\n"}, "reference_outputs": ["900\n"], "source_document_id": "p03369", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn \"Takahashi-ya\", a ramen restaurant, a bowl of ramen costs 700 yen (the currency of Japan), plus 100 yen for each kind of topping (boiled egg, sliced pork, green onions).\n\nA customer ordered a bowl of ramen and told which toppings to put on his ramen to a clerk. The clerk took a memo of the order as a string S. S is three characters long, and if the first character in S is o, it means the ramen should be topped with boiled egg; if that character is x, it means the ramen should not be topped with boiled egg. Similarly, the second and third characters in S mean the presence or absence of sliced pork and green onions on top of the ramen.\n\nWrite a program that, when S is given, prints the price of the corresponding bowl of ramen.\n\nConstraints\n\nS is a string of length 3.\n\nEach character in S is o or x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the price of the bowl of ramen corresponding to S.\n\nSample Input 1\n\noxo\n\nSample Output 1\n\n900\n\nThe price of a ramen topped with two kinds of toppings, boiled egg and green onions, is 700 + 100 \\times 2 = 900 yen.\n\nSample Input 2\n\nooo\n\nSample Output 2\n\n1000\n\nThe price of a ramen topped with all three kinds of toppings is 700 + 100 \\times 3 = 1000 yen.\n\nSample Input 3\n\nxxx\n\nSample Output 3\n\n700\n\nThe price of a ramen without any toppings is 700 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 259, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s775077890", "group_id": "codeNet:p03370", "input_text": "package main\n\nimport \"fmt\"\n\nfunc min(ms []int) int {\n\tmin_value := ms[0]\n\tfor _, v := range ms {\n\t\tif v < min_value {\n\t\t\tmin_value = v\n\t\t}\n\t}\n\treturn min_value\n}\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\tms := make([]int, n)\n\tfor i := range ms {\n\t\tfmt.Scan(&ms[i])\n\t\tx -= ms[i]\n\t}\n\tfmt.Println(x, min(ms))\n\tfmt.Println(n + x/min(ms))\n}\n", "language": "Go", "metadata": {"date": 1548634828, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03370.html", "problem_id": "p03370", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03370/input.txt", "sample_output_relpath": "derived/input_output/data/p03370/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03370/Go/s775077890.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s775077890", "user_id": "u113872560"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc min(ms []int) int {\n\tmin_value := ms[0]\n\tfor _, v := range ms {\n\t\tif v < min_value {\n\t\t\tmin_value = v\n\t\t}\n\t}\n\treturn min_value\n}\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\tms := make([]int, n)\n\tfor i := range ms {\n\t\tfmt.Scan(&ms[i])\n\t\tx -= ms[i]\n\t}\n\tfmt.Println(x, min(ms))\n\tfmt.Println(n + x/min(ms))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAkaki, a patissier, can make N kinds of doughnut using only a certain powder called \"Okashi no Moto\" (literally \"material of pastry\", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Doughnut 2, ..., Doughnut N. In order to make one Doughnut i (1 ≤ i ≤ N), she needs to consume m_i grams of Moto. She cannot make a non-integer number of doughnuts, such as 0.5 doughnuts.\n\nNow, she has X grams of Moto. She decides to make as many doughnuts as possible for a party tonight. However, since the tastes of the guests differ, she will obey the following condition:\n\nFor each of the N kinds of doughnuts, make at least one doughnut of that kind.\n\nAt most how many doughnuts can be made here? She does not necessarily need to consume all of her Moto. Also, under the constraints of this problem, it is always possible to obey the condition.\n\nConstraints\n\n2 ≤ N ≤ 100\n\n1 ≤ m_i ≤ 1000\n\nm_1 + m_2 + ... + m_N ≤ X ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nm_1\nm_2\n:\nm_N\n\nOutput\n\nPrint the maximum number of doughnuts that can be made under the condition.\n\nSample Input 1\n\n3 1000\n120\n100\n140\n\nSample Output 1\n\n9\n\nShe has 1000 grams of Moto and can make three kinds of doughnuts. If she makes one doughnut for each of the three kinds, she consumes 120 + 100 + 140 = 360 grams of Moto. From the 640 grams of Moto that remains here, she can make additional six Doughnuts 2. This is how she can made a total of nine doughnuts, which is the maximum.\n\nSample Input 2\n\n4 360\n90\n90\n90\n90\n\nSample Output 2\n\n4\n\nMaking one doughnut for each of the four kinds consumes all of her Moto.\n\nSample Input 3\n\n5 3000\n150\n130\n150\n130\n110\n\nSample Output 3\n\n26", "sample_input": "3 1000\n120\n100\n140\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03370", "source_text": "Score : 200 points\n\nProblem Statement\n\nAkaki, a patissier, can make N kinds of doughnut using only a certain powder called \"Okashi no Moto\" (literally \"material of pastry\", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Doughnut 2, ..., Doughnut N. In order to make one Doughnut i (1 ≤ i ≤ N), she needs to consume m_i grams of Moto. She cannot make a non-integer number of doughnuts, such as 0.5 doughnuts.\n\nNow, she has X grams of Moto. She decides to make as many doughnuts as possible for a party tonight. However, since the tastes of the guests differ, she will obey the following condition:\n\nFor each of the N kinds of doughnuts, make at least one doughnut of that kind.\n\nAt most how many doughnuts can be made here? She does not necessarily need to consume all of her Moto. Also, under the constraints of this problem, it is always possible to obey the condition.\n\nConstraints\n\n2 ≤ N ≤ 100\n\n1 ≤ m_i ≤ 1000\n\nm_1 + m_2 + ... + m_N ≤ X ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nm_1\nm_2\n:\nm_N\n\nOutput\n\nPrint the maximum number of doughnuts that can be made under the condition.\n\nSample Input 1\n\n3 1000\n120\n100\n140\n\nSample Output 1\n\n9\n\nShe has 1000 grams of Moto and can make three kinds of doughnuts. If she makes one doughnut for each of the three kinds, she consumes 120 + 100 + 140 = 360 grams of Moto. From the 640 grams of Moto that remains here, she can make additional six Doughnuts 2. This is how she can made a total of nine doughnuts, which is the maximum.\n\nSample Input 2\n\n4 360\n90\n90\n90\n90\n\nSample Output 2\n\n4\n\nMaking one doughnut for each of the four kinds consumes all of her Moto.\n\nSample Input 3\n\n5 3000\n150\n130\n150\n130\n110\n\nSample Output 3\n\n26", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 342, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s149579645", "group_id": "codeNet:p03371", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\ta, b, c := iScan(), iScan(), iScan()\n\tx, y := iScan(), iScan()\n\tans := mod * mod\n\tfor i := 0; i <= larger(x, y); i++ {\n\t\tans = smaller(ans, c*2*i+larger(a*(x-i), 0)+larger(b*(y-i), 0))\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1596988909, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03371.html", "problem_id": "p03371", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03371/input.txt", "sample_output_relpath": "derived/input_output/data/p03371/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03371/Go/s149579645.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s149579645", "user_id": "u843722521"}, "prompt_components": {"gold_output": "7900\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\ta, b, c := iScan(), iScan(), iScan()\n\tx, y := iScan(), iScan()\n\tans := mod * mod\n\tfor i := 0; i <= larger(x, y); i++ {\n\t\tans = smaller(ans, c*2*i+larger(a*(x-i), 0)+larger(b*(y-i), 0))\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n\"Pizza At\", a fast food chain, offers three kinds of pizza: \"A-pizza\", \"B-pizza\" and \"AB-pizza\". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.\n\nNakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.\n\nConstraints\n\n1 ≤ A, B, C ≤ 5000\n\n1 ≤ X, Y ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C X Y\n\nOutput\n\nPrint the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.\n\nSample Input 1\n\n1500 2000 1600 3 2\n\nSample Output 1\n\n7900\n\nIt is optimal to buy four AB-pizzas and rearrange them into two A-pizzas and two B-pizzas, then buy additional one A-pizza.\n\nSample Input 2\n\n1500 2000 1900 3 2\n\nSample Output 2\n\n8500\n\nIt is optimal to directly buy three A-pizzas and two B-pizzas.\n\nSample Input 3\n\n1500 2000 500 90000 100000\n\nSample Output 3\n\n100000000\n\nIt is optimal to buy 200000 AB-pizzas and rearrange them into 100000 A-pizzas and 100000 B-pizzas. We will have 10000 more A-pizzas than necessary, but that is fine.", "sample_input": "1500 2000 1600 3 2\n"}, "reference_outputs": ["7900\n"], "source_document_id": "p03371", "source_text": "Score : 300 points\n\nProblem Statement\n\n\"Pizza At\", a fast food chain, offers three kinds of pizza: \"A-pizza\", \"B-pizza\" and \"AB-pizza\". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.\n\nNakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.\n\nConstraints\n\n1 ≤ A, B, C ≤ 5000\n\n1 ≤ X, Y ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C X Y\n\nOutput\n\nPrint the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.\n\nSample Input 1\n\n1500 2000 1600 3 2\n\nSample Output 1\n\n7900\n\nIt is optimal to buy four AB-pizzas and rearrange them into two A-pizzas and two B-pizzas, then buy additional one A-pizza.\n\nSample Input 2\n\n1500 2000 1900 3 2\n\nSample Output 2\n\n8500\n\nIt is optimal to directly buy three A-pizzas and two B-pizzas.\n\nSample Input 3\n\n1500 2000 500 90000 100000\n\nSample Output 3\n\n100000000\n\nIt is optimal to buy 200000 AB-pizzas and rearrange them into 100000 A-pizzas and 100000 B-pizzas. We will have 10000 more A-pizzas than necessary, but that is fine.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1410, "cpu_time_ms": 7, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s279895201", "group_id": "codeNet:p03372", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc095/tasks/arc096_b\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMax: zero length slice\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa > val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMaxIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMaxIdx: zero length slice\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: zero length slice\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa < val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMinIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMinIdx: zero length slice\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc intsAve(s []int) float64 {\n\treturn float64(intsSum(s)) / float64(len(s))\n}\nfunc intsAdd(a *[]int, x int) { *a = append(*a, x) }\nfunc intsDelete(a *[]int, i int) { *a = append((*a)[:i], (*a)[i+1:]...) }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsCopySortAsc(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsCopySortDesc(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Sort(sort.Reverse(sort.IntSlice(s)))\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a *[]int) int {\n\tif len(*a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\tt := (*a)[len(*a)-1]\n\t*a = (*a)[:len(*a)-1]\n\treturn t\n}\nfunc intsPopFront(a *[]int) int {\n\tif len(*a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\th := (*a)[0]\n\t*a = (*a)[1:]\n\treturn h\n}\nfunc intsPushBack(a *[]int, x int) { *a = append(*a, x) }\nfunc intsPushFront(a *[]int, x int) {\n\t*a = append(*a, 0)\n\tcopy((*a)[1:], (*a)[0:])\n\t(*a)[0] = x\n}\nfunc intsAppendSentinelHead(a *[]int, sentinel int) { intsPushFront(a, sentinel) }\nfunc intsAppendSentinelTail(a *[]int, sentinel int) { intsPushBack(a, sentinel) }\nfunc intsAppendSentinels(a *[]int, sentinel int) {\n\tintsPushFront(a, sentinel)\n\tintsPushBack(a, sentinel)\n}\nfunc intsIota(n int) []int {\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tas[i] = i\n\t}\n\treturn as\n}\nfunc intsHaveDuplicateElm(a []int) bool {\n\tm := make(map[int]bool, len(a))\n\tfor _, aa := range a {\n\t\tif _, exists := m[aa]; exists {\n\t\t\treturn true\n\t\t} else {\n\t\t\tm[aa] = true\n\t\t}\n\t}\n\treturn false\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc floor(x float64) int { return int(x) }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc ceilDiv(x, y int) int { return ((x) + (y) - 1) / (y) }\nfunc floorDiv(x, y int) int { return (x) / (y) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor ; y != 0; y >>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc fact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact *= i\n\t}\n\treturn fact\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc euclideanDistance(a, b point) float64 {\n\ts := diff(a.x, b.x)\n\ts *= s\n\tt := diff(a.y, b.y)\n\tt *= t\n\treturn math.Sqrt(float64(s) + float64(t))\n}\nfunc manhattanDistance(a, b point) int {\n\ts := diff(a.x, b.x)\n\tt := diff(a.y, b.y)\n\treturn s + t\n}\nfunc swap(a, b *int) { *a, *b = *b, *a }\nfunc chmax(a *int, b int) bool {\n\tif *a < b {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc chmin(a *int, b int) bool {\n\tif *a > b {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc cumsumBuild(a []int) []int {\n\tb := append([]int{0}, a...)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc bytesReverse(a []byte) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n}\nfunc strIsUpperAlphabet(s string) bool {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\treturn 'A' <= t && t <= 'Z'\n}\nfunc strIsLowerAlphabet(s string) bool {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\treturn 'a' <= t && t <= 'z'\n}\nfunc strToUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strToLowerCase(s string) string { return strings.ToLower(s) }\nfunc strAlphaUpperCaseToInt(s string) int {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\tif !('A' <= t && t <= 'Z') {\n\t\tpanic(\"arg must be upper case alphabet\")\n\t}\n\treturn int(t - 'A')\n}\nfunc strAlphaLowerCaseToInt(s string) int {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\tif !('a' <= t && t <= 'z') {\n\t\tpanic(\"arg must be lower case alphabet\")\n\t}\n\treturn int(t - 'a')\n}\nfunc strCountAlphabetsLower(alphaLower string) (ctAlphas [26]int) {\n\tct := [26]int{}\n\tfor _, ss := range alphaLower {\n\t\tif !('a' <= ss && ss <= 'z') {\n\t\t\tpanic(\"func strCountAlphabetsLower: argument must be lowercase string\")\n\t\t}\n\t\tct[ss-'a']++\n\t}\n\treturn ct\n}\nfunc strCountAlphabetsUpper(alphaUpper string) (ctAlphas [26]int) {\n\tct := [26]int{}\n\tfor _, ss := range alphaUpper {\n\t\tif !('A' <= ss && ss <= 'Z') {\n\t\t\tpanic(\"func strCountAlphabetsUpper: argument must be uppercase string\")\n\t\t}\n\t\tct[ss-'A']++\n\t}\n\treturn ct\n}\nfunc strReverse(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\nfunc runeIsUpperAlphabet(r rune) bool { return 'A' <= r && r <= 'Z' }\nfunc runeIsLowerAlphabet(r rune) bool { return 'a' <= r && r <= 'z' }\nfunc runesReverse(a []rune) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n}\nfunc strToInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\nfunc intToStr(i int) string { return strconv.Itoa(i) }\nfunc CalcMod(a, mod int) int { return (a%mod + mod) % mod }\nfunc ModSum(a *int, b, mod int) { *a = (((*a) % mod) + mod + (b % mod)) % mod }\nfunc ModMul(a *int, b, mod int) { *a = (((*a) % mod) * (b % mod)) % mod }\nfunc ModPow(x, y, mod int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor ; y != 0; y >>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc ModFact(x, mod int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % mod\n\t}\n\treturn fact\n}\nfunc ModInv(x, mod int) int { return ModPow(x, mod-2, mod) }\nfunc initMatrixBool(parentSize, childSize int, initialValue bool) *[][]bool {\n\tres := make([][]bool, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]bool, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\nfunc initMatrixInt(parentSize, childSize int, initialValue int) *[][]int {\n\tres := make([][]int, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]int, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc riis(n int) ([]int, []int) {\n\ts := make([]int, n)\n\tt := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t\tt[i] = ri()\n\t}\n\treturn s, t\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pintsol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbgMatrix(a [][]int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tdbg(a[i])\n\t}\n}\nfunc flush() {\n\tif err := bw.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tflush()\n}\n\nconst (\n\tbwBufSize = 1e6\n\n\talphabetLower = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ fi, se int }\ntype byFiSe []pair\n\nfunc (p byFiSe) Len() int { return len(p) }\nfunc (p byFiSe) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p byFiSe) Less(i, j int) bool {\n\tif p[i].fi == p[j].fi {\n\t\treturn p[i].se < p[j].se\n\t}\n\treturn p[i].fi < p[j].fi\n}\n\ntype point struct{ x, y int }\n\nfunc solve() {\n\tn, c := ri(), ri()\n\tx, v := riis(n)\n\tintsPushFront(&x, 0)\n\tintsPushFront(&v, 0)\n\tintsPushBack(&x, c)\n\tintsPushBack(&v, 0)\n\n\tf := func(x, v []int) int {\n\t\tm := len(x)\n\t\tvCumsum := make([]int, m)\n\t\tfor i := 1; i < m; i++ {\n\t\t\tvCumsum[i] = vCumsum[i-1] + v[i]\n\t\t}\n\t\tleftScore := make([]int, m)\n\t\tfor i := 1; i < m; i++ {\n\t\t\tleftScore[i] = vCumsum[i] - x[i]*2\n\t\t}\n\t\tbestLeftScore := make([]int, m)\n\t\tfor i := 1; i < m; i++ {\n\t\t\tbestLeftScore[i] = larger(bestLeftScore[i-1], leftScore[i])\n\t\t}\n\n\t\tmaxScore := 0\n\t\tfor r := 1; r < m; r++ {\n\t\t\tscore := 0\n\t\t\tscore += bestLeftScore[r-1]\n\t\t\tscore += (vCumsum[m-1] - vCumsum[r-1]) - (x[m-1] - x[r])\n\t\t\tchmax(&maxScore, score)\n\t\t}\n\t\treturn maxScore\n\t}\n\n\tmx := 0\n\tclockwise := f(x, v)\n\tchmax(&mx, clockwise)\n\n\tintsReverse(x)\n\tfor i := range x {\n\t\tx[i] = c - x[i]\n\t}\n\tintsReverse(v)\n\treverse := f(x, v)\n\tchmax(&mx, reverse)\n\tpln(mx)\n}\n", "language": "Go", "metadata": {"date": 1575999679, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03372.html", "problem_id": "p03372", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03372/input.txt", "sample_output_relpath": "derived/input_output/data/p03372/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03372/Go/s279895201.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s279895201", "user_id": "u554269352"}, "prompt_components": {"gold_output": "191\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc095/tasks/arc096_b\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMax: zero length slice\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa > val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMaxIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMaxIdx: zero length slice\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: zero length slice\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa < val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMinIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMinIdx: zero length slice\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc intsAve(s []int) float64 {\n\treturn float64(intsSum(s)) / float64(len(s))\n}\nfunc intsAdd(a *[]int, x int) { *a = append(*a, x) }\nfunc intsDelete(a *[]int, i int) { *a = append((*a)[:i], (*a)[i+1:]...) }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsCopySortAsc(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsCopySortDesc(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Sort(sort.Reverse(sort.IntSlice(s)))\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a *[]int) int {\n\tif len(*a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\tt := (*a)[len(*a)-1]\n\t*a = (*a)[:len(*a)-1]\n\treturn t\n}\nfunc intsPopFront(a *[]int) int {\n\tif len(*a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\th := (*a)[0]\n\t*a = (*a)[1:]\n\treturn h\n}\nfunc intsPushBack(a *[]int, x int) { *a = append(*a, x) }\nfunc intsPushFront(a *[]int, x int) {\n\t*a = append(*a, 0)\n\tcopy((*a)[1:], (*a)[0:])\n\t(*a)[0] = x\n}\nfunc intsAppendSentinelHead(a *[]int, sentinel int) { intsPushFront(a, sentinel) }\nfunc intsAppendSentinelTail(a *[]int, sentinel int) { intsPushBack(a, sentinel) }\nfunc intsAppendSentinels(a *[]int, sentinel int) {\n\tintsPushFront(a, sentinel)\n\tintsPushBack(a, sentinel)\n}\nfunc intsIota(n int) []int {\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tas[i] = i\n\t}\n\treturn as\n}\nfunc intsHaveDuplicateElm(a []int) bool {\n\tm := make(map[int]bool, len(a))\n\tfor _, aa := range a {\n\t\tif _, exists := m[aa]; exists {\n\t\t\treturn true\n\t\t} else {\n\t\t\tm[aa] = true\n\t\t}\n\t}\n\treturn false\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc floor(x float64) int { return int(x) }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc ceilDiv(x, y int) int { return ((x) + (y) - 1) / (y) }\nfunc floorDiv(x, y int) int { return (x) / (y) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor ; y != 0; y >>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc fact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact *= i\n\t}\n\treturn fact\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc euclideanDistance(a, b point) float64 {\n\ts := diff(a.x, b.x)\n\ts *= s\n\tt := diff(a.y, b.y)\n\tt *= t\n\treturn math.Sqrt(float64(s) + float64(t))\n}\nfunc manhattanDistance(a, b point) int {\n\ts := diff(a.x, b.x)\n\tt := diff(a.y, b.y)\n\treturn s + t\n}\nfunc swap(a, b *int) { *a, *b = *b, *a }\nfunc chmax(a *int, b int) bool {\n\tif *a < b {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc chmin(a *int, b int) bool {\n\tif *a > b {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc cumsumBuild(a []int) []int {\n\tb := append([]int{0}, a...)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc bytesReverse(a []byte) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n}\nfunc strIsUpperAlphabet(s string) bool {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\treturn 'A' <= t && t <= 'Z'\n}\nfunc strIsLowerAlphabet(s string) bool {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\treturn 'a' <= t && t <= 'z'\n}\nfunc strToUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strToLowerCase(s string) string { return strings.ToLower(s) }\nfunc strAlphaUpperCaseToInt(s string) int {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\tif !('A' <= t && t <= 'Z') {\n\t\tpanic(\"arg must be upper case alphabet\")\n\t}\n\treturn int(t - 'A')\n}\nfunc strAlphaLowerCaseToInt(s string) int {\n\tif len(s) != 1 {\n\t\tpanic(\"wrong arg\")\n\t}\n\tt := s[0]\n\tif !('a' <= t && t <= 'z') {\n\t\tpanic(\"arg must be lower case alphabet\")\n\t}\n\treturn int(t - 'a')\n}\nfunc strCountAlphabetsLower(alphaLower string) (ctAlphas [26]int) {\n\tct := [26]int{}\n\tfor _, ss := range alphaLower {\n\t\tif !('a' <= ss && ss <= 'z') {\n\t\t\tpanic(\"func strCountAlphabetsLower: argument must be lowercase string\")\n\t\t}\n\t\tct[ss-'a']++\n\t}\n\treturn ct\n}\nfunc strCountAlphabetsUpper(alphaUpper string) (ctAlphas [26]int) {\n\tct := [26]int{}\n\tfor _, ss := range alphaUpper {\n\t\tif !('A' <= ss && ss <= 'Z') {\n\t\t\tpanic(\"func strCountAlphabetsUpper: argument must be uppercase string\")\n\t\t}\n\t\tct[ss-'A']++\n\t}\n\treturn ct\n}\nfunc strReverse(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\nfunc runeIsUpperAlphabet(r rune) bool { return 'A' <= r && r <= 'Z' }\nfunc runeIsLowerAlphabet(r rune) bool { return 'a' <= r && r <= 'z' }\nfunc runesReverse(a []rune) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n}\nfunc strToInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\nfunc intToStr(i int) string { return strconv.Itoa(i) }\nfunc CalcMod(a, mod int) int { return (a%mod + mod) % mod }\nfunc ModSum(a *int, b, mod int) { *a = (((*a) % mod) + mod + (b % mod)) % mod }\nfunc ModMul(a *int, b, mod int) { *a = (((*a) % mod) * (b % mod)) % mod }\nfunc ModPow(x, y, mod int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor ; y != 0; y >>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc ModFact(x, mod int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % mod\n\t}\n\treturn fact\n}\nfunc ModInv(x, mod int) int { return ModPow(x, mod-2, mod) }\nfunc initMatrixBool(parentSize, childSize int, initialValue bool) *[][]bool {\n\tres := make([][]bool, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]bool, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\nfunc initMatrixInt(parentSize, childSize int, initialValue int) *[][]int {\n\tres := make([][]int, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]int, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc riis(n int) ([]int, []int) {\n\ts := make([]int, n)\n\tt := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t\tt[i] = ri()\n\t}\n\treturn s, t\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pintsol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbgMatrix(a [][]int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tdbg(a[i])\n\t}\n}\nfunc flush() {\n\tif err := bw.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tflush()\n}\n\nconst (\n\tbwBufSize = 1e6\n\n\talphabetLower = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ fi, se int }\ntype byFiSe []pair\n\nfunc (p byFiSe) Len() int { return len(p) }\nfunc (p byFiSe) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p byFiSe) Less(i, j int) bool {\n\tif p[i].fi == p[j].fi {\n\t\treturn p[i].se < p[j].se\n\t}\n\treturn p[i].fi < p[j].fi\n}\n\ntype point struct{ x, y int }\n\nfunc solve() {\n\tn, c := ri(), ri()\n\tx, v := riis(n)\n\tintsPushFront(&x, 0)\n\tintsPushFront(&v, 0)\n\tintsPushBack(&x, c)\n\tintsPushBack(&v, 0)\n\n\tf := func(x, v []int) int {\n\t\tm := len(x)\n\t\tvCumsum := make([]int, m)\n\t\tfor i := 1; i < m; i++ {\n\t\t\tvCumsum[i] = vCumsum[i-1] + v[i]\n\t\t}\n\t\tleftScore := make([]int, m)\n\t\tfor i := 1; i < m; i++ {\n\t\t\tleftScore[i] = vCumsum[i] - x[i]*2\n\t\t}\n\t\tbestLeftScore := make([]int, m)\n\t\tfor i := 1; i < m; i++ {\n\t\t\tbestLeftScore[i] = larger(bestLeftScore[i-1], leftScore[i])\n\t\t}\n\n\t\tmaxScore := 0\n\t\tfor r := 1; r < m; r++ {\n\t\t\tscore := 0\n\t\t\tscore += bestLeftScore[r-1]\n\t\t\tscore += (vCumsum[m-1] - vCumsum[r-1]) - (x[m-1] - x[r])\n\t\t\tchmax(&maxScore, score)\n\t\t}\n\t\treturn maxScore\n\t}\n\n\tmx := 0\n\tclockwise := f(x, v)\n\tchmax(&mx, clockwise)\n\n\tintsReverse(x)\n\tfor i := range x {\n\t\tx[i] = c - x[i]\n\t}\n\tintsReverse(v)\n\treverse := f(x, v)\n\tchmax(&mx, reverse)\n\tpln(mx)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\n\"Teishi-zushi\", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter.\n\nNakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on) on the counter. The distance measured clockwise from the point where Nakahashi is standing to the point where the i-th sushi is placed, is x_i meters. Also, the i-th sushi has a nutritive value of v_i kilocalories.\n\nNakahashi can freely walk around the circumference of the counter. When he reach a point where a sushi is placed, he can eat that sushi and take in its nutrition (naturally, the sushi disappears). However, while walking, he consumes 1 kilocalories per meter.\n\nWhenever he is satisfied, he can leave the restaurant from any place (he does not have to return to the initial place). On balance, at most how much nutrition can he take in before he leaves? That is, what is the maximum possible value of the total nutrition taken in minus the total energy consumed? Assume that there are no other customers, and no new sushi will be added to the counter. Also, since Nakahashi has plenty of nutrition in his body, assume that no matter how much he walks and consumes energy, he never dies from hunger.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n2 ≤ C ≤ 10^{14}\n\n1 ≤ x_1 < x_2 < ... < x_N < C\n\n1 ≤ v_i ≤ 10^9\n\nAll values in input are integers.\n\nSubscores\n\n300 points will be awarded for passing the test set satisfying N ≤ 100.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nx_1 v_1\nx_2 v_2\n:\nx_N v_N\n\nOutput\n\nIf Nakahashi can take in at most c kilocalories on balance before he leaves the restaurant, print c.\n\nSample Input 1\n\n3 20\n2 80\n9 120\n16 1\n\nSample Output 1\n\n191\n\nThere are three sushi on the counter with a circumference of 20 meters. If he walks two meters clockwise from the initial place, he can eat a sushi of 80 kilocalories. If he walks seven more meters clockwise, he can eat a sushi of 120 kilocalories. If he leaves now, the total nutrition taken in is 200 kilocalories, and the total energy consumed is 9 kilocalories, thus he can take in 191 kilocalories on balance, which is the largest possible value.\n\nSample Input 2\n\n3 20\n2 80\n9 1\n16 120\n\nSample Output 2\n\n192\n\nThe second and third sushi have been swapped. Again, if he walks two meters clockwise from the initial place, he can eat a sushi of 80 kilocalories. If he walks six more meters counterclockwise this time, he can eat a sushi of 120 kilocalories. If he leaves now, the total nutrition taken in is 200 kilocalories, and the total energy consumed is 8 kilocalories, thus he can take in 192 kilocalories on balance, which is the largest possible value.\n\nSample Input 3\n\n1 100000000000000\n50000000000000 1\n\nSample Output 3\n\n0\n\nEven though the only sushi is so far that it does not fit into a 32-bit integer, its nutritive value is low, thus he should immediately leave without doing anything.\n\nSample Input 4\n\n15 10000000000\n400000000 1000000000\n800000000 1000000000\n1900000000 1000000000\n2400000000 1000000000\n2900000000 1000000000\n3300000000 1000000000\n3700000000 1000000000\n3800000000 1000000000\n4000000000 1000000000\n4100000000 1000000000\n5200000000 1000000000\n6600000000 1000000000\n8000000000 1000000000\n9300000000 1000000000\n9700000000 1000000000\n\nSample Output 4\n\n6500000000\n\nAll these sample inputs above are included in the test set for the partial score.", "sample_input": "3 20\n2 80\n9 120\n16 1\n"}, "reference_outputs": ["191\n"], "source_document_id": "p03372", "source_text": "Score : 500 points\n\nProblem Statement\n\n\"Teishi-zushi\", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter.\n\nNakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on) on the counter. The distance measured clockwise from the point where Nakahashi is standing to the point where the i-th sushi is placed, is x_i meters. Also, the i-th sushi has a nutritive value of v_i kilocalories.\n\nNakahashi can freely walk around the circumference of the counter. When he reach a point where a sushi is placed, he can eat that sushi and take in its nutrition (naturally, the sushi disappears). However, while walking, he consumes 1 kilocalories per meter.\n\nWhenever he is satisfied, he can leave the restaurant from any place (he does not have to return to the initial place). On balance, at most how much nutrition can he take in before he leaves? That is, what is the maximum possible value of the total nutrition taken in minus the total energy consumed? Assume that there are no other customers, and no new sushi will be added to the counter. Also, since Nakahashi has plenty of nutrition in his body, assume that no matter how much he walks and consumes energy, he never dies from hunger.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n2 ≤ C ≤ 10^{14}\n\n1 ≤ x_1 < x_2 < ... < x_N < C\n\n1 ≤ v_i ≤ 10^9\n\nAll values in input are integers.\n\nSubscores\n\n300 points will be awarded for passing the test set satisfying N ≤ 100.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN C\nx_1 v_1\nx_2 v_2\n:\nx_N v_N\n\nOutput\n\nIf Nakahashi can take in at most c kilocalories on balance before he leaves the restaurant, print c.\n\nSample Input 1\n\n3 20\n2 80\n9 120\n16 1\n\nSample Output 1\n\n191\n\nThere are three sushi on the counter with a circumference of 20 meters. If he walks two meters clockwise from the initial place, he can eat a sushi of 80 kilocalories. If he walks seven more meters clockwise, he can eat a sushi of 120 kilocalories. If he leaves now, the total nutrition taken in is 200 kilocalories, and the total energy consumed is 9 kilocalories, thus he can take in 191 kilocalories on balance, which is the largest possible value.\n\nSample Input 2\n\n3 20\n2 80\n9 1\n16 120\n\nSample Output 2\n\n192\n\nThe second and third sushi have been swapped. Again, if he walks two meters clockwise from the initial place, he can eat a sushi of 80 kilocalories. If he walks six more meters counterclockwise this time, he can eat a sushi of 120 kilocalories. If he leaves now, the total nutrition taken in is 200 kilocalories, and the total energy consumed is 8 kilocalories, thus he can take in 192 kilocalories on balance, which is the largest possible value.\n\nSample Input 3\n\n1 100000000000000\n50000000000000 1\n\nSample Output 3\n\n0\n\nEven though the only sushi is so far that it does not fit into a 32-bit integer, its nutritive value is low, thus he should immediately leave without doing anything.\n\nSample Input 4\n\n15 10000000000\n400000000 1000000000\n800000000 1000000000\n1900000000 1000000000\n2400000000 1000000000\n2900000000 1000000000\n3300000000 1000000000\n3700000000 1000000000\n3800000000 1000000000\n4000000000 1000000000\n4100000000 1000000000\n5200000000 1000000000\n6600000000 1000000000\n8000000000 1000000000\n9300000000 1000000000\n9700000000 1000000000\n\nSample Output 4\n\n6500000000\n\nAll these sample inputs above are included in the test set for the partial score.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 12101, "cpu_time_ms": 54, "memory_kb": 13056}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s232992677", "group_id": "codeNet:p03377", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, x int\n fmt.Scan(&a, &b, &x)\n ans := \"NO\"\n if x >= a && x <= a + b {ans = \"YES\"}\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1587543435, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03377.html", "problem_id": "p03377", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03377/input.txt", "sample_output_relpath": "derived/input_output/data/p03377/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03377/Go/s232992677.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s232992677", "user_id": "u254871849"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, x int\n fmt.Scan(&a, &b, &x)\n ans := \"NO\"\n if x >= a && x <= a + b {ans = \"YES\"}\n fmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "sample_input": "3 5 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03377", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 163, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s834431043", "group_id": "codeNet:p03377", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\tif a+b >= c && a <= c {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1580737788, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03377.html", "problem_id": "p03377", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03377/input.txt", "sample_output_relpath": "derived/input_output/data/p03377/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03377/Go/s834431043.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s834431043", "user_id": "u696272993"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\tif a+b >= c && a <= c {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "sample_input": "3 5 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03377", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1425, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s999195028", "group_id": "codeNet:p03377", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var a, b, c int\n fmt.Scan(&a, &b, &c)\n if c > a{\n fmt.Println(\"NO\")\n }else{\n if a - c <= b{\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n }\n}\n", "language": "Go", "metadata": {"date": 1556337057, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03377.html", "problem_id": "p03377", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03377/input.txt", "sample_output_relpath": "derived/input_output/data/p03377/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03377/Go/s999195028.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s999195028", "user_id": "u004288099"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var a, b, c int\n fmt.Scan(&a, &b, &c)\n if c > a{\n fmt.Println(\"NO\")\n }else{\n if a - c <= b{\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "sample_input": "3 5 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03377", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s655205975", "group_id": "codeNet:p03377", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, x int\n\tans := \"No\"\n\tfmt.Scan(&a, &b, &x)\n\tfor i := 0; i <= b; i++ {\n\t\tif i + a == x {\n\t\t\tans = \"Yes\"\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1533899568, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03377.html", "problem_id": "p03377", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03377/input.txt", "sample_output_relpath": "derived/input_output/data/p03377/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03377/Go/s655205975.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s655205975", "user_id": "u430478288"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, x int\n\tans := \"No\"\n\tfmt.Scan(&a, &b, &x)\n\tfor i := 0; i <= b; i++ {\n\t\tif i + a == x {\n\t\t\tans = \"Yes\"\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "sample_input": "3 5 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03377", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are a total of A + B cats and dogs.\nAmong them, A are known to be cats, but the remaining B are not known to be either cats or dogs.\n\nDetermine if it is possible that there are exactly X cats among these A + B animals.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\n1 \\leq X \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B X\n\nOutput\n\nIf it is possible that there are exactly X cats, print YES; if it is impossible, print NO.\n\nSample Input 1\n\n3 5 4\n\nSample Output 1\n\nYES\n\nIf there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.\n\nSample Input 2\n\n2 2 6\n\nSample Output 2\n\nNO\n\nEven if all of the B = 2 animals are cats, there are less than X = 6 cats in total.\n\nSample Input 3\n\n5 3 2\n\nSample Output 3\n\nNO\n\nEven if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s240820269", "group_id": "codeNet:p03379", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := getInt()\n\txs := getIntSlice(n)\n\tb1, b2 := func() (int, int) {\n\t\ttmp := make([]int, n)\n\t\tcopy(tmp, xs)\n\t\tsort.Ints(tmp)\n\t\treturn tmp[(n-1)/2], tmp[(n-1)/2+1]\n\t}()\n\n\tfor _, x := range xs {\n\t\tans := 0\n\t\tif x <= b1 {\n\t\t\tans = b2\n\t\t} else {\n\t\t\tans = b1\n\t\t}\n\t\tfmt.Fprintln(wr, ans)\n\t}\n}\n\n// -----------------------------------------\n\nconst (\n\tinf = 1 << 60\n\t// mod = 1000000007\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n\nfunc getInt() (ret int) {\n\tsc.Scan()\n\tret, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc getIntSlice(n int) (ret []int) {\n\tret = make([]int, n)\n\tfor i := range ret {\n\t\tret[i] = getInt()\n\t}\n\treturn\n}\n\nfunc getString() (ret string) {\n\tsc.Scan()\n\tret = sc.Text()\n\treturn\n}\n\nfunc getRunes() (ret []rune) {\n\tret = []rune(getString())\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1579384063, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03379.html", "problem_id": "p03379", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03379/input.txt", "sample_output_relpath": "derived/input_output/data/p03379/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03379/Go/s240820269.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s240820269", "user_id": "u543933043"}, "prompt_components": {"gold_output": "4\n3\n3\n4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := getInt()\n\txs := getIntSlice(n)\n\tb1, b2 := func() (int, int) {\n\t\ttmp := make([]int, n)\n\t\tcopy(tmp, xs)\n\t\tsort.Ints(tmp)\n\t\treturn tmp[(n-1)/2], tmp[(n-1)/2+1]\n\t}()\n\n\tfor _, x := range xs {\n\t\tans := 0\n\t\tif x <= b1 {\n\t\t\tans = b2\n\t\t} else {\n\t\t\tans = b1\n\t\t}\n\t\tfmt.Fprintln(wr, ans)\n\t}\n}\n\n// -----------------------------------------\n\nconst (\n\tinf = 1 << 60\n\t// mod = 1000000007\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n\nfunc getInt() (ret int) {\n\tsc.Scan()\n\tret, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc getIntSlice(n int) (ret []int) {\n\tret = make([]int, n)\n\tfor i := range ret {\n\t\tret[i] = getInt()\n\t}\n\treturn\n}\n\nfunc getString() (ret string) {\n\tsc.Scan()\n\tret = sc.Text()\n\treturn\n}\n\nfunc getRunes() (ret []rune) {\n\tret = []rune(getString())\n\treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWhen l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\n\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number.\nFor each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.\n\nFind B_i for each i = 1, 2, ..., N.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n1 \\leq X_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint N lines.\nThe i-th line should contain B_i.\n\nSample Input 1\n\n4\n2 4 4 3\n\nSample Output 1\n\n4\n3\n3\n4\n\nSince the median of X_2, X_3, X_4 is 4, B_1 = 4.\n\nSince the median of X_1, X_3, X_4 is 3, B_2 = 3.\n\nSince the median of X_1, X_2, X_4 is 3, B_3 = 3.\n\nSince the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n2\n1\n\nSample Input 3\n\n6\n5 5 4 4 3 3\n\nSample Output 3\n\n4\n4\n4\n4\n4\n4", "sample_input": "4\n2 4 4 3\n"}, "reference_outputs": ["4\n3\n3\n4\n"], "source_document_id": "p03379", "source_text": "Score : 300 points\n\nProblem Statement\n\nWhen l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\n\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number.\nFor each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.\n\nFind B_i for each i = 1, 2, ..., N.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n1 \\leq X_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint N lines.\nThe i-th line should contain B_i.\n\nSample Input 1\n\n4\n2 4 4 3\n\nSample Output 1\n\n4\n3\n3\n4\n\nSince the median of X_2, X_3, X_4 is 4, B_1 = 4.\n\nSince the median of X_1, X_3, X_4 is 3, B_2 = 3.\n\nSince the median of X_1, X_2, X_4 is 3, B_3 = 3.\n\nSince the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n2\n1\n\nSample Input 3\n\n6\n5 5 4 4 3 3\n\nSample Output 3\n\n4\n4\n4\n4\n4\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1043, "cpu_time_ms": 136, "memory_kb": 8192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s133300264", "group_id": "codeNet:p03379", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tn := 0\n\tfmt.Scan(&n)\n\n\tx := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ttmp := 0\n\t\tfmt.Scan(&tmp)\n\t\tx[i] = tmp\n\t}\n\n\tmid := len(x) / 2\n\tfor i := 0; i < n; i++ {\n\t\tX := make([]int, len(x))\n\t\tcopy(X, x)\n\t\tX = append(X[:i], X[i+1:]...)\n\t\tsort.Ints(X)\n\t\tfmt.Println(X[mid-1])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1524102506, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03379.html", "problem_id": "p03379", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03379/input.txt", "sample_output_relpath": "derived/input_output/data/p03379/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03379/Go/s133300264.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s133300264", "user_id": "u239962644"}, "prompt_components": {"gold_output": "4\n3\n3\n4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tn := 0\n\tfmt.Scan(&n)\n\n\tx := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ttmp := 0\n\t\tfmt.Scan(&tmp)\n\t\tx[i] = tmp\n\t}\n\n\tmid := len(x) / 2\n\tfor i := 0; i < n; i++ {\n\t\tX := make([]int, len(x))\n\t\tcopy(X, x)\n\t\tX = append(X[:i], X[i+1:]...)\n\t\tsort.Ints(X)\n\t\tfmt.Println(X[mid-1])\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWhen l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\n\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number.\nFor each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.\n\nFind B_i for each i = 1, 2, ..., N.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n1 \\leq X_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint N lines.\nThe i-th line should contain B_i.\n\nSample Input 1\n\n4\n2 4 4 3\n\nSample Output 1\n\n4\n3\n3\n4\n\nSince the median of X_2, X_3, X_4 is 4, B_1 = 4.\n\nSince the median of X_1, X_3, X_4 is 3, B_2 = 3.\n\nSince the median of X_1, X_2, X_4 is 3, B_3 = 3.\n\nSince the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n2\n1\n\nSample Input 3\n\n6\n5 5 4 4 3 3\n\nSample Output 3\n\n4\n4\n4\n4\n4\n4", "sample_input": "4\n2 4 4 3\n"}, "reference_outputs": ["4\n3\n3\n4\n"], "source_document_id": "p03379", "source_text": "Score : 300 points\n\nProblem Statement\n\nWhen l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\n\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number.\nFor each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.\n\nFind B_i for each i = 1, 2, ..., N.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n1 \\leq X_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint N lines.\nThe i-th line should contain B_i.\n\nSample Input 1\n\n4\n2 4 4 3\n\nSample Output 1\n\n4\n3\n3\n4\n\nSince the median of X_2, X_3, X_4 is 4, B_1 = 4.\n\nSince the median of X_1, X_3, X_4 is 3, B_2 = 3.\n\nSince the median of X_1, X_2, X_4 is 3, B_3 = 3.\n\nSince the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n2\n1\n\nSample Input 3\n\n6\n5 5 4 4 3 3\n\nSample Output 3\n\n4\n4\n4\n4\n4\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 331, "cpu_time_ms": 2108, "memory_kb": 9728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s149856183", "group_id": "codeNet:p03380", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN := sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\tsort.Ints(A)\n\tmx := A[N-1]\n\tA = A[:N-1]\n\tkey := mx / 2\n\tvar ans int\n\tr, l := search(A, key)\n\t//fmt.Fprintln(wtr, A)\n\t//fmt.Fprintln(wtr, r, l)\n\tif l != -1 && r != len(A) {\n\t\tif abs(key-A[l]) < abs(key-A[r]) {\n\t\t\tans = A[l]\n\t\t} else {\n\t\t\tans = A[r]\n\t\t}\n\t} else if l == -1 {\n\t\tans = A[r]\n\t} else {\n\t\tans = A[l]\n\t}\n\n\tfmt.Fprintln(wtr, mx, ans)\n}\n\nfunc search(A []int, key int) (int, int) {\n\tl := -1\n\tr := len(A)\n\tfor abs(r-l) > 1 {\n\t\tmid := (r + l) / 2\n\t\tif A[mid] >= key {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid\n\t\t}\n\t}\n\treturn r, l\n}\n", "language": "Go", "metadata": {"date": 1583008525, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03380.html", "problem_id": "p03380", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03380/input.txt", "sample_output_relpath": "derived/input_output/data/p03380/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03380/Go/s149856183.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s149856183", "user_id": "u924691798"}, "prompt_components": {"gold_output": "11 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN := sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\tsort.Ints(A)\n\tmx := A[N-1]\n\tA = A[:N-1]\n\tkey := mx / 2\n\tvar ans int\n\tr, l := search(A, key)\n\t//fmt.Fprintln(wtr, A)\n\t//fmt.Fprintln(wtr, r, l)\n\tif l != -1 && r != len(A) {\n\t\tif abs(key-A[l]) < abs(key-A[r]) {\n\t\t\tans = A[l]\n\t\t} else {\n\t\t\tans = A[r]\n\t\t}\n\t} else if l == -1 {\n\t\tans = A[r]\n\t} else {\n\t\tans = A[l]\n\t}\n\n\tfmt.Fprintln(wtr, mx, ans)\n}\n\nfunc search(A []int, key int) (int, int) {\n\tl := -1\n\tr := len(A)\n\tfor abs(r-l) > 1 {\n\t\tmid := (r + l) / 2\n\t\tif A[mid] >= key {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid\n\t\t}\n\t}\n\treturn r, l\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nLet {\\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order.\nFrom n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\\rm comb}(a_i,a_j) is maximized.\nIf there are multiple pairs that maximize the value, any of them is accepted.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n0 \\leq a_i \\leq 10^9\n\na_1,a_2,...,a_n are pairwise distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint a_i and a_j that you selected, with a space in between.\n\nSample Input 1\n\n5\n6 9 4 2 11\n\nSample Output 1\n\n11 6\n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n\\rm{comb}(4,2)=6\n\n\\rm{comb}(6,2)=15\n\n\\rm{comb}(6,4)=15\n\n\\rm{comb}(9,2)=36\n\n\\rm{comb}(9,4)=126\n\n\\rm{comb}(9,6)=84\n\n\\rm{comb}(11,2)=55\n\n\\rm{comb}(11,4)=330\n\n\\rm{comb}(11,6)=462\n\n\\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\nSample Input 2\n\n2\n100 0\n\nSample Output 2\n\n100 0", "sample_input": "5\n6 9 4 2 11\n"}, "reference_outputs": ["11 6\n"], "source_document_id": "p03380", "source_text": "Score : 400 points\n\nProblem Statement\n\nLet {\\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order.\nFrom n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\\rm comb}(a_i,a_j) is maximized.\nIf there are multiple pairs that maximize the value, any of them is accepted.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n0 \\leq a_i \\leq 10^9\n\na_1,a_2,...,a_n are pairwise distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint a_i and a_j that you selected, with a space in between.\n\nSample Input 1\n\n5\n6 9 4 2 11\n\nSample Output 1\n\n11 6\n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n\\rm{comb}(4,2)=6\n\n\\rm{comb}(6,2)=15\n\n\\rm{comb}(6,4)=15\n\n\\rm{comb}(9,2)=36\n\n\\rm{comb}(9,4)=126\n\n\\rm{comb}(9,6)=84\n\n\\rm{comb}(11,2)=55\n\n\\rm{comb}(11,4)=330\n\n\\rm{comb}(11,6)=462\n\n\\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\nSample Input 2\n\n2\n100 0\n\nSample Output 2\n\n100 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2499, "cpu_time_ms": 49, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s426884453", "group_id": "codeNet:p03380", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt(sc)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tmaxi := a[0]\n\tmidi := maxi / 2\n\tans := a[0]\n\tmind := int(1e9) + 1\n\tfor i := 1; i < n; i++ {\n\t\td := abs(midi - a[i])\n\t\tif mind > d {\n\t\t\tmind = d\n\t\t\tans = a[i]\n\t\t}\n\t}\n\tfmt.Println(maxi, ans)\n}\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n", "language": "Go", "metadata": {"date": 1575740936, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03380.html", "problem_id": "p03380", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03380/input.txt", "sample_output_relpath": "derived/input_output/data/p03380/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03380/Go/s426884453.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s426884453", "user_id": "u196030116"}, "prompt_components": {"gold_output": "11 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt(sc)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tmaxi := a[0]\n\tmidi := maxi / 2\n\tans := a[0]\n\tmind := int(1e9) + 1\n\tfor i := 1; i < n; i++ {\n\t\td := abs(midi - a[i])\n\t\tif mind > d {\n\t\t\tmind = d\n\t\t\tans = a[i]\n\t\t}\n\t}\n\tfmt.Println(maxi, ans)\n}\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nLet {\\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order.\nFrom n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\\rm comb}(a_i,a_j) is maximized.\nIf there are multiple pairs that maximize the value, any of them is accepted.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n0 \\leq a_i \\leq 10^9\n\na_1,a_2,...,a_n are pairwise distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint a_i and a_j that you selected, with a space in between.\n\nSample Input 1\n\n5\n6 9 4 2 11\n\nSample Output 1\n\n11 6\n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n\\rm{comb}(4,2)=6\n\n\\rm{comb}(6,2)=15\n\n\\rm{comb}(6,4)=15\n\n\\rm{comb}(9,2)=36\n\n\\rm{comb}(9,4)=126\n\n\\rm{comb}(9,6)=84\n\n\\rm{comb}(11,2)=55\n\n\\rm{comb}(11,4)=330\n\n\\rm{comb}(11,6)=462\n\n\\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\nSample Input 2\n\n2\n100 0\n\nSample Output 2\n\n100 0", "sample_input": "5\n6 9 4 2 11\n"}, "reference_outputs": ["11 6\n"], "source_document_id": "p03380", "source_text": "Score : 400 points\n\nProblem Statement\n\nLet {\\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order.\nFrom n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\\rm comb}(a_i,a_j) is maximized.\nIf there are multiple pairs that maximize the value, any of them is accepted.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n0 \\leq a_i \\leq 10^9\n\na_1,a_2,...,a_n are pairwise distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint a_i and a_j that you selected, with a space in between.\n\nSample Input 1\n\n5\n6 9 4 2 11\n\nSample Output 1\n\n11 6\n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n\\rm{comb}(4,2)=6\n\n\\rm{comb}(6,2)=15\n\n\\rm{comb}(6,4)=15\n\n\\rm{comb}(9,2)=36\n\n\\rm{comb}(9,4)=126\n\n\\rm{comb}(9,6)=84\n\n\\rm{comb}(11,2)=55\n\n\\rm{comb}(11,4)=330\n\n\\rm{comb}(11,6)=462\n\n\\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\nSample Input 2\n\n2\n100 0\n\nSample Output 2\n\n100 0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 629, "cpu_time_ms": 63, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s287062209", "group_id": "codeNet:p03385", "input_text": "package main\n\nimport (\n\t. \"fmt\"\n \"strings\"\n \"sort\"\n)\n\n// func init() { Println(\"----------------------------------------\") }\n\nfunc main() {\n var s string\n Scanf(\"%s\", &s)\n\n chars := strings.Split(s, \"\")\n\n sort.Sort(sort.StringSlice(chars))\n\n if chars[0] == \"a\" && chars[1] == \"b\" && chars[2] == \"c\" {\n Println(\"Yes\")\n } else {\n Println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1592089373, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03385.html", "problem_id": "p03385", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03385/input.txt", "sample_output_relpath": "derived/input_output/data/p03385/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03385/Go/s287062209.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287062209", "user_id": "u376366206"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t. \"fmt\"\n \"strings\"\n \"sort\"\n)\n\n// func init() { Println(\"----------------------------------------\") }\n\nfunc main() {\n var s string\n Scanf(\"%s\", &s)\n\n chars := strings.Split(s, \"\")\n\n sort.Sort(sort.StringSlice(chars))\n\n if chars[0] == \"a\" && chars[1] == \"b\" && chars[2] == \"c\" {\n Println(\"Yes\")\n } else {\n Println(\"No\")\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 3 consisting of a, b and c. Determine if S can be obtained by permuting abc.\n\nConstraints\n\n|S|=3\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S can be obtained by permuting abc, print Yes; otherwise, print No.\n\nSample Input 1\n\nbac\n\nSample Output 1\n\nYes\n\nSwapping the first and second characters in bac results in abc.\n\nSample Input 2\n\nbab\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nabc\n\nSample Output 3\n\nYes\n\nSample Input 4\n\naaa\n\nSample Output 4\n\nNo", "sample_input": "bac\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03385", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 3 consisting of a, b and c. Determine if S can be obtained by permuting abc.\n\nConstraints\n\n|S|=3\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S can be obtained by permuting abc, print Yes; otherwise, print No.\n\nSample Input 1\n\nbac\n\nSample Output 1\n\nYes\n\nSwapping the first and second characters in bac results in abc.\n\nSample Input 2\n\nbab\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nabc\n\nSample Output 3\n\nYes\n\nSample Input 4\n\naaa\n\nSample Output 4\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 388, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s516876378", "group_id": "codeNet:p03386", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar A, B, K int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tA, B, K = nextInt(), nextInt(), nextInt()\n\tif K > (B-A)/2 {\n\t\tfor i := A; i <= B; i++ {\n\t\t\tfmt.Println(i)\n\t\t}\n\t\treturn\n\t}\n\tfor i := A; i < A+K; i++ {\n\t\tfmt.Println(i)\n\t}\n\n\tfor i := B - K + 1; i <= B; i++ {\n\t\tfmt.Println(i)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1592012500, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03386.html", "problem_id": "p03386", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03386/input.txt", "sample_output_relpath": "derived/input_output/data/p03386/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03386/Go/s516876378.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s516876378", "user_id": "u432333240"}, "prompt_components": {"gold_output": "3\n4\n7\n8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar A, B, K int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tA, B, K = nextInt(), nextInt(), nextInt()\n\tif K > (B-A)/2 {\n\t\tfor i := A; i <= B; i++ {\n\t\t\tfmt.Println(i)\n\t\t}\n\t\treturn\n\t}\n\tfor i := A; i < A+K; i++ {\n\t\tfmt.Println(i)\n\t}\n\n\tfor i := B - K + 1; i <= B; i++ {\n\t\tfmt.Println(i)\n\t}\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nPrint all the integers that satisfies the following in ascending order:\n\nAmong the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint all the integers that satisfies the condition above in ascending order.\n\nSample Input 1\n\n3 8 2\n\nSample Output 1\n\n3\n4\n7\n8\n\n3 is the first smallest integer among the integers between 3 and 8.\n\n4 is the second smallest integer among the integers between 3 and 8.\n\n7 is the second largest integer among the integers between 3 and 8.\n\n8 is the first largest integer among the integers between 3 and 8.\n\nSample Input 2\n\n4 8 3\n\nSample Output 2\n\n4\n5\n6\n7\n8\n\nSample Input 3\n\n2 9 100\n\nSample Output 3\n\n2\n3\n4\n5\n6\n7\n8\n9", "sample_input": "3 8 2\n"}, "reference_outputs": ["3\n4\n7\n8\n"], "source_document_id": "p03386", "source_text": "Score : 200 points\n\nProblem Statement\n\nPrint all the integers that satisfies the following in ascending order:\n\nAmong the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint all the integers that satisfies the condition above in ascending order.\n\nSample Input 1\n\n3 8 2\n\nSample Output 1\n\n3\n4\n7\n8\n\n3 is the first smallest integer among the integers between 3 and 8.\n\n4 is the second smallest integer among the integers between 3 and 8.\n\n7 is the second largest integer among the integers between 3 and 8.\n\n8 is the first largest integer among the integers between 3 and 8.\n\nSample Input 2\n\n4 8 3\n\nSample Output 2\n\n4\n5\n6\n7\n8\n\nSample Input 3\n\n2 9 100\n\nSample Output 3\n\n2\n3\n4\n5\n6\n7\n8\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2469, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448247516", "group_id": "codeNet:p03386", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfor i := 0; i < c; i++ {\n\t\tif a+i <= b {\n\t\t\tfmt.Println(a + i)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\ttmp := a + c\n\tfor i := c - 1; i >= 0; i-- {\n\t\tif b-i >= tmp {\n\t\t\tfmt.Println(b - i)\n\t\t}\n\t}\n\n}", "language": "Go", "metadata": {"date": 1541537586, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03386.html", "problem_id": "p03386", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03386/input.txt", "sample_output_relpath": "derived/input_output/data/p03386/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03386/Go/s448247516.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448247516", "user_id": "u939552576"}, "prompt_components": {"gold_output": "3\n4\n7\n8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfor i := 0; i < c; i++ {\n\t\tif a+i <= b {\n\t\t\tfmt.Println(a + i)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\ttmp := a + c\n\tfor i := c - 1; i >= 0; i-- {\n\t\tif b-i >= tmp {\n\t\t\tfmt.Println(b - i)\n\t\t}\n\t}\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nPrint all the integers that satisfies the following in ascending order:\n\nAmong the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint all the integers that satisfies the condition above in ascending order.\n\nSample Input 1\n\n3 8 2\n\nSample Output 1\n\n3\n4\n7\n8\n\n3 is the first smallest integer among the integers between 3 and 8.\n\n4 is the second smallest integer among the integers between 3 and 8.\n\n7 is the second largest integer among the integers between 3 and 8.\n\n8 is the first largest integer among the integers between 3 and 8.\n\nSample Input 2\n\n4 8 3\n\nSample Output 2\n\n4\n5\n6\n7\n8\n\nSample Input 3\n\n2 9 100\n\nSample Output 3\n\n2\n3\n4\n5\n6\n7\n8\n9", "sample_input": "3 8 2\n"}, "reference_outputs": ["3\n4\n7\n8\n"], "source_document_id": "p03386", "source_text": "Score : 200 points\n\nProblem Statement\n\nPrint all the integers that satisfies the following in ascending order:\n\nAmong the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.\n\nConstraints\n\n1 \\leq A \\leq B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint all the integers that satisfies the condition above in ascending order.\n\nSample Input 1\n\n3 8 2\n\nSample Output 1\n\n3\n4\n7\n8\n\n3 is the first smallest integer among the integers between 3 and 8.\n\n4 is the second smallest integer among the integers between 3 and 8.\n\n7 is the second largest integer among the integers between 3 and 8.\n\n8 is the first largest integer among the integers between 3 and 8.\n\nSample Input 2\n\n4 8 3\n\nSample Output 2\n\n4\n5\n6\n7\n8\n\nSample Input 3\n\n2 9 100\n\nSample Output 3\n\n2\n3\n4\n5\n6\n7\n8\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 271, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s599699357", "group_id": "codeNet:p03387", "input_text": "// minをmaxにして残ったのをなんとかする\n// なぜか2WA 意味不明 [0 1 1] -> [1 1 2] で[3 3 3]にしてしまっていたっぽい\n// なんでふたつまえの提出でWAをくらったのかまるで理解できない たぶんジャッジがバグってるよ\npackage main\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\nfunc main(){\n\tA := make([]int, 3)\n\tfor i:=0; i<3; i++{\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tminimum, maximum := A[0], A[2]\n\tans := 0\n\tif (maximum-minimum)%2 == 0{\n\t\t// ひたすら2だけやる\n\t\tans += (maximum-minimum)/2\n\t\tA[0] = A[2]\n\t}else{\n\t\t// 1回だけ1をまぜる そのときA[1]にも加算\n\t\tans += (maximum-minimum)/2 + 1\n\t\tA[0] = A[2]\n\t\tA[1]++\n\t}\n\tsort.Ints(A)\n\tfmt.Println(A, ans)\n\tif A[0]==A[1] && A[1] == A[2]{\n\t\tfmt.Println(ans)\n\t}else{\n\t\tif (A[2]-A[0]) % 2 == 1{\n\t\t\tif A[2]-A[0] == 1{\n\t\t\t\tfmt.Println(ans+1)\n\t\t\t\treturn\n\t\t\t}else{\n\t\t\t\tA[1]++\n\t\t\t\tA[2]++\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t\tans += (A[2] - A[0])/2\n\t\tfmt.Println(ans)\n\t}\n}", "language": "Go", "metadata": {"date": 1593296243, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03387.html", "problem_id": "p03387", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03387/input.txt", "sample_output_relpath": "derived/input_output/data/p03387/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03387/Go/s599699357.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s599699357", "user_id": "u445624660"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// minをmaxにして残ったのをなんとかする\n// なぜか2WA 意味不明 [0 1 1] -> [1 1 2] で[3 3 3]にしてしまっていたっぽい\n// なんでふたつまえの提出でWAをくらったのかまるで理解できない たぶんジャッジがバグってるよ\npackage main\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\nfunc main(){\n\tA := make([]int, 3)\n\tfor i:=0; i<3; i++{\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tminimum, maximum := A[0], A[2]\n\tans := 0\n\tif (maximum-minimum)%2 == 0{\n\t\t// ひたすら2だけやる\n\t\tans += (maximum-minimum)/2\n\t\tA[0] = A[2]\n\t}else{\n\t\t// 1回だけ1をまぜる そのときA[1]にも加算\n\t\tans += (maximum-minimum)/2 + 1\n\t\tA[0] = A[2]\n\t\tA[1]++\n\t}\n\tsort.Ints(A)\n\tfmt.Println(A, ans)\n\tif A[0]==A[1] && A[1] == A[2]{\n\t\tfmt.Println(ans)\n\t}else{\n\t\tif (A[2]-A[0]) % 2 == 1{\n\t\t\tif A[2]-A[0] == 1{\n\t\t\t\tfmt.Println(ans+1)\n\t\t\t\treturn\n\t\t\t}else{\n\t\t\t\tA[1]++\n\t\t\t\tA[2]++\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t\tans += (A[2] - A[0])/2\n\t\tfmt.Println(ans)\n\t}\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "sample_input": "2 5 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03387", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 959, "cpu_time_ms": 8, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s634878000", "group_id": "codeNet:p03387", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// IO struct\ntype IO struct {\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n}\n\nfunc newIO() *IO {\n\treturn &IO{\n\t\tscanner: bufio.NewScanner(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (IO *IO) nextLine() string {\n\tIO.scanner.Scan()\n\treturn IO.scanner.Text()\n}\n\nfunc (IO *IO) nextInt() int {\n\ti, e := strconv.Atoi(IO.nextLine())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (IO *IO) scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = IO.nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc (IO *IO) printLn(a ...interface{}) {\n\tfmt.Fprintln(IO.writer, a...)\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc sumSlice(nums []int) int {\n\tsum := 0\n\tfor _, n := range nums {\n\t\tsum += n\n\t}\n\treturn sum\n}\n\nfunc binarySearch(target int, list []int) int {\n\tleft := 0\n\tright := len(list) - 1\n\tmid := (left + right) / 2\n\n\tfor {\n\t\tif list[mid] < target {\n\t\t\tleft = mid + 1\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t\tmid = (left + right) / 2\n\t\tif left >= right {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn mid\n}\n\nvar io = newIO()\n\nfunc main() {\n\tio.scanner.Split(bufio.ScanWords) // switch to separating by space\n\t// scanner.Buffer([]byte{}, 1000000009) // switch to read large size input\n\tdefer io.writer.Flush()\n\n\tnums := io.scanNums(3)\n\tsort.Ints(nums)\n\n\ttotalDiff := 0\n\ttotalDiff += nums[2] - nums[0]\n\ttotalDiff += nums[2] - nums[1]\n\n\tanswer := 0\n\tif totalDiff%2 == 0 {\n\t\tanswer = int(totalDiff / 2)\n\t} else {\n\t\ttotalDiff++\n\t\tanswer = 1 + int(totalDiff/2)\n\t}\n\n\tio.printLn(answer)\n}\n", "language": "Go", "metadata": {"date": 1578008699, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03387.html", "problem_id": "p03387", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03387/input.txt", "sample_output_relpath": "derived/input_output/data/p03387/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03387/Go/s634878000.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s634878000", "user_id": "u764956288"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// IO struct\ntype IO struct {\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n}\n\nfunc newIO() *IO {\n\treturn &IO{\n\t\tscanner: bufio.NewScanner(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (IO *IO) nextLine() string {\n\tIO.scanner.Scan()\n\treturn IO.scanner.Text()\n}\n\nfunc (IO *IO) nextInt() int {\n\ti, e := strconv.Atoi(IO.nextLine())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (IO *IO) scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = IO.nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc (IO *IO) printLn(a ...interface{}) {\n\tfmt.Fprintln(IO.writer, a...)\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc sumSlice(nums []int) int {\n\tsum := 0\n\tfor _, n := range nums {\n\t\tsum += n\n\t}\n\treturn sum\n}\n\nfunc binarySearch(target int, list []int) int {\n\tleft := 0\n\tright := len(list) - 1\n\tmid := (left + right) / 2\n\n\tfor {\n\t\tif list[mid] < target {\n\t\t\tleft = mid + 1\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t\tmid = (left + right) / 2\n\t\tif left >= right {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn mid\n}\n\nvar io = newIO()\n\nfunc main() {\n\tio.scanner.Split(bufio.ScanWords) // switch to separating by space\n\t// scanner.Buffer([]byte{}, 1000000009) // switch to read large size input\n\tdefer io.writer.Flush()\n\n\tnums := io.scanNums(3)\n\tsort.Ints(nums)\n\n\ttotalDiff := 0\n\ttotalDiff += nums[2] - nums[0]\n\ttotalDiff += nums[2] - nums[1]\n\n\tanswer := 0\n\tif totalDiff%2 == 0 {\n\t\tanswer = int(totalDiff / 2)\n\t} else {\n\t\ttotalDiff++\n\t\tanswer = 1 + int(totalDiff/2)\n\t}\n\n\tio.printLn(answer)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "sample_input": "2 5 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03387", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2055, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s397617820", "group_id": "codeNet:p03387", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tabc := getIntSlice(3)\n\tsort.Ints(abc)\n\n\tans := 0\n\tans += (abc[2]-abc[0])/2 + (abc[2]-abc[1])/2\n\n\tif (abc[0]%2 == abc[1]%2) && (abc[0]%2 != abc[2]%2) {\n\t\tans++\n\t} else if abc[0]%2 != abc[1]%2 {\n\t\tans += 2\n\t}\n\n\tfmt.Println(ans)\n}\n\n// -----------------------------------------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc getInt() int {\n\ti, err := strconv.Atoi(getString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tis := make([]int, n)\n\tfor i := range is {\n\t\tis[i] = getInt()\n\t}\n\treturn is\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1569179535, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03387.html", "problem_id": "p03387", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03387/input.txt", "sample_output_relpath": "derived/input_output/data/p03387/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03387/Go/s397617820.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s397617820", "user_id": "u543933043"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tabc := getIntSlice(3)\n\tsort.Ints(abc)\n\n\tans := 0\n\tans += (abc[2]-abc[0])/2 + (abc[2]-abc[1])/2\n\n\tif (abc[0]%2 == abc[1]%2) && (abc[0]%2 != abc[2]%2) {\n\t\tans++\n\t} else if abc[0]%2 != abc[1]%2 {\n\t\tans += 2\n\t}\n\n\tfmt.Println(ans)\n}\n\n// -----------------------------------------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc getInt() int {\n\ti, err := strconv.Atoi(getString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tis := make([]int, n)\n\tfor i := range is {\n\t\tis[i] = getInt()\n\t}\n\treturn is\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "sample_input": "2 5 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03387", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:\n\nChoose two among A, B and C, then increase both by 1.\n\nChoose one among A, B and C, then increase it by 2.\n\nIt can be proved that we can always make A, B and C all equal by repeatedly performing these operations.\n\nConstraints\n\n0 \\leq A,B,C \\leq 50\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the minimum number of operations required to make A, B and C all equal.\n\nSample Input 1\n\n2 5 4\n\nSample Output 1\n\n2\n\nWe can make A, B and C all equal by the following operations:\n\nIncrease A and C by 1. Now, A, B, C are 3, 5, 5, respectively.\n\nIncrease A by 2. Now, A, B, C are 5, 5, 5, respectively.\n\nSample Input 2\n\n2 6 3\n\nSample Output 2\n\n5\n\nSample Input 3\n\n31 41 5\n\nSample Output 3\n\n23", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 773, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s323543336", "group_id": "codeNet:p03388", "input_text": "///\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Sat Apr 7 21:14:03 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar Q int\nvar A, B int64\nvar eps float64 = 1e-9\n\nfunc main() {\n\tfmt.Scan(&Q)\n\tfor i := 0; i < Q; i++ {\n\t\tfmt.Scan(&A, &B)\n\t\tif A > B {\n\t\t\tA, B = B, A\n\t\t}\n\n\t\tif A == B {\n\t\t\tfmt.Println(2*A - 2)\n\t\t} else if A+1 == B {\n\t\t\tfmt.Println(2*A - 2)\n\t\t} else {\n\t\t\tC := int64(math.Sqrt(float64(A * B)))\n\t\t\tif C*C == A*B {\n\t\t\t\tC--\n\t\t\t}\n\t\t\tif C*(C+1) >= A*B {\n\t\t\t\tfmt.Println(2*C - 2)\n\t\t\t} else {\n\t\t\t\tfmt.Println(2*C - 1)\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1523497020, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03388.html", "problem_id": "p03388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03388/input.txt", "sample_output_relpath": "derived/input_output/data/p03388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03388/Go/s323543336.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s323543336", "user_id": "u802614675"}, "prompt_components": {"gold_output": "1\n12\n4\n11\n14\n57\n31\n671644785\n", "input_to_evaluate": "///\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Sat Apr 7 21:14:03 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar Q int\nvar A, B int64\nvar eps float64 = 1e-9\n\nfunc main() {\n\tfmt.Scan(&Q)\n\tfor i := 0; i < Q; i++ {\n\t\tfmt.Scan(&A, &B)\n\t\tif A > B {\n\t\t\tA, B = B, A\n\t\t}\n\n\t\tif A == B {\n\t\t\tfmt.Println(2*A - 2)\n\t\t} else if A+1 == B {\n\t\t\tfmt.Println(2*A - 2)\n\t\t} else {\n\t\t\tC := int64(math.Sqrt(float64(A * B)))\n\t\t\tif C*C == A*B {\n\t\t\t\tC--\n\t\t\t}\n\t\t\tif C*(C+1) >= A*B {\n\t\t\t\tfmt.Println(2*C - 2)\n\t\t\t} else {\n\t\t\t\tfmt.Println(2*C - 1)\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "sample_input": "8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n"}, "reference_outputs": ["1\n12\n4\n11\n14\n57\n31\n671644785\n"], "source_document_id": "p03388", "source_text": "Score : 700 points\n\nProblem Statement\n\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.\n\nThe score of a participant is the product of his/her ranks in the two contests.\n\nProcess the following Q queries:\n\nIn the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nConstraints\n\n1 \\leq Q \\leq 100\n\n1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nA_1 B_1\n:\nA_Q B_Q\n\nOutput\n\nFor each query, print the maximum possible number of participants whose scores are smaller than Takahashi's.\n\nSample Input 1\n\n8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n\nSample Output 1\n\n1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked x-th in the first contest and y-th in the second contest as (x,y).\n\nIn the first query, (2,1) is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 549, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s770123265", "group_id": "codeNet:p03401", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\nvar A []int\n\nfunc main() {\n\tfmt.Scanf(\"%d\", &N)\n\n\tA = make([]int, N+2)\n\n\tfor i := 1; i < N+1; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\ts := make([]int, N+1)\n\tfor i := 1; i < N+1; i++ {\n\t\ts[i] = s[i-1] + Abs(A[i-1]-A[i])\n\t}\n\n\tfor i := 1; i < N+1; i++ {\n\t\tvar ans int\n\t\tif i == N {\n\t\t\tans = s[N]\n\t\t\tans += Abs(A[N-1]) - (s[N] - s[N-1])\n\t\t} else {\n\t\t\tans = s[i-1] + (s[N] - s[i+1]) + Abs(A[i-1]-A[i+1])\n\t\t\tans += Abs(A[N])\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n\nfunc Abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n", "language": "Go", "metadata": {"date": 1522035115, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03401.html", "problem_id": "p03401", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03401/input.txt", "sample_output_relpath": "derived/input_output/data/p03401/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03401/Go/s770123265.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s770123265", "user_id": "u434572230"}, "prompt_components": {"gold_output": "12\n8\n10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\nvar A []int\n\nfunc main() {\n\tfmt.Scanf(\"%d\", &N)\n\n\tA = make([]int, N+2)\n\n\tfor i := 1; i < N+1; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\ts := make([]int, N+1)\n\tfor i := 1; i < N+1; i++ {\n\t\ts[i] = s[i-1] + Abs(A[i-1]-A[i])\n\t}\n\n\tfor i := 1; i < N+1; i++ {\n\t\tvar ans int\n\t\tif i == N {\n\t\t\tans = s[N]\n\t\t\tans += Abs(A[N-1]) - (s[N] - s[N-1])\n\t\t} else {\n\t\t\tans = s[i-1] + (s[N] - s[i+1]) + Abs(A[i-1]-A[i+1])\n\t\t\tans += Abs(A[N])\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n\nfunc Abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "sample_input": "3\n3 5 -1\n"}, "reference_outputs": ["12\n8\n10\n"], "source_document_id": "p03401", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 612, "cpu_time_ms": 594, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s874828325", "group_id": "codeNet:p03401", "input_text": "///\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Mar 25 21:07:39 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\n\nfunc diff(a, b int) int {\n\tif a < b {\n\t\treturn b - a\n\t}\n\treturn a - b\n}\n\nfunc main() {\n\tfmt.Scan(&N)\n\n\tarr := make([]int, N+2)\n\n\tprev := 0\n\ttotal := 0\n\tfor i := 1; i <= N; i++ {\n\t\tfmt.Scan(&arr[i])\n\t\ttotal += diff(prev, arr[i])\n\t\tprev = arr[i]\n\t}\n\ttotal += diff(0, prev)\n\n\tprev = 0\n\tfor i := 1; i <= N; i++ {\n\t\tvar d int\n\t\tif prev < arr[i] {\n\t\t\tif arr[i] < arr[i+1] {\n\t\t\t\td = 0\n\t\t\t} else {\n\t\t\t\td = -diff(arr[i], arr[i+1]) - diff(prev, arr[i]) + diff(prev, arr[i+1])\n\t\t\t}\n\t\t} else {\n\t\t\tif arr[i] < arr[i+1] {\n\t\t\t\td = -diff(arr[i], arr[i+1]) - diff(prev, arr[i]) + diff(prev, arr[i+1])\n\t\t\t} else {\n\t\t\t\td = 0\n\t\t\t}\n\t\t}\n\t\tfmt.Println(total + d)\n\t\tprev = arr[i]\n\t}\n}\n", "language": "Go", "metadata": {"date": 1522027932, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03401.html", "problem_id": "p03401", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03401/input.txt", "sample_output_relpath": "derived/input_output/data/p03401/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03401/Go/s874828325.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s874828325", "user_id": "u802614675"}, "prompt_components": {"gold_output": "12\n8\n10\n", "input_to_evaluate": "///\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Mar 25 21:07:39 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\n\nfunc diff(a, b int) int {\n\tif a < b {\n\t\treturn b - a\n\t}\n\treturn a - b\n}\n\nfunc main() {\n\tfmt.Scan(&N)\n\n\tarr := make([]int, N+2)\n\n\tprev := 0\n\ttotal := 0\n\tfor i := 1; i <= N; i++ {\n\t\tfmt.Scan(&arr[i])\n\t\ttotal += diff(prev, arr[i])\n\t\tprev = arr[i]\n\t}\n\ttotal += diff(0, prev)\n\n\tprev = 0\n\tfor i := 1; i <= N; i++ {\n\t\tvar d int\n\t\tif prev < arr[i] {\n\t\t\tif arr[i] < arr[i+1] {\n\t\t\t\td = 0\n\t\t\t} else {\n\t\t\t\td = -diff(arr[i], arr[i+1]) - diff(prev, arr[i]) + diff(prev, arr[i+1])\n\t\t\t}\n\t\t} else {\n\t\t\tif arr[i] < arr[i+1] {\n\t\t\t\td = -diff(arr[i], arr[i+1]) - diff(prev, arr[i]) + diff(prev, arr[i+1])\n\t\t\t} else {\n\t\t\t\td = 0\n\t\t\t}\n\t\t}\n\t\tfmt.Println(total + d)\n\t\tprev = arr[i]\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "sample_input": "3\n3 5 -1\n"}, "reference_outputs": ["12\n8\n10\n"], "source_document_id": "p03401", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N sightseeing spots on the x-axis, numbered 1, 2, ..., N.\nSpot i is at the point with coordinate A_i.\nIt costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.\n\nYou planned a trip along the axis.\nIn this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.\n\nHowever, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i.\nYou will visit the remaining spots as planned in the order they are numbered.\nYou will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.\n\nFor each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n-5000 \\leq A_i \\leq 5000 (1 \\leq i \\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint N lines.\nIn the i-th line, print the total cost of travel during the trip when the visit to Spot i is canceled.\n\nSample Input 1\n\n3\n3 5 -1\n\nSample Output 1\n\n12\n8\n10\n\nSpot 1, 2 and 3 are at the points with coordinates 3, 5 and -1, respectively.\nFor each i, the course of the trip and the total cost of travel when the visit to Spot i is canceled, are as follows:\n\nFor i = 1, the course of the trip is 0 \\rightarrow 5 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 5 + 6 + 1 = 12 yen.\n\nFor i = 2, the course of the trip is 0 \\rightarrow 3 \\rightarrow -1 \\rightarrow 0 and the total cost of travel is 3 + 4 + 1 = 8 yen.\n\nFor i = 3, the course of the trip is 0 \\rightarrow 3 \\rightarrow 5 \\rightarrow 0 and the total cost of travel is 3 + 2 + 5 = 10 yen.\n\nSample Input 2\n\n5\n1 1 1 2 0\n\nSample Output 2\n\n4\n4\n4\n2\n4\n\nSample Input 3\n\n6\n-679 -2409 -3258 3095 -3291 -4462\n\nSample Output 3\n\n21630\n21630\n19932\n8924\n21630\n19288", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 790, "cpu_time_ms": 609, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s643670057", "group_id": "codeNet:p03402", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tvar A, B int\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d %d\", &A, &B)\n\n\th := 100\n\tw := 100\n\n\t// init\n\ttable := make([][]string, h)\n\tfor i := 0; i < len(table); i++ {\n\t\ttable[i] = make([]string, w)\n\t\tfor j := 0; j < len(table[i]); j++ {\n\t\t\tif j < 50 {\n\t\t\t\ttable[i][j] = \".\"\n\t\t\t} else {\n\t\t\t\ttable[i][j] = \"#\"\n\t\t\t}\n\t\t}\n\t}\n\n\t// for #\n\tfor n := 0; n < (A - 1); n++ {\n\t\ttable[(n%50)*2][(n/50)*2] = \"#\"\n\t}\n\t// for .\n\tfor n := 0; n < (B - 1); n++ {\n\t\ttable[(n%50)*2][w-1-(n/50)*2] = \".\"\n\t}\n\n\tfmt.Println(h, w)\n\tfor i := 0; i < len(table); i++ {\n\t\tfor j := 0; j < len(table[i]); j++ {\n\t\t\tfmt.Print(table[i][j])\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1549433337, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03402.html", "problem_id": "p03402", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03402/input.txt", "sample_output_relpath": "derived/input_output/data/p03402/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03402/Go/s643670057.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s643670057", "user_id": "u381572327"}, "prompt_components": {"gold_output": "3 3\n##.\n..#\n#.#\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tvar A, B int\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d %d\", &A, &B)\n\n\th := 100\n\tw := 100\n\n\t// init\n\ttable := make([][]string, h)\n\tfor i := 0; i < len(table); i++ {\n\t\ttable[i] = make([]string, w)\n\t\tfor j := 0; j < len(table[i]); j++ {\n\t\t\tif j < 50 {\n\t\t\t\ttable[i][j] = \".\"\n\t\t\t} else {\n\t\t\t\ttable[i][j] = \"#\"\n\t\t\t}\n\t\t}\n\t}\n\n\t// for #\n\tfor n := 0; n < (A - 1); n++ {\n\t\ttable[(n%50)*2][(n/50)*2] = \"#\"\n\t}\n\t// for .\n\tfor n := 0; n < (B - 1); n++ {\n\t\ttable[(n%50)*2][w-1-(n/50)*2] = \".\"\n\t}\n\n\tfmt.Println(h, w)\n\tfor i := 0; i < len(table); i++ {\n\t\tfor j := 0; j < len(table[i]); j++ {\n\t\t\tfmt.Print(table[i][j])\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given two integers A and B.\n\nPrint a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output section:\n\nLet the size of the grid be h \\times w (h vertical, w horizontal). Both h and w are at most 100.\n\nThe set of the squares painted white is divided into exactly A connected components.\n\nThe set of the squares painted black is divided into exactly B connected components.\n\nIt can be proved that there always exist one or more solutions under the conditions specified in Constraints section.\nIf there are multiple solutions, any of them may be printed.\n\nNotes\n\nTwo squares painted white, c_1 and c_2, are called connected when the square c_2 can be reached from the square c_1 passing only white squares by repeatedly moving up, down, left or right to an adjacent square.\n\nA set of squares painted white, S, forms a connected component when the following conditions are met:\n\nAny two squares in S are connected.\n\nNo pair of a square painted white that is not included in S and a square included in S is connected.\n\nA connected component of squares painted black is defined similarly.\n\nConstraints\n\n1 \\leq A \\leq 500\n\n1 \\leq B \\leq 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nOutput should be in the following format:\n\nIn the first line, print integers h and w representing the size of the grid you constructed, with a space in between.\n\nThen, print h more lines. The i-th (1 \\leq i \\leq h) of these lines should contain a string s_i as follows:\n\nIf the square at the i-th row and j-th column (1 \\leq j \\leq w) in the grid is painted white, the j-th character in s_i should be ..\n\nIf the square at the i-th row and j-th column (1 \\leq j \\leq w) in the grid is painted black, the j-th character in s_i should be #.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n3 3\n##.\n..#\n#.#\n\nThis output corresponds to the grid below:\n\nSample Input 2\n\n7 8\n\nSample Output 2\n\n3 5\n#.#.#\n.#.#.\n#.#.#\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n4 2\n..\n#.\n##\n##\n\nSample Input 4\n\n3 14\n\nSample Output 4\n\n8 18\n..................\n..................\n....##.......####.\n....#.#.....#.....\n...#...#....#.....\n..#.###.#...#.....\n.#.......#..#.....\n#.........#..####.", "sample_input": "2 3\n"}, "reference_outputs": ["3 3\n##.\n..#\n#.#\n"], "source_document_id": "p03402", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given two integers A and B.\n\nPrint a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output section:\n\nLet the size of the grid be h \\times w (h vertical, w horizontal). Both h and w are at most 100.\n\nThe set of the squares painted white is divided into exactly A connected components.\n\nThe set of the squares painted black is divided into exactly B connected components.\n\nIt can be proved that there always exist one or more solutions under the conditions specified in Constraints section.\nIf there are multiple solutions, any of them may be printed.\n\nNotes\n\nTwo squares painted white, c_1 and c_2, are called connected when the square c_2 can be reached from the square c_1 passing only white squares by repeatedly moving up, down, left or right to an adjacent square.\n\nA set of squares painted white, S, forms a connected component when the following conditions are met:\n\nAny two squares in S are connected.\n\nNo pair of a square painted white that is not included in S and a square included in S is connected.\n\nA connected component of squares painted black is defined similarly.\n\nConstraints\n\n1 \\leq A \\leq 500\n\n1 \\leq B \\leq 500\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nOutput should be in the following format:\n\nIn the first line, print integers h and w representing the size of the grid you constructed, with a space in between.\n\nThen, print h more lines. The i-th (1 \\leq i \\leq h) of these lines should contain a string s_i as follows:\n\nIf the square at the i-th row and j-th column (1 \\leq j \\leq w) in the grid is painted white, the j-th character in s_i should be ..\n\nIf the square at the i-th row and j-th column (1 \\leq j \\leq w) in the grid is painted black, the j-th character in s_i should be #.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n3 3\n##.\n..#\n#.#\n\nThis output corresponds to the grid below:\n\nSample Input 2\n\n7 8\n\nSample Output 2\n\n3 5\n#.#.#\n.#.#.\n#.#.#\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n4 2\n..\n#.\n##\n##\n\nSample Input 4\n\n3 14\n\nSample Output 4\n\n8 18\n..................\n..................\n....##.......####.\n....#.#.....#.....\n...#...#....#.....\n..#.###.#...#.....\n.#.......#..#.....\n#.........#..####.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 733, "cpu_time_ms": 26, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s466646256", "group_id": "codeNet:p03407", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tA, B, C := readInt(), readInt(), readInt()\n\tif A+B >= C {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1587861499, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03407.html", "problem_id": "p03407", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03407/input.txt", "sample_output_relpath": "derived/input_output/data/p03407/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03407/Go/s466646256.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s466646256", "user_id": "u967669872"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tA, B, C := readInt(), readInt(), readInt()\n\tif A+B >= C {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "sample_input": "50 100 120\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03407", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5584, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s980992355", "group_id": "codeNet:p03407", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b,c int\n\tfmt.Scan(&a,&b,&c)\n\n\tif a+b >= c {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1571402506, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03407.html", "problem_id": "p03407", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03407/input.txt", "sample_output_relpath": "derived/input_output/data/p03407/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03407/Go/s980992355.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s980992355", "user_id": "u390374229"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b,c int\n\tfmt.Scan(&a,&b,&c)\n\n\tif a+b >= c {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "sample_input": "50 100 120\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03407", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 153, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s853374186", "group_id": "codeNet:p03407", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc091/tasks/abc091_a\n// ---------------------------------------------\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif a+b >= c {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1568545694, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03407.html", "problem_id": "p03407", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03407/input.txt", "sample_output_relpath": "derived/input_output/data/p03407/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03407/Go/s853374186.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s853374186", "user_id": "u554269352"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc091/tasks/abc091_a\n// ---------------------------------------------\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif a+b >= c {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "sample_input": "50 100 120\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03407", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq A, B \\leq 500\n\n1 \\leq C \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf Takahashi can buy the toy, print Yes; if he cannot, print No.\n\nSample Input 1\n\n50 100 120\n\nSample Output 1\n\nYes\n\nHe has 50 + 100 = 150 yen, so he can buy the 120-yen toy.\n\nSample Input 2\n\n500 100 1000\n\nSample Output 2\n\nNo\n\nHe has 500 + 100 = 600 yen, but he cannot buy the 1000-yen toy.\n\nSample Input 3\n\n19 123 143\n\nSample Output 3\n\nNo\n\nThere are 19-yen and 123-yen coins in Takahashi Kingdom, which are rather hard to use.\n\nSample Input 4\n\n19 123 142\n\nSample Output 4\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s442846824", "group_id": "codeNet:p03408", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\n\tfmt.Scan(&n)\n\tblue := map[string]int{}\n\tfor i := 0; i < n; i++ {\n\t\tvar name string\n\t\tfmt.Scan(&name)\n\t\tblue[name]+=1\n\t}\n\n\tfmt.Scan(&m)\n\tred := map[string]int{}\n\tfor i := 0; i < m; i++ {\n\t\tvar name string\n\t\tfmt.Scan(&name)\n\t\tred[name]+=1\n\t}\t\n\n\tvar result int\n\tfor k, v := range blue {\n\t\t_, exist := red[k]\n\t\tif exist {\n\t\t\tif v - red[k] > result {\n\t\t\t\tresult = v - red[k]\n\t\t\t}\n\t\t} else {\n\t\t\tif v > result {\n\t\t\t\tresult = v\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}", "language": "Go", "metadata": {"date": 1577153125, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03408.html", "problem_id": "p03408", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03408/input.txt", "sample_output_relpath": "derived/input_output/data/p03408/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03408/Go/s442846824.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s442846824", "user_id": "u610801172"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\n\tfmt.Scan(&n)\n\tblue := map[string]int{}\n\tfor i := 0; i < n; i++ {\n\t\tvar name string\n\t\tfmt.Scan(&name)\n\t\tblue[name]+=1\n\t}\n\n\tfmt.Scan(&m)\n\tred := map[string]int{}\n\tfor i := 0; i < m; i++ {\n\t\tvar name string\n\t\tfmt.Scan(&name)\n\t\tred[name]+=1\n\t}\t\n\n\tvar result int\n\tfor k, v := range blue {\n\t\t_, exist := red[k]\n\t\tif exist {\n\t\t\tif v - red[k] > result {\n\t\t\t\tresult = v - red[k]\n\t\t\t}\n\t\t} else {\n\t\t\tif v > result {\n\t\t\t\tresult = v\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "sample_input": "3\napple\norange\napple\n1\ngrape\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03408", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 518, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s654113554", "group_id": "codeNet:p03408", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc091/tasks/abc091_b\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc fact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact *= i\n\t}\n\treturn fact\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc euclideanDistance(a, b point) float64 {\n\ts := diff(a.x, b.x)\n\ts *= s\n\tt := diff(a.y, b.y)\n\tt *= t\n\treturn math.Sqrt(float64(s) + float64(t))\n}\nfunc manhattanDistance(a, b point) int {\n\ts := diff(a.x, b.x)\n\tt := diff(a.y, b.y)\n\treturn s + t\n}\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc cumSum(a []int) []int {\n\tb := append([]int{0}, a...)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\nfunc strToInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\nfunc intToStr(i int) string { return strconv.Itoa(i) }\nfunc CalcMod(a, mod int) int { return (a%mod + mod) % mod }\nfunc ModPow(x, y, mod int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc ModFact(x, mod int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % mod\n\t}\n\treturn fact\n}\nfunc ModInv(x, mod int) int { return ModPow(x, mod-2, mod) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pintsol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tbwBufSize = 1e6\n\n\talphabetUpper = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetLower = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\tn := ri()\n\tblues := rss(n)\n\tm := ri()\n\treds := rss(m)\n\n\tmp := make(map[string]int, n+m)\n\tfor i := range blues {\n\t\tmp[blues[i]]++\n\t}\n\tfor i := range reds {\n\t\tmp[reds[i]]--\n\t}\n\t// dbg(mp)\n\n\tmxV := 0\n\tfor _, v := range mp {\n\t\tif v > mxV {\n\t\t\tmxV = v\n\t\t}\n\t}\n\tpln(mxV)\n}\n", "language": "Go", "metadata": {"date": 1568546177, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03408.html", "problem_id": "p03408", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03408/input.txt", "sample_output_relpath": "derived/input_output/data/p03408/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03408/Go/s654113554.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s654113554", "user_id": "u554269352"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc091/tasks/abc091_b\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc fact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact *= i\n\t}\n\treturn fact\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc euclideanDistance(a, b point) float64 {\n\ts := diff(a.x, b.x)\n\ts *= s\n\tt := diff(a.y, b.y)\n\tt *= t\n\treturn math.Sqrt(float64(s) + float64(t))\n}\nfunc manhattanDistance(a, b point) int {\n\ts := diff(a.x, b.x)\n\tt := diff(a.y, b.y)\n\treturn s + t\n}\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc cumSum(a []int) []int {\n\tb := append([]int{0}, a...)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\nfunc strToInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\nfunc intToStr(i int) string { return strconv.Itoa(i) }\nfunc CalcMod(a, mod int) int { return (a%mod + mod) % mod }\nfunc ModPow(x, y, mod int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc ModFact(x, mod int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % mod\n\t}\n\treturn fact\n}\nfunc ModInv(x, mod int) int { return ModPow(x, mod-2, mod) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pintsol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tbwBufSize = 1e6\n\n\talphabetUpper = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetLower = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\tn := ri()\n\tblues := rss(n)\n\tm := ri()\n\treds := rss(m)\n\n\tmp := make(map[string]int, n+m)\n\tfor i := range blues {\n\t\tmp[blues[i]]++\n\t}\n\tfor i := range reds {\n\t\tmp[reds[i]]--\n\t}\n\t// dbg(mp)\n\n\tmxV := 0\n\tfor _, v := range mp {\n\t\tif v > mxV {\n\t\t\tmxV = v\n\t\t}\n\t}\n\tpln(mxV)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "sample_input": "3\napple\norange\napple\n1\ngrape\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03408", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7183, "cpu_time_ms": 11, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s034151694", "group_id": "codeNet:p03408", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN := fsc.NextInt()\n\tA := []string{}\n\tfor i := 0; i < N; i++ {\n\t\tA = append(A, fsc.Next())\n\t}\n\tM := fsc.NextInt()\n\tB := []string{}\n\tfor i := 0; i < M; i++ {\n\t\tB = append(B, fsc.Next())\n\t}\n\n\tans := 0\n\tfor _, blue := range A {\n\t\tresult := 0\n\t\tfor _, red := range B {\n\t\t\tif blue == red {\n\t\t\t\tresult--\n\t\t\t}\n\t\t}\n\t\tfor _, v := range A {\n\t\t\tif blue == v {\n\t\t\t\tresult++\n\t\t\t}\n\t\t}\n\t\tans = IntMax(ans, result)\n\t}\n\tfmt.Println(ans)\n\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc Int64Abs(a int64) int64 {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1524054301, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03408.html", "problem_id": "p03408", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03408/input.txt", "sample_output_relpath": "derived/input_output/data/p03408/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03408/Go/s034151694.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s034151694", "user_id": "u976162616"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN := fsc.NextInt()\n\tA := []string{}\n\tfor i := 0; i < N; i++ {\n\t\tA = append(A, fsc.Next())\n\t}\n\tM := fsc.NextInt()\n\tB := []string{}\n\tfor i := 0; i < M; i++ {\n\t\tB = append(B, fsc.Next())\n\t}\n\n\tans := 0\n\tfor _, blue := range A {\n\t\tresult := 0\n\t\tfor _, red := range B {\n\t\t\tif blue == red {\n\t\t\t\tresult--\n\t\t\t}\n\t\t}\n\t\tfor _, v := range A {\n\t\t\tif blue == v {\n\t\t\t\tresult++\n\t\t\t}\n\t\t}\n\t\tans = IntMax(ans, result)\n\t}\n\tfmt.Println(ans)\n\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc Int64Abs(a int64) int64 {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "sample_input": "3\napple\norange\napple\n1\ngrape\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03408", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N blue cards and M red cards.\nA string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will earn 1 yen (the currency of Japan); each time he finds a red card with that string, he will lose 1 yen.\n\nHere, we only consider the case where the string announced by Takahashi and the string on the card are exactly the same. For example, if he announces atcoder, he will not earn money even if there are blue cards with atcoderr, atcode, btcoder, and so on. (On the other hand, he will not lose money even if there are red cards with such strings, either.)\n\nAt most how much can he earn on balance?\n\nNote that the same string may be written on multiple cards.\n\nConstraints\n\nN and M are integers.\n\n1 \\leq N, M \\leq 100\n\ns_1, s_2, ..., s_N, t_1, t_2, ..., t_M are all strings of lengths between 1 and 10 (inclusive) consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\nM\nt_1\nt_2\n:\nt_M\n\nOutput\n\nIf Takahashi can earn at most X yen on balance, print X.\n\nSample Input 1\n\n3\napple\norange\napple\n1\ngrape\n\nSample Output 1\n\n2\n\nHe can earn 2 yen by announcing apple.\n\nSample Input 2\n\n3\napple\norange\napple\n5\napple\napple\napple\napple\napple\n\nSample Output 2\n\n1\n\nIf he announces apple, he will lose 3 yen. If he announces orange, he can earn 1 yen.\n\nSample Input 3\n\n1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n\nSample Output 3\n\n0\n\nIf he announces voldemort, he will lose 9 yen. If he announces orange, for example, he can avoid losing a yen.\n\nSample Input 4\n\n6\nred\nred\nblue\nyellow\nyellow\nred\n5\nred\nred\nyellow\ngreen\nblue\n\nSample Output 4\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2904, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s680408205", "group_id": "codeNet:p03409", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sat Dec 29 04:55:53 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype point struct {\n\tx, y int\n}\n\nfunc (p point) lessThan(q point) bool {\n\treturn p.x < q.x && p.y < q.y\n}\n\ntype points []point\n\n// (p points) ...\nfunc (p points) Less(i, j int) bool {\n\tif p[i].x == p[j].x {\n\t\treturn p[i].y < p[j].y\n\t}\n\n\treturn p[i].x < p[j].x\n}\n\n// (p points)Len ...\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\n// (p points)Swap ...\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\nfunc main() {\n\tvar N int\n\n\tfmt.Scan(&N)\n\treds := make(points, N)\n\tfor i := range reds {\n\t\tfmt.Scan(&reds[i].x, &reds[i].y)\n\t}\n\tsort.Sort(reds)\n\n\tblues := make(points, N)\n\tfor i := range blues {\n\t\tfmt.Scan(&blues[i].x, &blues[i].y)\n\t}\n\tsort.Sort(blues)\n\n\tans := 0\n\tpaired := make([]bool, N)\n\tfor _, b := range blues {\n\t\tmax := -1\n\t\tpair := -1\n\t\tfor j, r := range reds {\n\t\t\tif r.x < b.x && r.y < b.y && max < r.y && !paired[j] {\n\t\t\t\tmax = r.y\n\t\t\t\tpair = j\n\t\t\t}\n\t\t}\n\t\tif pair != -1 {\n\t\t\tfmt.Println(b, reds[pair])\n\t\t\tpaired[pair] = true\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "language": "Go", "metadata": {"date": 1546111490, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03409.html", "problem_id": "p03409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03409/input.txt", "sample_output_relpath": "derived/input_output/data/p03409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03409/Go/s680408205.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s680408205", "user_id": "u802614675"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sat Dec 29 04:55:53 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype point struct {\n\tx, y int\n}\n\nfunc (p point) lessThan(q point) bool {\n\treturn p.x < q.x && p.y < q.y\n}\n\ntype points []point\n\n// (p points) ...\nfunc (p points) Less(i, j int) bool {\n\tif p[i].x == p[j].x {\n\t\treturn p[i].y < p[j].y\n\t}\n\n\treturn p[i].x < p[j].x\n}\n\n// (p points)Len ...\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\n// (p points)Swap ...\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\nfunc main() {\n\tvar N int\n\n\tfmt.Scan(&N)\n\treds := make(points, N)\n\tfor i := range reds {\n\t\tfmt.Scan(&reds[i].x, &reds[i].y)\n\t}\n\tsort.Sort(reds)\n\n\tblues := make(points, N)\n\tfor i := range blues {\n\t\tfmt.Scan(&blues[i].x, &blues[i].y)\n\t}\n\tsort.Sort(blues)\n\n\tans := 0\n\tpaired := make([]bool, N)\n\tfor _, b := range blues {\n\t\tmax := -1\n\t\tpair := -1\n\t\tfor j, r := range reds {\n\t\t\tif r.x < b.x && r.y < b.y && max < r.y && !paired[j] {\n\t\t\t\tmax = r.y\n\t\t\t\tpair = j\n\t\t\t}\n\t\t}\n\t\tif pair != -1 {\n\t\t\tfmt.Println(b, reds[pair])\n\t\t\tpaired[pair] = true\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOn a two-dimensional plane, there are N red points and N blue points.\nThe coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i).\n\nA red point and a blue point can form a friendly pair when, the x-coordinate of the red point is smaller than that of the blue point, and the y-coordinate of the red point is also smaller than that of the blue point.\n\nAt most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq a_i, b_i, c_i, d_i < 2N\n\na_1, a_2, ..., a_N, c_1, c_2, ..., c_N are all different.\n\nb_1, b_2, ..., b_N, d_1, d_2, ..., d_N are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_N b_N\nc_1 d_1\nc_2 d_2\n:\nc_N d_N\n\nOutput\n\nPrint the maximum number of friendly pairs.\n\nSample Input 1\n\n3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n\nSample Output 1\n\n2\n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\nSample Input 2\n\n3\n0 0\n1 1\n5 2\n2 3\n3 4\n4 5\n\nSample Output 2\n\n2\n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\nSample Input 3\n\n2\n2 2\n3 3\n0 0\n1 1\n\nSample Output 3\n\n0\n\nIt is possible that no pair can be formed.\n\nSample Input 4\n\n5\n0 0\n7 3\n2 2\n4 8\n1 6\n8 5\n6 9\n5 4\n9 1\n3 7\n\nSample Output 4\n\n5\n\nSample Input 5\n\n5\n0 0\n1 1\n5 5\n6 6\n7 7\n2 2\n3 3\n4 4\n8 8\n9 9\n\nSample Output 5\n\n4", "sample_input": "3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03409", "source_text": "Score : 400 points\n\nProblem Statement\n\nOn a two-dimensional plane, there are N red points and N blue points.\nThe coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i).\n\nA red point and a blue point can form a friendly pair when, the x-coordinate of the red point is smaller than that of the blue point, and the y-coordinate of the red point is also smaller than that of the blue point.\n\nAt most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq a_i, b_i, c_i, d_i < 2N\n\na_1, a_2, ..., a_N, c_1, c_2, ..., c_N are all different.\n\nb_1, b_2, ..., b_N, d_1, d_2, ..., d_N are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\na_2 b_2\n:\na_N b_N\nc_1 d_1\nc_2 d_2\n:\nc_N d_N\n\nOutput\n\nPrint the maximum number of friendly pairs.\n\nSample Input 1\n\n3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n\nSample Output 1\n\n2\n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\nSample Input 2\n\n3\n0 0\n1 1\n5 2\n2 3\n3 4\n4 5\n\nSample Output 2\n\n2\n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\nSample Input 3\n\n2\n2 2\n3 3\n0 0\n1 1\n\nSample Output 3\n\n0\n\nIt is possible that no pair can be formed.\n\nSample Input 4\n\n5\n0 0\n7 3\n2 2\n4 8\n1 6\n8 5\n6 9\n5 4\n9 1\n3 7\n\nSample Output 4\n\n5\n\nSample Input 5\n\n5\n0 0\n1 1\n5 5\n6 6\n7 7\n2 2\n3 3\n4 4\n8 8\n9 9\n\nSample Output 5\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1140, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s001889525", "group_id": "codeNet:p03415", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c string\n\tfmt.Scan(&a, &b, &c)\n\n\tfmt.Println(a[0:1] + b[1:2] + c[2:3])\n}\n", "language": "Go", "metadata": {"date": 1559383179, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03415.html", "problem_id": "p03415", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03415/input.txt", "sample_output_relpath": "derived/input_output/data/p03415/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03415/Go/s001889525.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s001889525", "user_id": "u554269352"}, "prompt_components": {"gold_output": "abc\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c string\n\tfmt.Scan(&a, &b, &c)\n\n\tfmt.Println(a[0:1] + b[1:2] + c[2:3])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a 3×3 square grid, where each square contains a lowercase English letters.\nThe letter in the square at the i-th row from the top and j-th column from the left is c_{ij}.\n\nPrint the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nConstraints\n\nInput consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{11}c_{12}c_{13}\nc_{21}c_{22}c_{23}\nc_{31}c_{32}c_{33}\n\nOutput\n\nPrint the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nSample Input 1\n\nant\nobe\nrec\n\nSample Output 1\n\nabc\n\nThe letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.\n\nSample Input 2\n\nedu\ncat\nion\n\nSample Output 2\n\nean", "sample_input": "ant\nobe\nrec\n"}, "reference_outputs": ["abc\n"], "source_document_id": "p03415", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a 3×3 square grid, where each square contains a lowercase English letters.\nThe letter in the square at the i-th row from the top and j-th column from the left is c_{ij}.\n\nPrint the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nConstraints\n\nInput consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{11}c_{12}c_{13}\nc_{21}c_{22}c_{23}\nc_{31}c_{32}c_{33}\n\nOutput\n\nPrint the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.\n\nSample Input 1\n\nant\nobe\nrec\n\nSample Output 1\n\nabc\n\nThe letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.\n\nSample Input 2\n\nedu\ncat\nion\n\nSample Output 2\n\nean", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 126, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s254961517", "group_id": "codeNet:p03416", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tcount := 0\n\tfor i := a; i <= b; i++ {\n\t\ts := i % 10\n\t\tt := i / 10 % 10\n\t\tu := i / 1000 % 10\n\t\tv := i / 10000 % 10\n\t\tif s == v && t == u {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1556037724, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03416.html", "problem_id": "p03416", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03416/input.txt", "sample_output_relpath": "derived/input_output/data/p03416/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03416/Go/s254961517.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s254961517", "user_id": "u102310764"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tcount := 0\n\tfor i := a; i <= b; i++ {\n\t\ts := i % 10\n\t\tt := i / 10 % 10\n\t\tu := i / 1000 % 10\n\t\tv := i / 10000 % 10\n\t\tif s == v && t == u {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "sample_input": "11009 11332\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03416", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 259, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s249018617", "group_id": "codeNet:p03416", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype line struct {\n\tstart int\n\tend int\n}\n\nfunc main() {\n\tvar n int\n\tn = 1\n\t// fmt.Scan(&n)\n\n\tlines := []line{}\n\tfor i := 0; i < n; i++ {\n\t\tl := line{}\n\t\tfmt.Scan(&l.start, &l.end)\n\t\tlines = append(lines, l)\n\t}\n\t// fmt.Println(lines)\n\n\ttest := func(lines []line) int {\n\t\tc := 0\n\t\tfor _, l := range lines {\n\t\t\tfor i := l.start; i <= l.end; i++ {\n\t\t\t\ts := strconv.Itoa(i)\n\t\t\t\tif len(s) < 2 {\n\t\t\t\t\tc++\n\t\t\t\t} else {\n\t\t\t\t\ta := len(s) / 2\n\t\t\t\t\tb := len(s) % 2\n\t\t\t\t\tfirst := s[:a]\n\t\t\t\t\tlast := \"\"\n\n\t\t\t\t\tfor _, c := range s[a+b:] {\n\t\t\t\t\t\tlast = string(c) + last\n\t\t\t\t\t}\n\n\t\t\t\t\tif first == last {\n\t\t\t\t\t\tc++\n\t\t\t\t\t\tfmt.Println(s)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn c\n\t}\n\n\tfmt.Println(test(lines))\n}\n", "language": "Go", "metadata": {"date": 1542501718, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03416.html", "problem_id": "p03416", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03416/input.txt", "sample_output_relpath": "derived/input_output/data/p03416/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03416/Go/s249018617.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s249018617", "user_id": "u064827461"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype line struct {\n\tstart int\n\tend int\n}\n\nfunc main() {\n\tvar n int\n\tn = 1\n\t// fmt.Scan(&n)\n\n\tlines := []line{}\n\tfor i := 0; i < n; i++ {\n\t\tl := line{}\n\t\tfmt.Scan(&l.start, &l.end)\n\t\tlines = append(lines, l)\n\t}\n\t// fmt.Println(lines)\n\n\ttest := func(lines []line) int {\n\t\tc := 0\n\t\tfor _, l := range lines {\n\t\t\tfor i := l.start; i <= l.end; i++ {\n\t\t\t\ts := strconv.Itoa(i)\n\t\t\t\tif len(s) < 2 {\n\t\t\t\t\tc++\n\t\t\t\t} else {\n\t\t\t\t\ta := len(s) / 2\n\t\t\t\t\tb := len(s) % 2\n\t\t\t\t\tfirst := s[:a]\n\t\t\t\t\tlast := \"\"\n\n\t\t\t\t\tfor _, c := range s[a+b:] {\n\t\t\t\t\t\tlast = string(c) + last\n\t\t\t\t\t}\n\n\t\t\t\t\tif first == last {\n\t\t\t\t\t\tc++\n\t\t\t\t\t\tfmt.Println(s)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn c\n\t}\n\n\tfmt.Println(test(lines))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "sample_input": "11009 11332\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03416", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.\n\nConstraints\n\n10000 \\leq A \\leq B \\leq 99999\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the number of palindromic numbers among the integers between A and B (inclusive).\n\nSample Input 1\n\n11009 11332\n\nSample Output 1\n\n4\n\nThere are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.\n\nSample Input 2\n\n31415 92653\n\nSample Output 2\n\n612", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 727, "cpu_time_ms": 24, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s088522061", "group_id": "codeNet:p03417", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn, m := getInt(), getInt()\n\n\tans := (n - 2) * (m - 2)\n\tif n == 1 || m == 1 {\n\t\tif n == m {\n\t\t\tans = 1\n\t\t} else {\n\t\t\tans = max(n, m) - 2\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// -----------------------------------------\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tis := make([]int, n)\n\tfor i := range is {\n\t\tis[i] = getInt()\n\t}\n\treturn is\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1572529141, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03417.html", "problem_id": "p03417", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03417/input.txt", "sample_output_relpath": "derived/input_output/data/p03417/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03417/Go/s088522061.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s088522061", "user_id": "u543933043"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn, m := getInt(), getInt()\n\n\tans := (n - 2) * (m - 2)\n\tif n == 1 || m == 1 {\n\t\tif n == m {\n\t\t\tans = 1\n\t\t} else {\n\t\t\tans = max(n, m) - 2\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// -----------------------------------------\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tis := make([]int, n)\n\tfor i := range is {\n\t\tis[i] = getInt()\n\t}\n\treturn is\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "sample_input": "2 2\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03417", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 839, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s860389816", "group_id": "codeNet:p03418", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var N,K int\n fmt.Scan(&N,&K)\n //K以上のbに対して、あまりがK以上になるaがいくつあるか\n //c := N/b cb <= N < (c+1)b\n //c(b-K) + (N-cb)-K if N-cb >= K else 0\n result := 0\n for b := K+1; b<=N; b++{\n c := N/b\n d := 0\n\n if (N - c*b) >= K && K==0{\n d = (N- c*b) - K\n }else if (N - c*b) >= K{\n d = (N- c*b) -K +1\n }else{\n d = 0\n }\n // fmt.Println(b,c,d, c*(b-K) + d)\n result += c*(b-K) + d\n }\n fmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1577854703, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03418.html", "problem_id": "p03418", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03418/input.txt", "sample_output_relpath": "derived/input_output/data/p03418/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03418/Go/s860389816.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s860389816", "user_id": "u796789068"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var N,K int\n fmt.Scan(&N,&K)\n //K以上のbに対して、あまりがK以上になるaがいくつあるか\n //c := N/b cb <= N < (c+1)b\n //c(b-K) + (N-cb)-K if N-cb >= K else 0\n result := 0\n for b := K+1; b<=N; b++{\n c := N/b\n d := 0\n\n if (N - c*b) >= K && K==0{\n d = (N- c*b) - K\n }else if (N - c*b) >= K{\n d = (N- c*b) -K +1\n }else{\n d = 0\n }\n // fmt.Println(b,c,d, c*(b-K) + d)\n result += c*(b-K) + d\n }\n fmt.Println(result)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten.\nHe remembers that the remainder of a divided by b was greater than or equal to K.\nFind the number of possible pairs that he may have had.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K \\leq N-1\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible pairs that he may have had.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n7\n\nThere are seven possible pairs: (2,3),(5,3),(2,4),(3,4),(2,5),(3,5) and (4,5).\n\nSample Input 2\n\n10 0\n\nSample Output 2\n\n100\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n287927211", "sample_input": "5 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03418", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten.\nHe remembers that the remainder of a divided by b was greater than or equal to K.\nFind the number of possible pairs that he may have had.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K \\leq N-1\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible pairs that he may have had.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n7\n\nThere are seven possible pairs: (2,3),(5,3),(2,4),(3,4),(2,5),(3,5) and (4,5).\n\nSample Input 2\n\n10 0\n\nSample Output 2\n\n100\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n287927211", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 522, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s135904358", "group_id": "codeNet:p03419", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int \n fmt.Scan(&a, &b) \n if a == 1 { \n if b == 1 { \n fmt.Println(0)\n } else {\n fmt.Println(b - 2)\n } \n } else if b == 1 { \n fmt.Println(a - 2)\n } else {\n fmt.Println((a - 2) * (b - 2)) \n } \n}\n", "language": "Go", "metadata": {"date": 1551141263, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03419.html", "problem_id": "p03419", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03419/input.txt", "sample_output_relpath": "derived/input_output/data/p03419/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03419/Go/s135904358.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s135904358", "user_id": "u282164747"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int \n fmt.Scan(&a, &b) \n if a == 1 { \n if b == 1 { \n fmt.Println(0)\n } else {\n fmt.Println(b - 2)\n } \n } else if b == 1 { \n fmt.Println(a - 2)\n } else {\n fmt.Println((a - 2) * (b - 2)) \n } \n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "sample_input": "2 2\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03419", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region.\nThe front and back sides of these cards can be distinguished, and initially every card faces up.\n\nWe will perform the following operation once for each square contains a card:\n\nFor each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.\n\nIt can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed.\nFind the number of cards that face down after all the operations.\n\nConstraints\n\n1 \\leq N,M \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of cards that face down after all the operations.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n0\n\nWe will flip every card in any of the four operations. Thus, after all the operations, all cards face up.\n\nSample Input 2\n\n1 7\n\nSample Output 2\n\n5\n\nAfter all the operations, all cards except at both ends face down.\n\nSample Input 3\n\n314 1592\n\nSample Output 3\n\n496080", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 331, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s617854104", "group_id": "codeNet:p03420", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc solve(N, K int) int {\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\tif i >= K {\n\t\t\tans += N / i * (i - K)\n\t\t\tans += max(0, N%i-K+1)\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, K := getInt(), getInt()\n\n\tif K == 0 {\n\t\tout(N * N)\n\t\treturn\n\t}\n\tout(solve(N, K))\n}\n", "language": "Go", "metadata": {"date": 1586573052, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03420.html", "problem_id": "p03420", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03420/input.txt", "sample_output_relpath": "derived/input_output/data/p03420/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03420/Go/s617854104.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s617854104", "user_id": "u814575783"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc solve(N, K int) int {\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\tif i >= K {\n\t\t\tans += N / i * (i - K)\n\t\t\tans += max(0, N%i-K+1)\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, K := getInt(), getInt()\n\n\tif K == 0 {\n\t\tout(N * N)\n\t\treturn\n\t}\n\tout(solve(N, K))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten.\nHe remembers that the remainder of a divided by b was greater than or equal to K.\nFind the number of possible pairs that he may have had.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K \\leq N-1\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible pairs that he may have had.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n7\n\nThere are seven possible pairs: (2,3),(5,3),(2,4),(3,4),(2,5),(3,5) and (4,5).\n\nSample Input 2\n\n10 0\n\nSample Output 2\n\n100\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n287927211", "sample_input": "5 2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03420", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten.\nHe remembers that the remainder of a divided by b was greater than or equal to K.\nFind the number of possible pairs that he may have had.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K \\leq N-1\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible pairs that he may have had.\n\nSample Input 1\n\n5 2\n\nSample Output 1\n\n7\n\nThere are seven possible pairs: (2,3),(5,3),(2,4),(3,4),(2,5),(3,5) and (4,5).\n\nSample Input 2\n\n10 0\n\nSample Output 2\n\n100\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n287927211", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 897, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s393011693", "group_id": "codeNet:p03421", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\n\tif a+b > n+1 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tif a*b > n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tans := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tans[i] = n - i\n\t}\n\n\tfor i := 0; i < n; i += a {\n\t\tsort.Ints(ans[i : i+a])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprint(writer, ans[i])\n\t\tif i < n-1 {\n\t\t\tfmt.Fprint(writer, \" \")\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintln(writer, \"\")\n\t}\n\twriter.Flush()\n}\n\nfunc minint(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1575407754, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03421.html", "problem_id": "p03421", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03421/input.txt", "sample_output_relpath": "derived/input_output/data/p03421/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03421/Go/s393011693.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s393011693", "user_id": "u150542210"}, "prompt_components": {"gold_output": "2 4 1 5 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\n\tif a+b > n+1 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tif a*b > n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tans := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tans[i] = n - i\n\t}\n\n\tfor i := 0; i < n; i += a {\n\t\tsort.Ints(ans[i : i+a])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprint(writer, ans[i])\n\t\tif i < n-1 {\n\t\t\tfmt.Fprint(writer, \" \")\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintln(writer, \"\")\n\t}\n\twriter.Flush()\n}\n\nfunc minint(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nDetermine if there exists a sequence obtained by permuting 1,2,...,N that satisfies the following conditions:\n\nThe length of its longest increasing subsequence is A.\n\nThe length of its longest decreasing subsequence is B.\n\nIf it exists, construct one such sequence.\n\nNotes\n\nA subsequence of a sequence P is a sequence that can be obtained by extracting some of the elements in P without changing the order.\n\nA longest increasing subsequence of a sequence P is a sequence with the maximum length among the subsequences of P that are monotonically increasing.\n\nSimilarly, a longest decreasing subsequence of a sequence P is a sequence with the maximum length among the subsequences of P that are monotonically decreasing.\n\nConstraints\n\n1 \\leq N,A,B \\leq 3\\times 10^5\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nIf there are no sequences that satisfy the conditions, print -1.\n\nOtherwise, print N integers. The i-th integer should be the i-th element of the sequence that you constructed.\n\nSample Input 1\n\n5 3 2\n\nSample Output 1\n\n2 4 1 5 3\n\nOne longest increasing subsequence of this sequence is {2,4,5}, and one longest decreasing subsequence of it is {4,3}.\n\nSample Input 2\n\n7 7 1\n\nSample Output 2\n\n1 2 3 4 5 6 7\n\nSample Input 3\n\n300000 300000 300000\n\nSample Output 3\n\n-1", "sample_input": "5 3 2\n"}, "reference_outputs": ["2 4 1 5 3\n"], "source_document_id": "p03421", "source_text": "Score : 700 points\n\nProblem Statement\n\nDetermine if there exists a sequence obtained by permuting 1,2,...,N that satisfies the following conditions:\n\nThe length of its longest increasing subsequence is A.\n\nThe length of its longest decreasing subsequence is B.\n\nIf it exists, construct one such sequence.\n\nNotes\n\nA subsequence of a sequence P is a sequence that can be obtained by extracting some of the elements in P without changing the order.\n\nA longest increasing subsequence of a sequence P is a sequence with the maximum length among the subsequences of P that are monotonically increasing.\n\nSimilarly, a longest decreasing subsequence of a sequence P is a sequence with the maximum length among the subsequences of P that are monotonically decreasing.\n\nConstraints\n\n1 \\leq N,A,B \\leq 3\\times 10^5\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nIf there are no sequences that satisfy the conditions, print -1.\n\nOtherwise, print N integers. The i-th integer should be the i-th element of the sequence that you constructed.\n\nSample Input 1\n\n5 3 2\n\nSample Output 1\n\n2 4 1 5 3\n\nOne longest increasing subsequence of this sequence is {2,4,5}, and one longest decreasing subsequence of it is {4,3}.\n\nSample Input 2\n\n7 7 1\n\nSample Output 2\n\n1 2 3 4 5 6 7\n\nSample Input 3\n\n300000 300000 300000\n\nSample Output 3\n\n-1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1661, "cpu_time_ms": 124, "memory_kb": 6784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s567468318", "group_id": "codeNet:p03423", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tans := N / 3\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1560282857, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03423.html", "problem_id": "p03423", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03423/input.txt", "sample_output_relpath": "derived/input_output/data/p03423/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03423/Go/s567468318.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s567468318", "user_id": "u879870653"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tans := N / 3\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N students in a school.\n\nWe will divide these students into some groups, and in each group they will discuss some themes.\n\nYou think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible.\n\nDivide the students so that the number of groups consisting of three or more students is maximized.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf you can form at most x groups consisting of three or more students, print x.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nFor example, you can form a group of three students and another of five students.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0\n\nSometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.\n\nSample Input 3\n\n9\n\nSample Output 3\n\n3", "sample_input": "8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03423", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N students in a school.\n\nWe will divide these students into some groups, and in each group they will discuss some themes.\n\nYou think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible.\n\nDivide the students so that the number of groups consisting of three or more students is maximized.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf you can form at most x groups consisting of three or more students, print x.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nFor example, you can form a group of three students and another of five students.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0\n\nSometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.\n\nSample Input 3\n\n9\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 108, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s056905249", "group_id": "codeNet:p03423", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(n / 3)\n}\n", "language": "Go", "metadata": {"date": 1558725896, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03423.html", "problem_id": "p03423", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03423/input.txt", "sample_output_relpath": "derived/input_output/data/p03423/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03423/Go/s056905249.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s056905249", "user_id": "u543933043"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(n / 3)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N students in a school.\n\nWe will divide these students into some groups, and in each group they will discuss some themes.\n\nYou think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible.\n\nDivide the students so that the number of groups consisting of three or more students is maximized.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf you can form at most x groups consisting of three or more students, print x.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nFor example, you can form a group of three students and another of five students.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0\n\nSometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.\n\nSample Input 3\n\n9\n\nSample Output 3\n\n3", "sample_input": "8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03423", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N students in a school.\n\nWe will divide these students into some groups, and in each group they will discuss some themes.\n\nYou think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible.\n\nDivide the students so that the number of groups consisting of three or more students is maximized.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf you can form at most x groups consisting of three or more students, print x.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n2\n\nFor example, you can form a group of three students and another of five students.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0\n\nSometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.\n\nSample Input 3\n\n9\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 89, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s647227838", "group_id": "codeNet:p03424", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n// var dx = [...]int{0, 1, 0, -1, 1, -1, -1, 1}\n// var dy = [...]int{1, 0, -1, 0, 1, 1, -1, -1}\n// var inf int = 1e13\n\n// var mod = 1000000007\nvar next = newScanner()\n\n// ---------------------------------------------------------\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tN := next.Int()\n\tColor := map[string]int{}\n\tfor i := 0; i < N; i++ {\n\t\ts := next.String()\n\t\tColor[s]++\n\t}\n\tlog.Println(len(Color))\n\tif len(Color) == 3 {\n\t\tfmt.Println(\"Three\")\n\t} else {\n\t\tfmt.Println(\"Four\")\n\t}\n}\n\n// ---------------------------------------------------------\n\n// Pair is...\ntype Pair struct {\n\ta, b int\n}\n\n// Pairs is sorted by []Pair struct\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[i].b\n}\n\n// func (p Pairs) Less(i, j int) bool {\n// \tif p[i].a < p[j].a {\n// \t\treturn true\n// \t} else if p[i].a == p[j].a {\n// \t\treturn p[i].b < p[j].b\n// \t}\n// \treturn false\n// }\n\n// ------int method-------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\nfunc out(c, a, z int) bool {\n\treturn !in(c, a, z)\n}\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) int {\n\tr := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc pro(a []int) int {\n\tr := 1\n\tfor i := 0; i < len(a); i++ {\n\t\tr *= a[i]\n\t}\n\treturn r\n}\nfunc fill(a []int, n int) []int {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = n\n\t}\n\treturn a\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc ceil(a, b int) int {\n\tif a%b != 0 {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\n// ---------- buffered scanner -----------------------------------------\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\nfunc (s *scanner) Int() int {\n\tv, err := strconv.Atoi(s.next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Ints(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = s.Int()\n\t}\n\treturn r\n}\nfunc (s *scanner) Int64() int64 {\n\tv, err := strconv.ParseInt(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Uint64() uint64 {\n\tv, err := strconv.ParseUint(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Float64() float64 {\n\tv, err := strconv.ParseFloat(s.next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1520215582, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03424.html", "problem_id": "p03424", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03424/input.txt", "sample_output_relpath": "derived/input_output/data/p03424/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03424/Go/s647227838.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s647227838", "user_id": "u696272993"}, "prompt_components": {"gold_output": "Four\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n// var dx = [...]int{0, 1, 0, -1, 1, -1, -1, 1}\n// var dy = [...]int{1, 0, -1, 0, 1, 1, -1, -1}\n// var inf int = 1e13\n\n// var mod = 1000000007\nvar next = newScanner()\n\n// ---------------------------------------------------------\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tN := next.Int()\n\tColor := map[string]int{}\n\tfor i := 0; i < N; i++ {\n\t\ts := next.String()\n\t\tColor[s]++\n\t}\n\tlog.Println(len(Color))\n\tif len(Color) == 3 {\n\t\tfmt.Println(\"Three\")\n\t} else {\n\t\tfmt.Println(\"Four\")\n\t}\n}\n\n// ---------------------------------------------------------\n\n// Pair is...\ntype Pair struct {\n\ta, b int\n}\n\n// Pairs is sorted by []Pair struct\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[i].b\n}\n\n// func (p Pairs) Less(i, j int) bool {\n// \tif p[i].a < p[j].a {\n// \t\treturn true\n// \t} else if p[i].a == p[j].a {\n// \t\treturn p[i].b < p[j].b\n// \t}\n// \treturn false\n// }\n\n// ------int method-------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\nfunc out(c, a, z int) bool {\n\treturn !in(c, a, z)\n}\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) int {\n\tr := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc pro(a []int) int {\n\tr := 1\n\tfor i := 0; i < len(a); i++ {\n\t\tr *= a[i]\n\t}\n\treturn r\n}\nfunc fill(a []int, n int) []int {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = n\n\t}\n\treturn a\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc ceil(a, b int) int {\n\tif a%b != 0 {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\n// ---------- buffered scanner -----------------------------------------\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\nfunc (s *scanner) Int() int {\n\tv, err := strconv.Atoi(s.next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Ints(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = s.Int()\n\t}\n\treturn r\n}\nfunc (s *scanner) Int64() int64 {\n\tv, err := strconv.ParseInt(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Uint64() uint64 {\n\tv, err := strconv.ParseUint(s.next(), 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) Float64() float64 {\n\tv, err := strconv.ParseFloat(s.next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn Japan, people make offerings called hina arare, colorful crackers, on March 3.\n\nWe have a bag that contains N hina arare. (From here, we call them arare.)\n\nIt is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.\n\nWe have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: P, white: W, green: G, yellow: Y.\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS_i is P, W, G or Y.\n\nThere always exist i, j and k such that S_i=P, S_j=W and S_k=G.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_N\n\nOutput\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nSample Input 1\n\n6\nG W Y P Y W\n\nSample Output 1\n\nFour\n\nThe bag contained arare in four colors, so you should print Four.\n\nSample Input 2\n\n9\nG W W G P W P G G\n\nSample Output 2\n\nThree\n\nThe bag contained arare in three colors, so you should print Three.\n\nSample Input 3\n\n8\nP Y W G Y W Y Y\n\nSample Output 3\n\nFour", "sample_input": "6\nG W Y P Y W\n"}, "reference_outputs": ["Four\n"], "source_document_id": "p03424", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn Japan, people make offerings called hina arare, colorful crackers, on March 3.\n\nWe have a bag that contains N hina arare. (From here, we call them arare.)\n\nIt is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.\n\nWe have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: P, white: W, green: G, yellow: Y.\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS_i is P, W, G or Y.\n\nThere always exist i, j and k such that S_i=P, S_j=W and S_k=G.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_N\n\nOutput\n\nIf the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.\n\nSample Input 1\n\n6\nG W Y P Y W\n\nSample Output 1\n\nFour\n\nThe bag contained arare in four colors, so you should print Four.\n\nSample Input 2\n\n9\nG W W G P W P G G\n\nSample Output 2\n\nThree\n\nThe bag contained arare in three colors, so you should print Three.\n\nSample Input 3\n\n8\nP Y W G Y W Y Y\n\nSample Output 3\n\nFour", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3619, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s541714820", "group_id": "codeNet:p03425", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tp := problem{\n\t\tin: bufio.NewReader(os.Stdin),\n\t\tout: bufio.NewWriter(os.Stdout),\n\t}\n\tm := []string{\"M\", \"A\", \"R\", \"C\", \"H\"}\n\tN := p.NextInt()\n\tns := make([]int, 5)\n\tfor i := 0; i < N; i++ {\n\t\ts := string([]rune(p.Next())[0])\n\t\tfor k, v := range m {\n\t\t\tif s == v {\n\t\t\t\tns[k]++\n\t\t\t}\n\t\t}\n\t}\n\n\tres := 0\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := i + 1; j < 4; j++ {\n\t\t\tfor k := j + 1; k < 5; k++ {\n\t\t\t\tres += ns[i] * ns[k] * ns[j]\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n\n}\n\ntype problem struct {\n\tin *bufio.Reader\n\tout *bufio.Writer\n}\n\nfunc (p *problem) PrintInt(d int) {\n\tp.Printf(\"%d\", d)\n}\n\nfunc (p *problem) Printf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(p.out, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (p *problem) NextInt() int {\n\treturn stoi(p.Next())\n}\n\nfunc (p *problem) NextInts() []int {\n\tline := p.NextSSLine()\n\tds := make([]int, len(line))\n\tfor i, s := range line {\n\t\tds[i] = stoi(s)\n\t}\n\treturn ds\n}\n\nfunc (p *problem) NextSSLine() []string {\n\treturn strings.Split(p.Next(), \" \")\n}\n\n// Next reads line and return string.\nfunc (p *problem) Next() string {\n\tvar b []byte\n\tfor {\n\t\tl, pre, err := p.in.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tb = append(b, l...)\n\t\tif !pre {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(b)\n}\n\nfunc stoi(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tfmt.Println(i)\n\t\tfmt.Println(err)\n\t}\n\treturn i\n}", "language": "Go", "metadata": {"date": 1522114711, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03425.html", "problem_id": "p03425", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03425/input.txt", "sample_output_relpath": "derived/input_output/data/p03425/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03425/Go/s541714820.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s541714820", "user_id": "u914114463"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tp := problem{\n\t\tin: bufio.NewReader(os.Stdin),\n\t\tout: bufio.NewWriter(os.Stdout),\n\t}\n\tm := []string{\"M\", \"A\", \"R\", \"C\", \"H\"}\n\tN := p.NextInt()\n\tns := make([]int, 5)\n\tfor i := 0; i < N; i++ {\n\t\ts := string([]rune(p.Next())[0])\n\t\tfor k, v := range m {\n\t\t\tif s == v {\n\t\t\t\tns[k]++\n\t\t\t}\n\t\t}\n\t}\n\n\tres := 0\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := i + 1; j < 4; j++ {\n\t\t\tfor k := j + 1; k < 5; k++ {\n\t\t\t\tres += ns[i] * ns[k] * ns[j]\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n\n}\n\ntype problem struct {\n\tin *bufio.Reader\n\tout *bufio.Writer\n}\n\nfunc (p *problem) PrintInt(d int) {\n\tp.Printf(\"%d\", d)\n}\n\nfunc (p *problem) Printf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(p.out, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (p *problem) NextInt() int {\n\treturn stoi(p.Next())\n}\n\nfunc (p *problem) NextInts() []int {\n\tline := p.NextSSLine()\n\tds := make([]int, len(line))\n\tfor i, s := range line {\n\t\tds[i] = stoi(s)\n\t}\n\treturn ds\n}\n\nfunc (p *problem) NextSSLine() []string {\n\treturn strings.Split(p.Next(), \" \")\n}\n\n// Next reads line and return string.\nfunc (p *problem) Next() string {\n\tvar b []byte\n\tfor {\n\t\tl, pre, err := p.in.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tb = append(b, l...)\n\t\tif !pre {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(b)\n}\n\nfunc stoi(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tfmt.Println(i)\n\t\tfmt.Println(err)\n\t}\n\treturn i\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people. The name of the i-th person is S_i.\n\nWe would like to choose three people so that the following conditions are met:\n\nThe name of every chosen person begins with M, A, R, C or H.\n\nThere are no multiple people whose names begin with the same letter.\n\nHow many such ways are there to choose three people, disregarding order?\n\nNote that the answer may not fit into a 32-bit integer type.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i consists of uppercase English letters.\n\n1 \\leq |S_i| \\leq 10\n\nS_i \\neq S_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf there are x ways to choose three people so that the given conditions are met, print x.\n\nSample Input 1\n\n5\nMASHIKE\nRUMOI\nOBIRA\nHABORO\nHOROKANAI\n\nSample Output 1\n\n2\n\nWe can choose three people with the following names:\n\nMASHIKE, RUMOI, HABORO\n\nMASHIKE, RUMOI, HOROKANAI\n\nThus, we have two ways.\n\nSample Input 2\n\n4\nZZ\nZZZ\nZ\nZZZZZZZZZZ\n\nSample Output 2\n\n0\n\nNote that there may be no ways to choose three people so that the given conditions are met.\n\nSample Input 3\n\n5\nCHOKUDAI\nRNG\nMAKOTO\nAOKI\nRINGO\n\nSample Output 3\n\n7", "sample_input": "5\nMASHIKE\nRUMOI\nOBIRA\nHABORO\nHOROKANAI\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03425", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people. The name of the i-th person is S_i.\n\nWe would like to choose three people so that the following conditions are met:\n\nThe name of every chosen person begins with M, A, R, C or H.\n\nThere are no multiple people whose names begin with the same letter.\n\nHow many such ways are there to choose three people, disregarding order?\n\nNote that the answer may not fit into a 32-bit integer type.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i consists of uppercase English letters.\n\n1 \\leq |S_i| \\leq 10\n\nS_i \\neq S_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf there are x ways to choose three people so that the given conditions are met, print x.\n\nSample Input 1\n\n5\nMASHIKE\nRUMOI\nOBIRA\nHABORO\nHOROKANAI\n\nSample Output 1\n\n2\n\nWe can choose three people with the following names:\n\nMASHIKE, RUMOI, HABORO\n\nMASHIKE, RUMOI, HOROKANAI\n\nThus, we have two ways.\n\nSample Input 2\n\n4\nZZ\nZZZ\nZ\nZZZZZZZZZZ\n\nSample Output 2\n\n0\n\nNote that there may be no ways to choose three people so that the given conditions are met.\n\nSample Input 3\n\n5\nCHOKUDAI\nRNG\nMAKOTO\nAOKI\nRINGO\n\nSample Output 3\n\n7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1450, "cpu_time_ms": 32, "memory_kb": 2688}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s733341853", "group_id": "codeNet:p03427", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tnStr := read()\n\tnInt, _ := strconv.Atoi(nStr)\n\tif nInt < 10 {\n\t\tfmt.Println(nInt)\n\t\treturn\n\t}\n\tnSlice := strings.Split(nStr, \"\")\n\tif nSlice[0] != \"9\" {\n\t\tnInt += 10\n\t\tnStr = strconv.Itoa(nInt)\n\t}\n\tnSlice = strings.Split(nStr, \"\")\n\ttopStr := nSlice[0]\n\ttop, _ := strconv.Atoi(topStr)\n\ttop -= 1\n\tif top == 0 {\n\t\ttopStr = \"\"\n\t} else {\n\t\ttopStr = strconv.Itoa(top)\n\t}\n\tfor i := 0; i < len(nSlice)-1; i++ {\n\t\ttopStr += \"9\"\n\t}\n\toutput := strings.Split(topStr, \"\")\n\tsum := 0\n\tfmt.Println(output)\n\tfor _, valStr := range output {\n\t\tval, _ := strconv.Atoi(valStr)\n\t\tsum += val\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1519528284, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03427.html", "problem_id": "p03427", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03427/input.txt", "sample_output_relpath": "derived/input_output/data/p03427/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03427/Go/s733341853.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s733341853", "user_id": "u598491497"}, "prompt_components": {"gold_output": "18\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tnStr := read()\n\tnInt, _ := strconv.Atoi(nStr)\n\tif nInt < 10 {\n\t\tfmt.Println(nInt)\n\t\treturn\n\t}\n\tnSlice := strings.Split(nStr, \"\")\n\tif nSlice[0] != \"9\" {\n\t\tnInt += 10\n\t\tnStr = strconv.Itoa(nInt)\n\t}\n\tnSlice = strings.Split(nStr, \"\")\n\ttopStr := nSlice[0]\n\ttop, _ := strconv.Atoi(topStr)\n\ttop -= 1\n\tif top == 0 {\n\t\ttopStr = \"\"\n\t} else {\n\t\ttopStr = strconv.Itoa(top)\n\t}\n\tfor i := 0; i < len(nSlice)-1; i++ {\n\t\ttopStr += \"9\"\n\t}\n\toutput := strings.Split(topStr, \"\")\n\tsum := 0\n\tfmt.Println(output)\n\tfor _, valStr := range output {\n\t\tval, _ := strconv.Atoi(valStr)\n\t\tsum += val\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nConstraints\n\n1\\leq N \\leq 10^{16}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nSample Input 1\n\n100\n\nSample Output 1\n\n18\n\nFor example, the sum of the digits in 99 is 18, which turns out to be the maximum value.\n\nSample Input 2\n\n9995\n\nSample Output 2\n\n35\n\nFor example, the sum of the digits in 9989 is 35, which turns out to be the maximum value.\n\nSample Input 3\n\n3141592653589793\n\nSample Output 3\n\n137", "sample_input": "100\n"}, "reference_outputs": ["18\n"], "source_document_id": "p03427", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nConstraints\n\n1\\leq N \\leq 10^{16}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.\n\nSample Input 1\n\n100\n\nSample Output 1\n\n18\n\nFor example, the sum of the digits in 99 is 18, which turns out to be the maximum value.\n\nSample Input 2\n\n9995\n\nSample Output 2\n\n35\n\nFor example, the sum of the digits in 9989 is 35, which turns out to be the maximum value.\n\nSample Input 3\n\n3141592653589793\n\nSample Output 3\n\n137", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 766, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s705509140", "group_id": "codeNet:p03429", "input_text": "package main\n\nimport \"fmt\"\n\nvar N, M int\nvar A, B int\n\nfunc main() {\n\n\tfmt.Scanf(\"%d %d %d %d\", &N, &M, &A, &B)\n\n\tif N*M < A*2+B*2 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tm := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tm[i] = make([]int, M)\n\t}\n\n\tL0:\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif A == 0 {\n\t\t\t\tbreak L0\n\t\t\t}\n\t\t\tif m[i][j] == 0 {\n\t\t\t\tif j+1 < M {\n\t\t\t\t\tm[i][j] = 1\n\t\t\t\t\tm[i][j+1] = -1\n\t\t\t\t\tA--\n\t\t\t\t}\n\t\t\t\tif A > 0 && N - i == 2 {\n\t\t\t\t\tif j+1 < M {\n\t\t\t\t\t\tm[i+1][j] = 1\n\t\t\t\t\t\tm[i+1][j+1] = -1\n\t\t\t\t\t\tA--\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tj +=1\n\t\t}\n\t}\n\n\tL1:\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif B == 0 {\n\t\t\t\tbreak L1\n\t\t\t}\n\t\t\tif m[i][j] == 0 && i+1 < N && m[i+1][j] == 0 {\n\t\t\t\tm[i][j] = 2\n\t\t\t\tm[i+1][j] = -2\n\t\t\t\tB--\n\t\t\t}\n\t\t}\n\t}\n\n\tif A != 0 || B != 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t\tshow(m)\n\t}\n}\n\nfunc show(m [][]int) {\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < M; j++ {\n\t\t\tc := m[i][j]\n\t\t\tif c == 0 {\n\t\t\t\tfmt.Print(\".\")\n\t\t\t} else if c == 1 {\n\t\t\t\tfmt.Print(\"<\")\n\t\t\t} else if c == -1 {\n\t\t\t\tfmt.Print(\">\")\n\t\t\t} else if c == 2 {\n\t\t\t\tfmt.Print(\"^\")\n\t\t\t} else if c == -2 {\n\t\t\t\tfmt.Print(\"v\")\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1519584678, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03429.html", "problem_id": "p03429", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03429/input.txt", "sample_output_relpath": "derived/input_output/data/p03429/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03429/Go/s705509140.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s705509140", "user_id": "u434572230"}, "prompt_components": {"gold_output": "YES\n<><>\n^<>^\nv<>v\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar N, M int\nvar A, B int\n\nfunc main() {\n\n\tfmt.Scanf(\"%d %d %d %d\", &N, &M, &A, &B)\n\n\tif N*M < A*2+B*2 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tm := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tm[i] = make([]int, M)\n\t}\n\n\tL0:\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif A == 0 {\n\t\t\t\tbreak L0\n\t\t\t}\n\t\t\tif m[i][j] == 0 {\n\t\t\t\tif j+1 < M {\n\t\t\t\t\tm[i][j] = 1\n\t\t\t\t\tm[i][j+1] = -1\n\t\t\t\t\tA--\n\t\t\t\t}\n\t\t\t\tif A > 0 && N - i == 2 {\n\t\t\t\t\tif j+1 < M {\n\t\t\t\t\t\tm[i+1][j] = 1\n\t\t\t\t\t\tm[i+1][j+1] = -1\n\t\t\t\t\t\tA--\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tj +=1\n\t\t}\n\t}\n\n\tL1:\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif B == 0 {\n\t\t\t\tbreak L1\n\t\t\t}\n\t\t\tif m[i][j] == 0 && i+1 < N && m[i+1][j] == 0 {\n\t\t\t\tm[i][j] = 2\n\t\t\t\tm[i+1][j] = -2\n\t\t\t\tB--\n\t\t\t}\n\t\t}\n\t}\n\n\tif A != 0 || B != 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t\tshow(m)\n\t}\n}\n\nfunc show(m [][]int) {\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < M; j++ {\n\t\t\tc := m[i][j]\n\t\t\tif c == 0 {\n\t\t\t\tfmt.Print(\".\")\n\t\t\t} else if c == 1 {\n\t\t\t\tfmt.Print(\"<\")\n\t\t\t} else if c == -1 {\n\t\t\t\tfmt.Print(\">\")\n\t\t\t} else if c == 2 {\n\t\t\t\tfmt.Print(\"^\")\n\t\t\t} else if c == -2 {\n\t\t\t\tfmt.Print(\"v\")\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "problem_context": "Score : 900 points\n\nProblem Statement\n\nTakahashi has an N \\times M grid, with N horizontal rows and M vertical columns.\nDetermine if we can place A 1 \\times 2 tiles (1 vertical, 2 horizontal) and B 2 \\times 1 tiles (2 vertical, 1 horizontal) satisfying the following conditions, and construct one arrangement of the tiles if it is possible:\n\nAll the tiles must be placed on the grid.\n\nTiles must not stick out of the grid, and no two different tiles may intersect.\n\nNeither the grid nor the tiles may be rotated.\n\nEvery tile completely covers exactly two squares.\n\nConstraints\n\n1 \\leq N,M \\leq 1000\n\n0 \\leq A,B \\leq 500000\n\nN, M, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M A B\n\nOutput\n\nIf it is impossible to place all the tiles, print NO.\nOtherwise, print the following:\n\nYES\nc_{11}...c_{1M}\n:\nc_{N1}...c_{NM}\n\nHere, c_{ij} must be one of the following characters: ., <, >, ^ and v. Represent an arrangement by using each of these characters as follows:\n\nWhen c_{ij} is ., it indicates that the square at the i-th row and j-th column is empty;\n\nWhen c_{ij} is <, it indicates that the square at the i-th row and j-th column is covered by the left half of a 1 \\times 2 tile;\n\nWhen c_{ij} is >, it indicates that the square at the i-th row and j-th column is covered by the right half of a 1 \\times 2 tile;\n\nWhen c_{ij} is ^, it indicates that the square at the i-th row and j-th column is covered by the top half of a 2 \\times 1 tile;\n\nWhen c_{ij} is v, it indicates that the square at the i-th row and j-th column is covered by the bottom half of a 2 \\times 1 tile.\n\nSample Input 1\n\n3 4 4 2\n\nSample Output 1\n\nYES\n<><>\n^<>^\nv<>v\n\nThis is one example of a way to place four 1 \\times 2 tiles and three 2 \\times 1 tiles on a 3 \\times 4 grid.\n\nSample Input 2\n\n4 5 5 3\n\nSample Output 2\n\nYES\n<>..^\n^.<>v\nv<>.^\n<><>v\n\nSample Input 3\n\n7 9 20 20\n\nSample Output 3\n\nNO", "sample_input": "3 4 4 2\n"}, "reference_outputs": ["YES\n<><>\n^<>^\nv<>v\n"], "source_document_id": "p03429", "source_text": "Score : 900 points\n\nProblem Statement\n\nTakahashi has an N \\times M grid, with N horizontal rows and M vertical columns.\nDetermine if we can place A 1 \\times 2 tiles (1 vertical, 2 horizontal) and B 2 \\times 1 tiles (2 vertical, 1 horizontal) satisfying the following conditions, and construct one arrangement of the tiles if it is possible:\n\nAll the tiles must be placed on the grid.\n\nTiles must not stick out of the grid, and no two different tiles may intersect.\n\nNeither the grid nor the tiles may be rotated.\n\nEvery tile completely covers exactly two squares.\n\nConstraints\n\n1 \\leq N,M \\leq 1000\n\n0 \\leq A,B \\leq 500000\n\nN, M, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M A B\n\nOutput\n\nIf it is impossible to place all the tiles, print NO.\nOtherwise, print the following:\n\nYES\nc_{11}...c_{1M}\n:\nc_{N1}...c_{NM}\n\nHere, c_{ij} must be one of the following characters: ., <, >, ^ and v. Represent an arrangement by using each of these characters as follows:\n\nWhen c_{ij} is ., it indicates that the square at the i-th row and j-th column is empty;\n\nWhen c_{ij} is <, it indicates that the square at the i-th row and j-th column is covered by the left half of a 1 \\times 2 tile;\n\nWhen c_{ij} is >, it indicates that the square at the i-th row and j-th column is covered by the right half of a 1 \\times 2 tile;\n\nWhen c_{ij} is ^, it indicates that the square at the i-th row and j-th column is covered by the top half of a 2 \\times 1 tile;\n\nWhen c_{ij} is v, it indicates that the square at the i-th row and j-th column is covered by the bottom half of a 2 \\times 1 tile.\n\nSample Input 1\n\n3 4 4 2\n\nSample Output 1\n\nYES\n<><>\n^<>^\nv<>v\n\nThis is one example of a way to place four 1 \\times 2 tiles and three 2 \\times 1 tiles on a 3 \\times 4 grid.\n\nSample Input 2\n\n4 5 5 3\n\nSample Output 2\n\nYES\n<>..^\n^.<>v\nv<>.^\n<><>v\n\nSample Input 3\n\n7 9 20 20\n\nSample Output 3\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1168, "cpu_time_ms": 2082, "memory_kb": 20100}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s775205014", "group_id": "codeNet:p03433", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a int\n\tfmt.Scan(&n, &a)\n\n\tif n%500 <= a {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584742537, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03433.html", "problem_id": "p03433", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03433/input.txt", "sample_output_relpath": "derived/input_output/data/p03433/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03433/Go/s775205014.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s775205014", "user_id": "u367908963"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a int\n\tfmt.Scan(&n, &a)\n\n\tif n%500 <= a {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using only these coins.\n\nConstraints\n\nN is an integer between 1 and 10000 (inclusive).\n\nA is an integer between 0 and 1000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutput\n\nIf E869120 can pay exactly N yen using only his 1-yen and 500-yen coins, print Yes; otherwise, print No.\n\nSample Input 1\n\n2018\n218\n\nSample Output 1\n\nYes\n\nWe can pay 2018 yen with four 500-yen coins and 18 1-yen coins, so the answer is Yes.\n\nSample Input 2\n\n2763\n0\n\nSample Output 2\n\nNo\n\nWhen we have no 1-yen coins, we can only pay a multiple of 500 yen using only 500-yen coins. Since 2763 is not a multiple of 500, we cannot pay this amount.\n\nSample Input 3\n\n37\n514\n\nSample Output 3\n\nYes", "sample_input": "2018\n218\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03433", "source_text": "Score: 100 points\n\nProblem Statement\n\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using only these coins.\n\nConstraints\n\nN is an integer between 1 and 10000 (inclusive).\n\nA is an integer between 0 and 1000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\n\nOutput\n\nIf E869120 can pay exactly N yen using only his 1-yen and 500-yen coins, print Yes; otherwise, print No.\n\nSample Input 1\n\n2018\n218\n\nSample Output 1\n\nYes\n\nWe can pay 2018 yen with four 500-yen coins and 18 1-yen coins, so the answer is Yes.\n\nSample Input 2\n\n2763\n0\n\nSample Output 2\n\nNo\n\nWhen we have no 1-yen coins, we can only pay a multiple of 500 yen using only 500-yen coins. Since 2763 is not a multiple of 500, we cannot pay this amount.\n\nSample Input 3\n\n37\n514\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 148, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s688832105", "group_id": "codeNet:p03434", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\n// Sort\ntype Val struct {\n\tid, num int\n}\ntype ByNum []Val\n\nfunc (a ByNum) Len() int { return len(a) }\nfunc (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }\nfunc (a ByNum) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\talice, bob := 0, 0\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tfor i, v := range A {\n\t\tif i%2 == 0 {\n\t\t\talice += v\n\t\t} else {\n\t\t\tbob += v\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, alice-bob)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1576462721, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03434.html", "problem_id": "p03434", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03434/input.txt", "sample_output_relpath": "derived/input_output/data/p03434/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03434/Go/s688832105.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688832105", "user_id": "u924691798"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\n// Sort\ntype Val struct {\n\tid, num int\n}\ntype ByNum []Val\n\nfunc (a ByNum) Len() int { return len(a) }\nfunc (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }\nfunc (a ByNum) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\talice, bob := 0, 0\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tfor i, v := range A {\n\t\tif i%2 == 0 {\n\t\t\talice += v\n\t\t} else {\n\t\t\tbob += v\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, alice-bob)\n\twtr.Flush()\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "sample_input": "2\n3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03434", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1876, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s591530946", "group_id": "codeNet:p03434", "input_text": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n int \n fmt.Scan(&n)\n as := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&as[i])\n } \n sort.Sort(sort.Reverse(sort.IntSlice(as)))\n var a, b int \n for i := range as {\n if i%2 == 0 { \n a += as[i]\n } else {\n b += as[i]\n } \n } \n fmt.Println(a - b)\n}\n", "language": "Go", "metadata": {"date": 1559006478, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03434.html", "problem_id": "p03434", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03434/input.txt", "sample_output_relpath": "derived/input_output/data/p03434/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03434/Go/s591530946.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s591530946", "user_id": "u282164747"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n int \n fmt.Scan(&n)\n as := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&as[i])\n } \n sort.Sort(sort.Reverse(sort.IntSlice(as)))\n var a, b int \n for i := range as {\n if i%2 == 0 { \n a += as[i]\n } else {\n b += as[i]\n } \n } \n fmt.Println(a - b)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "sample_input": "2\n3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03434", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 403, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s301026184", "group_id": "codeNet:p03434", "input_text": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main () {\n var a, n, x, an, ana int\n ni := []int{}\n fmt.Scan(&n)\n for i := 0 ; i < n ; i++ {\n fmt.Scan(&a)\n ni = append (ni, a)\n }\n sort.Sort(sort.IntSlice(ni))\n y := n - 1 \n for i := 0 ; i < n ; i ++ {\n z := y - i\n if x == 0 {\n an = an + ni[z]\n x += 1\n } else if x == 1 {\n x = 0\n ana = ana + ni[z]\n }\n }\n fmt.Println(an-ana)\n}\n", "language": "Go", "metadata": {"date": 1543458665, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03434.html", "problem_id": "p03434", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03434/input.txt", "sample_output_relpath": "derived/input_output/data/p03434/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03434/Go/s301026184.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s301026184", "user_id": "u545203108"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main () {\n var a, n, x, an, ana int\n ni := []int{}\n fmt.Scan(&n)\n for i := 0 ; i < n ; i++ {\n fmt.Scan(&a)\n ni = append (ni, a)\n }\n sort.Sort(sort.IntSlice(ni))\n y := n - 1 \n for i := 0 ; i < n ; i ++ {\n z := y - i\n if x == 0 {\n an = an + ni[z]\n x += 1\n } else if x == 1 {\n x = 0\n ana = ana + ni[z]\n }\n }\n fmt.Println(an-ana)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "sample_input": "2\n3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03434", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 642, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s385320886", "group_id": "codeNet:p03434", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, alice, bob int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i, _ := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tfor i, _ := range a {\n\t\tif i%2 == 0 {\n\t\t\talice += a[i]\n\t\t\tcontinue\n\t\t}\n\t\tbob += a[i]\n\t}\n\tfmt.Println(alice - bob)\n}\n", "language": "Go", "metadata": {"date": 1521505800, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03434.html", "problem_id": "p03434", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03434/input.txt", "sample_output_relpath": "derived/input_output/data/p03434/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03434/Go/s385320886.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s385320886", "user_id": "u429443682"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, alice, bob int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i, _ := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tfor i, _ := range a {\n\t\tif i%2 == 0 {\n\t\t\talice += a[i]\n\t\t\tcontinue\n\t\t}\n\t\tbob += a[i]\n\t}\n\tfmt.Println(alice - bob)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "sample_input": "2\n3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03434", "source_text": "Score: 200 points\n\nProblem Statement\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\na_i \\ (1 \\leq i \\leq N) is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 a_3 ... a_N\n\nOutput\n\nPrint Alice's score minus Bob's score when both players take the optimal strategy to maximize their scores.\n\nSample Input 1\n\n2\n3 1\n\nSample Output 1\n\n2\n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 - 1 = 2.\n\nSample Input 2\n\n3\n2 7 4\n\nSample Output 2\n\n5\n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4. Lastly, Alice will take the card with 2. The difference of their scores will be 7 - 4 + 2 = 5. The difference of their scores will be 3 - 1 = 2.\n\nSample Input 3\n\n4\n20 18 2 18\n\nSample Output 3\n\n18", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 317, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s721267274", "group_id": "codeNet:p03436", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Queue struct {\n\tarr [][]int\n}\n\nfunc NewQueue() *Queue {\n\treturn &Queue{\n\t\tarr: [][]int{},\n\t}\n}\n\nfunc (q *Queue) GetLength() int {\n\treturn len(q.arr)\n}\n\nfunc (q *Queue) Shift() []int {\n\tret := q.arr[0]\n\tq.arr = q.arr[1:]\n\treturn ret\n}\n\nfunc (q *Queue) Push(e []int) {\n\tq.arr = append(q.arr, e)\n}\n\ntype BFS struct {\n\ttarget [][]rune\n\th int\n\tw int\n\tqueue *Queue\n\tdistance [][]int\n}\n\nfunc NewBFS(target [][]rune, h int, w int) *BFS {\n\tdistance := make([][]int, h)\n\tfor i := 0; i < h; i++ {\n\t\tdistance[i] = make([]int, w)\n\t}\n\treturn &BFS{\n\t\ttarget: target,\n\t\th: h,\n\t\tw: w,\n\t\tqueue: NewQueue(),\n\t\tdistance: distance,\n\t}\n}\n\nfunc (bfs *BFS) check(a []int) bool {\n\tif a[0] < 0 || a[0] >= bfs.h || a[1] < 0 || a[1] >= bfs.w {\n\t\treturn false\n\t}\n\tif bfs.target[a[0]][a[1]] == '#' {\n\t\treturn false\n\t}\n\tif bfs.distance[a[0]][a[1]] > 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (bfs *BFS) GetDistance(s []int, g []int) int {\n\tbfs.queue.Push(s)\n\tbfs.distance[s[0]][s[1]] = 1\n\tfor {\n\t\tif bfs.queue.GetLength() == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tc := bfs.queue.Shift()\n\t\tif c[0] == g[0] && c[1] == g[1] {\n\t\t\tbreak\n\t\t}\n\n\t\ta1 := []int{c[0] - 1, c[1]}\n\t\ta2 := []int{c[0] + 1, c[1]}\n\t\ta3 := []int{c[0], c[1] - 1}\n\t\ta4 := []int{c[0], c[1] + 1}\n\t\td := bfs.distance[c[0]][c[1]]\n\t\tif bfs.check(a1) {\n\t\t\tbfs.distance[a1[0]][a1[1]] = d + 1\n\t\t\tbfs.queue.Push(a1)\n\t\t}\n\t\tif bfs.check(a2) {\n\t\t\tbfs.distance[a2[0]][a2[1]] = d + 1\n\t\t\tbfs.queue.Push(a2)\n\t\t}\n\t\tif bfs.check(a3) {\n\t\t\tbfs.distance[a3[0]][a3[1]] = d + 1\n\t\t\tbfs.queue.Push(a3)\n\t\t}\n\t\tif bfs.check(a4) {\n\t\t\tbfs.distance[a4[0]][a4[1]] = d + 1\n\t\t\tbfs.queue.Push(a4)\n\t\t}\n\t}\n\treturn bfs.distance[g[0]][g[1]]\n}\n\nfunc Solve(in io.Reader, out io.Writer) {\n\tscanner := bufio.NewScanner(in)\n\tscanner.Split(bufio.ScanLines)\n\n\tscanner.Scan()\n\thw := strings.Split(scanner.Text(), \" \")\n\th, _ := strconv.Atoi(hw[0])\n\tw, _ := strconv.Atoi(hw[1])\n\n\ts := make([][]rune, h)\n\tfor i := 0; i < h; i++ {\n\t\tscanner.Scan()\n\t\ts[i] = []rune(scanner.Text())\n\t}\n\n\tbfs := NewBFS(s, h, w)\n\td := bfs.GetDistance([]int{0, 0}, []int{h - 1, w - 1})\n\n\tans := -1\n\tif d > 0 {\n\t\tcnt := 0\n\t\tfor i := 0; i < h; i++ {\n\t\t\tfor j := 0; j < w; j++ {\n\t\t\t\tif s[i][j] == '.' {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans = cnt - d\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc main() {\n\tSolve(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1565387919, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03436.html", "problem_id": "p03436", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03436/input.txt", "sample_output_relpath": "derived/input_output/data/p03436/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03436/Go/s721267274.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s721267274", "user_id": "u752513456"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Queue struct {\n\tarr [][]int\n}\n\nfunc NewQueue() *Queue {\n\treturn &Queue{\n\t\tarr: [][]int{},\n\t}\n}\n\nfunc (q *Queue) GetLength() int {\n\treturn len(q.arr)\n}\n\nfunc (q *Queue) Shift() []int {\n\tret := q.arr[0]\n\tq.arr = q.arr[1:]\n\treturn ret\n}\n\nfunc (q *Queue) Push(e []int) {\n\tq.arr = append(q.arr, e)\n}\n\ntype BFS struct {\n\ttarget [][]rune\n\th int\n\tw int\n\tqueue *Queue\n\tdistance [][]int\n}\n\nfunc NewBFS(target [][]rune, h int, w int) *BFS {\n\tdistance := make([][]int, h)\n\tfor i := 0; i < h; i++ {\n\t\tdistance[i] = make([]int, w)\n\t}\n\treturn &BFS{\n\t\ttarget: target,\n\t\th: h,\n\t\tw: w,\n\t\tqueue: NewQueue(),\n\t\tdistance: distance,\n\t}\n}\n\nfunc (bfs *BFS) check(a []int) bool {\n\tif a[0] < 0 || a[0] >= bfs.h || a[1] < 0 || a[1] >= bfs.w {\n\t\treturn false\n\t}\n\tif bfs.target[a[0]][a[1]] == '#' {\n\t\treturn false\n\t}\n\tif bfs.distance[a[0]][a[1]] > 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (bfs *BFS) GetDistance(s []int, g []int) int {\n\tbfs.queue.Push(s)\n\tbfs.distance[s[0]][s[1]] = 1\n\tfor {\n\t\tif bfs.queue.GetLength() == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tc := bfs.queue.Shift()\n\t\tif c[0] == g[0] && c[1] == g[1] {\n\t\t\tbreak\n\t\t}\n\n\t\ta1 := []int{c[0] - 1, c[1]}\n\t\ta2 := []int{c[0] + 1, c[1]}\n\t\ta3 := []int{c[0], c[1] - 1}\n\t\ta4 := []int{c[0], c[1] + 1}\n\t\td := bfs.distance[c[0]][c[1]]\n\t\tif bfs.check(a1) {\n\t\t\tbfs.distance[a1[0]][a1[1]] = d + 1\n\t\t\tbfs.queue.Push(a1)\n\t\t}\n\t\tif bfs.check(a2) {\n\t\t\tbfs.distance[a2[0]][a2[1]] = d + 1\n\t\t\tbfs.queue.Push(a2)\n\t\t}\n\t\tif bfs.check(a3) {\n\t\t\tbfs.distance[a3[0]][a3[1]] = d + 1\n\t\t\tbfs.queue.Push(a3)\n\t\t}\n\t\tif bfs.check(a4) {\n\t\t\tbfs.distance[a4[0]][a4[1]] = d + 1\n\t\t\tbfs.queue.Push(a4)\n\t\t}\n\t}\n\treturn bfs.distance[g[0]][g[1]]\n}\n\nfunc Solve(in io.Reader, out io.Writer) {\n\tscanner := bufio.NewScanner(in)\n\tscanner.Split(bufio.ScanLines)\n\n\tscanner.Scan()\n\thw := strings.Split(scanner.Text(), \" \")\n\th, _ := strconv.Atoi(hw[0])\n\tw, _ := strconv.Atoi(hw[1])\n\n\ts := make([][]rune, h)\n\tfor i := 0; i < h; i++ {\n\t\tscanner.Scan()\n\t\ts[i] = []rune(scanner.Text())\n\t}\n\n\tbfs := NewBFS(s, h, w)\n\td := bfs.GetDistance([]int{0, 0}, []int{h - 1, w - 1})\n\n\tans := -1\n\tif d > 0 {\n\t\tcnt := 0\n\t\tfor i := 0; i < h; i++ {\n\t\t\tfor j := 0; j < w; j++ {\n\t\t\t\tif s[i][j] == '.' {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans = cnt - d\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc main() {\n\tSolve(os.Stdin, os.Stdout)\n}\n", "problem_context": "Score: 400 points\n\nProblem statement\n\nWe have an H \\times W grid whose squares are painted black or white. The square at the i-th row from the top and the j-th column from the left is denoted as (i, j).\n\nSnuke would like to play the following game on this grid. At the beginning of the game, there is a character called Kenus at square (1, 1). The player repeatedly moves Kenus up, down, left or right by one square. The game is completed when Kenus reaches square (H, W) passing only white squares.\n\nBefore Snuke starts the game, he can change the color of some of the white squares to black. However, he cannot change the color of square (1, 1) and (H, W). Also, changes of color must all be carried out before the beginning of the game.\n\nWhen the game is completed, Snuke's score will be the number of times he changed the color of a square before the beginning of the game. Find the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed, that is, Kenus can never reach square (H, W) regardless of how Snuke changes the color of the squares.\n\nThe color of the squares are given to you as characters s_{i, j}. If square (i, j) is initially painted by white, s_{i, j} is .; if square (i, j) is initially painted by black, s_{i, j} is #.\n\nConstraints\n\nH is an integer between 2 and 50 (inclusive).\n\nW is an integer between 2 and 50 (inclusive).\n\ns_{i, j} is . or # (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\ns_{1, 1} and s_{H, W} are ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1}s_{1, 2}s_{1, 3} ... s_{1, W}\ns_{2, 1}s_{2, 2}s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1}s_{H, 2}s_{H, 3} ... s_{H, W}\n\nOutput\n\nPrint the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed.\n\nSample Input 1\n\n3 3\n..#\n#..\n...\n\nSample Output 1\n\n2\n\nThe score 2 can be achieved by changing the color of squares as follows:\n\nSample Input 2\n\n10 37\n.....................................\n...#...####...####..###...###...###..\n..#.#..#...#.##....#...#.#...#.#...#.\n..#.#..#...#.#.....#...#.#...#.#...#.\n.#...#.#..##.#.....#...#.#.###.#.###.\n.#####.####..#.....#...#..##....##...\n.#...#.#...#.#.....#...#.#...#.#...#.\n.#...#.#...#.##....#...#.#...#.#...#.\n.#...#.####...####..###...###...###..\n.....................................\n\nSample Output 2\n\n209", "sample_input": "3 3\n..#\n#..\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03436", "source_text": "Score: 400 points\n\nProblem statement\n\nWe have an H \\times W grid whose squares are painted black or white. The square at the i-th row from the top and the j-th column from the left is denoted as (i, j).\n\nSnuke would like to play the following game on this grid. At the beginning of the game, there is a character called Kenus at square (1, 1). The player repeatedly moves Kenus up, down, left or right by one square. The game is completed when Kenus reaches square (H, W) passing only white squares.\n\nBefore Snuke starts the game, he can change the color of some of the white squares to black. However, he cannot change the color of square (1, 1) and (H, W). Also, changes of color must all be carried out before the beginning of the game.\n\nWhen the game is completed, Snuke's score will be the number of times he changed the color of a square before the beginning of the game. Find the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed, that is, Kenus can never reach square (H, W) regardless of how Snuke changes the color of the squares.\n\nThe color of the squares are given to you as characters s_{i, j}. If square (i, j) is initially painted by white, s_{i, j} is .; if square (i, j) is initially painted by black, s_{i, j} is #.\n\nConstraints\n\nH is an integer between 2 and 50 (inclusive).\n\nW is an integer between 2 and 50 (inclusive).\n\ns_{i, j} is . or # (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\ns_{1, 1} and s_{H, W} are ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\ns_{1, 1}s_{1, 2}s_{1, 3} ... s_{1, W}\ns_{2, 1}s_{2, 2}s_{2, 3} ... s_{2, W}\n: :\ns_{H, 1}s_{H, 2}s_{H, 3} ... s_{H, W}\n\nOutput\n\nPrint the maximum possible score that Snuke can achieve, or print -1 if the game cannot be completed.\n\nSample Input 1\n\n3 3\n..#\n#..\n...\n\nSample Output 1\n\n2\n\nThe score 2 can be achieved by changing the color of squares as follows:\n\nSample Input 2\n\n10 37\n.....................................\n...#...####...####..###...###...###..\n..#.#..#...#.##....#...#.#...#.#...#.\n..#.#..#...#.#.....#...#.#...#.#...#.\n.#...#.#..##.#.....#...#.#.###.#.###.\n.#####.####..#.....#...#..##....##...\n.#...#.#...#.#.....#...#.#...#.#...#.\n.#...#.#...#.##....#...#.#...#.#...#.\n.#...#.####...####..###...###...###..\n.....................................\n\nSample Output 2\n\n209", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2376, "cpu_time_ms": 2, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s943230210", "group_id": "codeNet:p03440", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc rScan() []rune {\n\treturn []rune(Scan())\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc mod(x, d int) int {\n\tx %= d\n\tif x < 0 {\n\t\tx += d\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := -int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc bPrint(f bool, x string, y string) {\n\tif f {\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(y)\n\t}\n}\nfunc iSSPrint(x []int) {\n\tfmt.Println(strings.Trim(fmt.Sprint(x), \"[]\"))\n}\n\nvar lp1 int = 1000000007\nvar lp2 int = 998244353\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, lp1)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\tm := iScan()\n\ta := iSScan(n)\n\tuf := newUnionFind(n)\n\tfor i := 0; i < m; i++ {\n\t\tuf.unite(iScan(), iScan())\n\t}\n\tg := uf.groups()\n\tga := make([][]int, len(g))\n\tif len(ga) == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tans := 0\n\t\tfor i, v := range g {\n\t\t\tga[i] = make([]int, len(v))\n\t\t\tfor j, u := range v {\n\t\t\t\tga[i][j] = a[u]\n\t\t\t}\n\t\t\tsort.Ints(ga[i])\n\t\t\tans += ga[i][0]\n\t\t\tga[i] = ga[i][1:]\n\t\t}\n\t\te := len(ga) - 2\n\t\tx := make([]int, 0, n)\n\t\tfor _, v := range ga {\n\t\t\tfor _, u := range v {\n\t\t\t\tx = append(x, u)\n\t\t\t}\n\t\t}\n\t\tsort.Ints(x)\n\t\tif len(x) < e {\n\t\t\tfmt.Println(\"Impossible\")\n\t\t} else {\n\t\t\tans += sum(x[:e])\n\t\t\tfmt.Println(ans)\n\t\t}\n\t}\n}\n\ntype UnionFind struct {\n\tn int\n\tpar []int\n}\n\nfunc newUnionFind(n int) *UnionFind {\n\tuf := new(UnionFind)\n\tuf.n = n\n\tuf.par = make([]int, n)\n\tfor i, _ := range uf.par {\n\t\tuf.par[i] = -1\n\t}\n\treturn uf\n}\nfunc (uf UnionFind) root(x int) int {\n\tif uf.par[x] < 0 {\n\t\treturn x\n\t}\n\tuf.par[x] = uf.root(uf.par[x])\n\treturn uf.par[x]\n}\nfunc (uf UnionFind) unite(x, y int) {\n\trx, ry := uf.root(x), uf.root(y)\n\tif rx != ry {\n\t\tif uf.size(rx) > uf.size(ry) {\n\t\t\trx, ry = ry, rx\n\t\t}\n\t\tuf.par[ry] += uf.par[rx]\n\t\tuf.par[rx] = ry\n\t}\n}\nfunc (uf UnionFind) same(x, y int) bool {\n\treturn uf.root(x) == uf.root(y)\n}\nfunc (uf UnionFind) size(x int) int {\n\treturn -uf.par[uf.root(x)]\n}\nfunc (uf UnionFind) groups() [][]int {\n\trootBuf, groupSize := make([]int, uf.n), make([]int, uf.n)\n\tfor i := 0; i < uf.n; i++ {\n\t\trootBuf[i] = uf.root(i)\n\t\tgroupSize[rootBuf[i]]++\n\t}\n\tres := make([][]int, uf.n)\n\tfor i := 0; i < uf.n; i++ {\n\t\tres[i] = make([]int, 0, groupSize[i])\n\t}\n\tfor i := 0; i < uf.n; i++ {\n\t\tres[rootBuf[i]] = append(res[rootBuf[i]], i)\n\t}\n\tresult := make([][]int, 0, uf.n)\n\tfor i := 0; i < uf.n; i++ {\n\t\tif len(res[i]) != 0 {\n\t\t\tr := make([]int, len(res[i]))\n\t\t\tcopy(r, res[i])\n\t\t\tresult = append(result, r)\n\t\t}\n\t}\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1601329254, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03440.html", "problem_id": "p03440", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03440/input.txt", "sample_output_relpath": "derived/input_output/data/p03440/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03440/Go/s943230210.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s943230210", "user_id": "u843722521"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc rScan() []rune {\n\treturn []rune(Scan())\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc mod(x, d int) int {\n\tx %= d\n\tif x < 0 {\n\t\tx += d\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := -int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := int(1e+18)\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc fSum(a []float64) float64 {\n\tx := 0.\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\nfunc bPrint(f bool, x string, y string) {\n\tif f {\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(y)\n\t}\n}\nfunc iSSPrint(x []int) {\n\tfmt.Println(strings.Trim(fmt.Sprint(x), \"[]\"))\n}\n\nvar lp1 int = 1000000007\nvar lp2 int = 998244353\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, lp1)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\tm := iScan()\n\ta := iSScan(n)\n\tuf := newUnionFind(n)\n\tfor i := 0; i < m; i++ {\n\t\tuf.unite(iScan(), iScan())\n\t}\n\tg := uf.groups()\n\tga := make([][]int, len(g))\n\tif len(ga) == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tans := 0\n\t\tfor i, v := range g {\n\t\t\tga[i] = make([]int, len(v))\n\t\t\tfor j, u := range v {\n\t\t\t\tga[i][j] = a[u]\n\t\t\t}\n\t\t\tsort.Ints(ga[i])\n\t\t\tans += ga[i][0]\n\t\t\tga[i] = ga[i][1:]\n\t\t}\n\t\te := len(ga) - 2\n\t\tx := make([]int, 0, n)\n\t\tfor _, v := range ga {\n\t\t\tfor _, u := range v {\n\t\t\t\tx = append(x, u)\n\t\t\t}\n\t\t}\n\t\tsort.Ints(x)\n\t\tif len(x) < e {\n\t\t\tfmt.Println(\"Impossible\")\n\t\t} else {\n\t\t\tans += sum(x[:e])\n\t\t\tfmt.Println(ans)\n\t\t}\n\t}\n}\n\ntype UnionFind struct {\n\tn int\n\tpar []int\n}\n\nfunc newUnionFind(n int) *UnionFind {\n\tuf := new(UnionFind)\n\tuf.n = n\n\tuf.par = make([]int, n)\n\tfor i, _ := range uf.par {\n\t\tuf.par[i] = -1\n\t}\n\treturn uf\n}\nfunc (uf UnionFind) root(x int) int {\n\tif uf.par[x] < 0 {\n\t\treturn x\n\t}\n\tuf.par[x] = uf.root(uf.par[x])\n\treturn uf.par[x]\n}\nfunc (uf UnionFind) unite(x, y int) {\n\trx, ry := uf.root(x), uf.root(y)\n\tif rx != ry {\n\t\tif uf.size(rx) > uf.size(ry) {\n\t\t\trx, ry = ry, rx\n\t\t}\n\t\tuf.par[ry] += uf.par[rx]\n\t\tuf.par[rx] = ry\n\t}\n}\nfunc (uf UnionFind) same(x, y int) bool {\n\treturn uf.root(x) == uf.root(y)\n}\nfunc (uf UnionFind) size(x int) int {\n\treturn -uf.par[uf.root(x)]\n}\nfunc (uf UnionFind) groups() [][]int {\n\trootBuf, groupSize := make([]int, uf.n), make([]int, uf.n)\n\tfor i := 0; i < uf.n; i++ {\n\t\trootBuf[i] = uf.root(i)\n\t\tgroupSize[rootBuf[i]]++\n\t}\n\tres := make([][]int, uf.n)\n\tfor i := 0; i < uf.n; i++ {\n\t\tres[i] = make([]int, 0, groupSize[i])\n\t}\n\tfor i := 0; i < uf.n; i++ {\n\t\tres[rootBuf[i]] = append(res[rootBuf[i]], i)\n\t}\n\tresult := make([][]int, 0, uf.n)\n\tfor i := 0; i < uf.n; i++ {\n\t\tif len(res[i]) != 0 {\n\t\t\tr := make([]int, len(res[i]))\n\t\t\tcopy(r, res[i])\n\t\t\tresult = append(result, r)\n\t\t}\n\t}\n\treturn result\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given a forest with N vertices and M edges. The vertices are numbered 0 through N-1.\nThe edges are given in the format (x_i,y_i), which means that Vertex x_i and y_i are connected by an edge.\n\nEach vertex i has a value a_i.\nYou want to add edges in the given forest so that the forest becomes connected.\nTo add an edge, you choose two different vertices i and j, then span an edge between i and j.\nThis operation costs a_i + a_j dollars, and afterward neither Vertex i nor j can be selected again.\n\nFind the minimum total cost required to make the forest connected, or print Impossible if it is impossible.\n\nConstraints\n\n1 ≤ N ≤ 100,000\n\n0 ≤ M ≤ N-1\n\n1 ≤ a_i ≤ 10^9\n\n0 ≤ x_i,y_i ≤ N-1\n\nThe given graph is a forest.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 a_1 .. a_{N-1}\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the minimum total cost required to make the forest connected, or print Impossible if it is impossible.\n\nSample Input 1\n\n7 5\n1 2 3 4 5 6 7\n3 0\n4 0\n1 2\n1 3\n5 6\n\nSample Output 1\n\n7\n\nIf we connect vertices 0 and 5, the graph becomes connected, for the cost of 1 + 6 = 7 dollars.\n\nSample Input 2\n\n5 0\n3 1 4 1 5\n\nSample Output 2\n\nImpossible\n\nWe can't make the graph connected.\n\nSample Input 3\n\n1 0\n5\n\nSample Output 3\n\n0\n\nThe graph is already connected, so we do not need to add any edges.", "sample_input": "7 5\n1 2 3 4 5 6 7\n3 0\n4 0\n1 2\n1 3\n5 6\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03440", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given a forest with N vertices and M edges. The vertices are numbered 0 through N-1.\nThe edges are given in the format (x_i,y_i), which means that Vertex x_i and y_i are connected by an edge.\n\nEach vertex i has a value a_i.\nYou want to add edges in the given forest so that the forest becomes connected.\nTo add an edge, you choose two different vertices i and j, then span an edge between i and j.\nThis operation costs a_i + a_j dollars, and afterward neither Vertex i nor j can be selected again.\n\nFind the minimum total cost required to make the forest connected, or print Impossible if it is impossible.\n\nConstraints\n\n1 ≤ N ≤ 100,000\n\n0 ≤ M ≤ N-1\n\n1 ≤ a_i ≤ 10^9\n\n0 ≤ x_i,y_i ≤ N-1\n\nThe given graph is a forest.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 a_1 .. a_{N-1}\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the minimum total cost required to make the forest connected, or print Impossible if it is impossible.\n\nSample Input 1\n\n7 5\n1 2 3 4 5 6 7\n3 0\n4 0\n1 2\n1 3\n5 6\n\nSample Output 1\n\n7\n\nIf we connect vertices 0 and 5, the graph becomes connected, for the cost of 1 + 6 = 7 dollars.\n\nSample Input 2\n\n5 0\n3 1 4 1 5\n\nSample Output 2\n\nImpossible\n\nWe can't make the graph connected.\n\nSample Input 3\n\n1 0\n5\n\nSample Output 3\n\n0\n\nThe graph is already connected, so we do not need to add any edges.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3502, "cpu_time_ms": 83, "memory_kb": 18216}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s017858858", "group_id": "codeNet:p03456", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar wtr = bufio.NewWriter(os.Stdout)\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanLines)\n\tvar a, b, c int\n\tif scanner.Scan() {\n\t\tstr := scanner.Text()\n\t\tcols := strings.Split(str, \" \")\n\t\ta, _ = strconv.Atoi(cols[0])\n\t\tb, _ = strconv.Atoi(cols[1])\n\t\tc, _ = strconv.Atoi(cols[0] + cols[1])\n\t}\n\t_ = a\n\t_ = b\n\tmax := 100 * 100\n\tans := \"No\"\n\tfor i := 1; i < max; i++ {\n\t\tt := i * i\n\t\tif t == c {\n\t\t\tans = \"Yes\"\n\t\t\tbreak\n\t\t}\n\t\tif t > c {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\t_ = wtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1591755629, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03456.html", "problem_id": "p03456", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03456/input.txt", "sample_output_relpath": "derived/input_output/data/p03456/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03456/Go/s017858858.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s017858858", "user_id": "u002831011"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar wtr = bufio.NewWriter(os.Stdout)\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanLines)\n\tvar a, b, c int\n\tif scanner.Scan() {\n\t\tstr := scanner.Text()\n\t\tcols := strings.Split(str, \" \")\n\t\ta, _ = strconv.Atoi(cols[0])\n\t\tb, _ = strconv.Atoi(cols[1])\n\t\tc, _ = strconv.Atoi(cols[0] + cols[1])\n\t}\n\t_ = a\n\t_ = b\n\tmax := 100 * 100\n\tans := \"No\"\n\tfor i := 1; i < max; i++ {\n\t\tt := i * i\n\t\tif t == c {\n\t\t\tans = \"Yes\"\n\t\t\tbreak\n\t\t}\n\t\tif t > c {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\t_ = wtr.Flush()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer has found two positive integers, a and b.\nDetermine whether the concatenation of a and b in this order is a square number.\n\nConstraints\n\n1 ≤ a,b ≤ 100\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the concatenation of a and b in this order is a square number, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 21\n\nSample Output 1\n\nYes\n\nAs 121 = 11 × 11, it is a square number.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\nNo\n\n100100 is not a square number.\n\nSample Input 3\n\n12 10\n\nSample Output 3\n\nNo", "sample_input": "1 21\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03456", "source_text": "Score : 200 points\n\nProblem Statement\n\nAtCoDeer the deer has found two positive integers, a and b.\nDetermine whether the concatenation of a and b in this order is a square number.\n\nConstraints\n\n1 ≤ a,b ≤ 100\n\na and b are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the concatenation of a and b in this order is a square number, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 21\n\nSample Output 1\n\nYes\n\nAs 121 = 11 × 11, it is a square number.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\nNo\n\n100100 is not a square number.\n\nSample Input 3\n\n12 10\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 599, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s267726400", "group_id": "codeNet:p03457", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewReader(os.Stdin)\n)\n\ntype pos struct {\n\tt, x, y int\n}\n\nfunc main() {\n\tN := scanInt()\n\tc := &pos{t: 0, x: 0, y: 0}\n\tfor i := 0; i < N; i++ {\n\t\tn := &pos{t: scanInt(), x: scanInt(), y: scanInt()}\n\t\tif !rec(c, n) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tc = n\n\t}\n\tfmt.Println(\"Yes\")\n}\n\nfunc rec(c, n *pos) bool {\n\tif c.t == n.t {\n\t\tif c.x == n.x && c.y == n.y {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\t// x+1, y\n\tif rec(&pos{t: c.t + 1, x: c.x + 1, y: c.y}, n) {\n\t\treturn true\n\t}\n\t// x-1, y\n\tif rec(&pos{t: c.t + 1, x: c.x - 1, y: c.y}, n) {\n\t\treturn true\n\t}\n\t// x, y+1\n\tif rec(&pos{t: c.t + 1, x: c.x, y: c.y + 1}, n) {\n\t\treturn true\n\t}\n\t// x, y-1\n\tif rec(&pos{t: c.t + 1, x: c.x, y: c.y - 1}, n) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc scan(a ...interface{}) { _, err := fmt.Fscan(sc, a...); pnc(err) }\nfunc scanStr() (s string) { scan(&s); return }\nfunc scanInt() int { i, err := strconv.Atoi(scanStr()); pnc(err); return i }\nfunc scanFloat() float64 { f, err := strconv.ParseFloat(scanStr(), 64); pnc(err); return f }\nfunc pnc(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1597533157, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03457.html", "problem_id": "p03457", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03457/input.txt", "sample_output_relpath": "derived/input_output/data/p03457/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03457/Go/s267726400.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s267726400", "user_id": "u299672480"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewReader(os.Stdin)\n)\n\ntype pos struct {\n\tt, x, y int\n}\n\nfunc main() {\n\tN := scanInt()\n\tc := &pos{t: 0, x: 0, y: 0}\n\tfor i := 0; i < N; i++ {\n\t\tn := &pos{t: scanInt(), x: scanInt(), y: scanInt()}\n\t\tif !rec(c, n) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tc = n\n\t}\n\tfmt.Println(\"Yes\")\n}\n\nfunc rec(c, n *pos) bool {\n\tif c.t == n.t {\n\t\tif c.x == n.x && c.y == n.y {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\t// x+1, y\n\tif rec(&pos{t: c.t + 1, x: c.x + 1, y: c.y}, n) {\n\t\treturn true\n\t}\n\t// x-1, y\n\tif rec(&pos{t: c.t + 1, x: c.x - 1, y: c.y}, n) {\n\t\treturn true\n\t}\n\t// x, y+1\n\tif rec(&pos{t: c.t + 1, x: c.x, y: c.y + 1}, n) {\n\t\treturn true\n\t}\n\t// x, y-1\n\tif rec(&pos{t: c.t + 1, x: c.x, y: c.y - 1}, n) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc scan(a ...interface{}) { _, err := fmt.Fscan(sc, a...); pnc(err) }\nfunc scanStr() (s string) { scan(&s); return }\nfunc scanInt() int { i, err := strconv.Atoi(scanStr()); pnc(err); return i }\nfunc scanFloat() float64 { f, err := strconv.ParseFloat(scanStr(), 64); pnc(err); return f }\nfunc pnc(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is going on a trip in a two-dimensional plane.\nIn his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.\n\nIf AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).\nNote that he cannot stay at his place.\nDetermine whether he can carry out his plan.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n0 ≤ x_i ≤ 10^5\n\n0 ≤ y_i ≤ 10^5\n\n1 ≤ t_i ≤ 10^5\n\nt_i < t_{i+1} (1 ≤ i ≤ N-1)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 x_1 y_1\nt_2 x_2 y_2\n:\nt_N x_N y_N\n\nOutput\n\nIf AtCoDeer can carry out his plan, print Yes; if he cannot, print No.\n\nSample Input 1\n\n2\n3 1 2\n6 1 1\n\nSample Output 1\n\nYes\n\nFor example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).\n\nSample Input 2\n\n1\n2 100 100\n\nSample Output 2\n\nNo\n\nIt is impossible to be at (100,100) two seconds after being at (0,0).\n\nSample Input 3\n\n2\n5 1 1\n100 1 1\n\nSample Output 3\n\nNo", "sample_input": "2\n3 1 2\n6 1 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03457", "source_text": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is going on a trip in a two-dimensional plane.\nIn his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.\n\nIf AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).\nNote that he cannot stay at his place.\nDetermine whether he can carry out his plan.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n0 ≤ x_i ≤ 10^5\n\n0 ≤ y_i ≤ 10^5\n\n1 ≤ t_i ≤ 10^5\n\nt_i < t_{i+1} (1 ≤ i ≤ N-1)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nt_1 x_1 y_1\nt_2 x_2 y_2\n:\nt_N x_N y_N\n\nOutput\n\nIf AtCoDeer can carry out his plan, print Yes; if he cannot, print No.\n\nSample Input 1\n\n2\n3 1 2\n6 1 1\n\nSample Output 1\n\nYes\n\nFor example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).\n\nSample Input 2\n\n1\n2 100 100\n\nSample Output 2\n\nNo\n\nIt is impossible to be at (100,100) two seconds after being at (0,0).\n\nSample Input 3\n\n2\n5 1 1\n100 1 1\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1179, "cpu_time_ms": 2205, "memory_kb": 6276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s090322052", "group_id": "codeNet:p03463", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\t_, A, B := fsc.NextInt(), fsc.NextInt(), fsc.NextInt()\n\tdiff := B - A\n\tif diff == 1 {\n\t\tfmt.Println(\"Borys\")\n\t} else {\n\t\tif diff%2 == 0 {\n\t\t\tfmt.Println(\"Alice\")\n\t\t} else {\n\t\t\tfmt.Println(\"Borys\")\n\t\t}\n\t}\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc Int64Abs(a int64) int64 {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1538659086, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03463.html", "problem_id": "p03463", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03463/input.txt", "sample_output_relpath": "derived/input_output/data/p03463/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03463/Go/s090322052.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s090322052", "user_id": "u976162616"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\t_, A, B := fsc.NextInt(), fsc.NextInt(), fsc.NextInt()\n\tdiff := B - A\n\tif diff == 1 {\n\t\tfmt.Println(\"Borys\")\n\t} else {\n\t\tif diff%2 == 0 {\n\t\t\tfmt.Println(\"Alice\")\n\t\t} else {\n\t\t\tfmt.Println(\"Borys\")\n\t\t}\n\t}\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc Int64Abs(a int64) int64 {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA game is played on a strip consisting of N cells consecutively numbered from 1 to N.\n\nAlice has her token on cell A. Borys has his token on a different cell B.\n\nPlayers take turns, Alice moves first.\nThe moving player must shift his or her token from its current cell X to the neighboring cell on the left, cell X-1, or on the right, cell X+1.\nNote that it's disallowed to move the token outside the strip or to the cell with the other player's token.\nIn one turn, the token of the moving player must be shifted exactly once.\n\nThe player who can't make a move loses, and the other player wins.\n\nBoth players want to win. Who wins if they play optimally?\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint Alice if Alice wins, Borys if Borys wins, and Draw if nobody wins.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\nAlice\n\nAlice can move her token to cell 3.\nAfter that, Borys will be unable to move his token to cell 3, so he will have to move his token to cell 5.\nThen, Alice moves her token to cell 4. Borys can't make a move and loses.\n\nSample Input 2\n\n2 1 2\n\nSample Output 2\n\nBorys\n\nAlice can't make the very first move and loses.\n\nSample Input 3\n\n58 23 42\n\nSample Output 3\n\nBorys", "sample_input": "5 2 4\n"}, "reference_outputs": ["Alice\n"], "source_document_id": "p03463", "source_text": "Score : 300 points\n\nProblem Statement\n\nA game is played on a strip consisting of N cells consecutively numbered from 1 to N.\n\nAlice has her token on cell A. Borys has his token on a different cell B.\n\nPlayers take turns, Alice moves first.\nThe moving player must shift his or her token from its current cell X to the neighboring cell on the left, cell X-1, or on the right, cell X+1.\nNote that it's disallowed to move the token outside the strip or to the cell with the other player's token.\nIn one turn, the token of the moving player must be shifted exactly once.\n\nThe player who can't make a move loses, and the other player wins.\n\nBoth players want to win. Who wins if they play optimally?\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A < B \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint Alice if Alice wins, Borys if Borys wins, and Draw if nobody wins.\n\nSample Input 1\n\n5 2 4\n\nSample Output 1\n\nAlice\n\nAlice can move her token to cell 3.\nAfter that, Borys will be unable to move his token to cell 3, so he will have to move his token to cell 5.\nThen, Alice moves her token to cell 4. Borys can't make a move and loses.\n\nSample Input 2\n\n2 1 2\n\nSample Output 2\n\nBorys\n\nAlice can't make the very first move and loses.\n\nSample Input 3\n\n58 23 42\n\nSample Output 3\n\nBorys", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2688, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s683520234", "group_id": "codeNet:p03464", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tK := readi()\n\tA := make([]int64, K)\n\tfor i := range A {\n\t\tA[len(A)-i-1] = readll()\n\t}\n\n\tminv := int64(2)\n\tmaxv := int64(2)\n\tfor i := range A {\n\t\ta := A[i]\n\t\tif maxv < a {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t\tnminv := a\n\t\tfor nminv < minv {\n\t\t\tnminv += a\n\t\t}\n\t\tminv = nminv\n\t\tmaxv = minv + a - 1\n\t}\n\tprintln(minv, maxv)\n}\n", "language": "Go", "metadata": {"date": 1576172046, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03464.html", "problem_id": "p03464", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03464/input.txt", "sample_output_relpath": "derived/input_output/data/p03464/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03464/Go/s683520234.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s683520234", "user_id": "u705974985"}, "prompt_components": {"gold_output": "6 8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tK := readi()\n\tA := make([]int64, K)\n\tfor i := range A {\n\t\tA[len(A)-i-1] = readll()\n\t}\n\n\tminv := int64(2)\n\tmaxv := int64(2)\n\tfor i := range A {\n\t\ta := A[i]\n\t\tif maxv < a {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t\tnminv := a\n\t\tfor nminv < minv {\n\t\t\tnminv += a\n\t\t}\n\t\tminv = nminv\n\t\tmaxv = minv + a - 1\n\t}\n\tprintln(minv, maxv)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nAn adult game master and N children are playing a game on an ice rink.\nThe game consists of K rounds.\nIn the i-th round, the game master announces:\n\nForm groups consisting of A_i children each!\n\nThen the children who are still in the game form as many groups of A_i children as possible.\nOne child may belong to at most one group.\nThose who are left without a group leave the game. The others proceed to the next round.\nNote that it's possible that nobody leaves the game in some round.\n\nIn the end, after the K-th round, there are exactly two children left, and they are declared the winners.\n\nYou have heard the values of A_1, A_2, ..., A_K. You don't know N, but you want to estimate it.\n\nFind the smallest and the largest possible number of children in the game before the start, or determine that no valid values of N exist.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\n2 \\leq A_i \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA_1 A_2 ... A_K\n\nOutput\n\nPrint two integers representing the smallest and the largest possible value of N, respectively,\nor a single integer -1 if the described situation is impossible.\n\nSample Input 1\n\n4\n3 4 3 2\n\nSample Output 1\n\n6 8\n\nFor example, if the game starts with 6 children, then it proceeds as follows:\n\nIn the first round, 6 children form 2 groups of 3 children, and nobody leaves the game.\n\nIn the second round, 6 children form 1 group of 4 children, and 2 children leave the game.\n\nIn the third round, 4 children form 1 group of 3 children, and 1 child leaves the game.\n\nIn the fourth round, 3 children form 1 group of 2 children, and 1 child leaves the game.\n\nThe last 2 children are declared the winners.\n\nSample Input 2\n\n5\n3 4 100 3 2\n\nSample Output 2\n\n-1\n\nThis situation is impossible.\nIn particular, if the game starts with less than 100 children, everyone leaves after the third round.\n\nSample Input 3\n\n10\n2 2 2 2 2 2 2 2 2 2\n\nSample Output 3\n\n2 3", "sample_input": "4\n3 4 3 2\n"}, "reference_outputs": ["6 8\n"], "source_document_id": "p03464", "source_text": "Score : 500 points\n\nProblem Statement\n\nAn adult game master and N children are playing a game on an ice rink.\nThe game consists of K rounds.\nIn the i-th round, the game master announces:\n\nForm groups consisting of A_i children each!\n\nThen the children who are still in the game form as many groups of A_i children as possible.\nOne child may belong to at most one group.\nThose who are left without a group leave the game. The others proceed to the next round.\nNote that it's possible that nobody leaves the game in some round.\n\nIn the end, after the K-th round, there are exactly two children left, and they are declared the winners.\n\nYou have heard the values of A_1, A_2, ..., A_K. You don't know N, but you want to estimate it.\n\nFind the smallest and the largest possible number of children in the game before the start, or determine that no valid values of N exist.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\n2 \\leq A_i \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA_1 A_2 ... A_K\n\nOutput\n\nPrint two integers representing the smallest and the largest possible value of N, respectively,\nor a single integer -1 if the described situation is impossible.\n\nSample Input 1\n\n4\n3 4 3 2\n\nSample Output 1\n\n6 8\n\nFor example, if the game starts with 6 children, then it proceeds as follows:\n\nIn the first round, 6 children form 2 groups of 3 children, and nobody leaves the game.\n\nIn the second round, 6 children form 1 group of 4 children, and 2 children leave the game.\n\nIn the third round, 4 children form 1 group of 3 children, and 1 child leaves the game.\n\nIn the fourth round, 3 children form 1 group of 2 children, and 1 child leaves the game.\n\nThe last 2 children are declared the winners.\n\nSample Input 2\n\n5\n3 4 100 3 2\n\nSample Output 2\n\n-1\n\nThis situation is impossible.\nIn particular, if the game starts with less than 100 children, everyone leaves after the third round.\n\nSample Input 3\n\n10\n2 2 2 2 2 2 2 2 2 2\n\nSample Output 3\n\n2 3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4720, "cpu_time_ms": 1644, "memory_kb": 5120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s869673921", "group_id": "codeNet:p03464", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n var k int = NextInt()\n var a []int64 = NextInt64Array()\n if a[k-1] != 2 {\n fmt.Println(-1)\n return\n }\n var min,max int64 = 2,3\n for i:=k-2;i>-1;i-- {\n if min%a[i] != 0 { min = (min/a[i]+1)*a[i] }\n if min > max {\n fmt.Println(-1)\n return\n }\n max = min+a[i]-1\n }\n fmt.Println(min,max)\n}\n\nvar reader = bufio.NewReaderSize(os.Stdin,1000000)\nfunc NextLine() string {\n var line,buffer []byte\n var isPrefix bool = true\n var err error\n for ;isPrefix; {\n line,isPrefix,err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer,line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n,_ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextInt64Array() []int64 {\n var s []string = strings.Split(NextLine(),\" \")\n var a []int64 = make([]int64,len(s))\n for i:=0;i-1;i-- {\n if min%a[i] != 0 { min = (min/a[i]+1)*a[i] }\n if min > max {\n fmt.Println(-1)\n return\n }\n max = min+a[i]-1\n }\n fmt.Println(min,max)\n}\n\nvar reader = bufio.NewReaderSize(os.Stdin,1000000)\nfunc NextLine() string {\n var line,buffer []byte\n var isPrefix bool = true\n var err error\n for ;isPrefix; {\n line,isPrefix,err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer,line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n,_ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextInt64Array() []int64 {\n var s []string = strings.Split(NextLine(),\" \")\n var a []int64 = make([]int64,len(s))\n for i:=0;i= 0; i-- {\n\t\tif d[i] != top {\n\t\t\tans++\n\t\t\ttop = d[i]\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1579196722, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03470.html", "problem_id": "p03470", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03470/input.txt", "sample_output_relpath": "derived/input_output/data/p03470/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03470/Go/s981007817.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s981007817", "user_id": "u502813058"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\td := nextInts(n)\n\tsort.Sort(sort.IntSlice(d))\n\n\tans := 0\n\ttop := 0\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif d[i] != top {\n\t\t\tans++\n\t\t\ttop = d[i]\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "sample_input": "4\n10\n8\n8\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03470", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 666, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448343525", "group_id": "codeNet:p03470", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\td := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&d[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(d)))\n\n\tcount := 1\n\tfor i := 0; i < n-1; i++ {\n\t\tif d[i] != d[i+1] {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1574366180, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03470.html", "problem_id": "p03470", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03470/input.txt", "sample_output_relpath": "derived/input_output/data/p03470/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03470/Go/s448343525.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448343525", "user_id": "u902641880"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\td := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&d[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(d)))\n\n\tcount := 1\n\tfor i := 0; i < n-1; i++ {\n\t\tif d[i] != d[i+1] {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "sample_input": "4\n10\n8\n8\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03470", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.\n\nLunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ d_i ≤ 100\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nd_1\n:\nd_N\n\nOutput\n\nPrint the maximum number of layers in a kagami mochi that can be made.\n\nSample Input 1\n\n4\n10\n8\n8\n6\n\nSample Output 1\n\n3\n\nIf we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.\n\nSample Input 2\n\n3\n15\n15\n15\n\nSample Output 2\n\n1\n\nWhen all the mochi have the same diameter, we can only have a 1-layered kagami mochi.\n\nSample Input 3\n\n7\n50\n30\n50\n100\n50\n80\n30\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 295, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s855117507", "group_id": "codeNet:p03473", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// ax+by=gcd(a,b)\nfunc extgcd(a, b int) (x, y int) {\n\ty = 1\n\tx = 0\n\tfor u, v := 1, 0; a != 0; {\n\t\tq := b / a\n\t\tu, x = x - q * u, u\n\t\tv, y = y - q * v, v\n\t\ta, b = b - q * a, a\n\t}\n\n\treturn\n}\n\nfunc modinv(a, m int) int {\n\tx, _ := extgcd(a, m)\n\treturn (m + x % m) % m\n}\n\nfunc fact(n, mod int) int {\n\tret := 1\n\tfor n > 1 {\n\t\tret = ret * n % mod\n\t\tn--\n\t}\n\treturn ret\n}\n\ntype P struct {\n\tw,p int\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.writer.Flush()\n\n\t//n := io.NextInt()\n\t//k := io.NextInt()\n\t//\n\t//vp := make([]P, n, n)\n\t//for i := 0; i < n; i++ {\n\t//\tvp[i].w = io.NextInt()\n\t//\tvp[i].p = io.NextInt()\n\t//}\n\n\tn := io.NextInt()\n\tio.Printf(\"%d\\n\", n + 24);\n}", "language": "Go", "metadata": {"date": 1514685711, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03473.html", "problem_id": "p03473", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03473/input.txt", "sample_output_relpath": "derived/input_output/data/p03473/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03473/Go/s855117507.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s855117507", "user_id": "u279196402"}, "prompt_components": {"gold_output": "27\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// ax+by=gcd(a,b)\nfunc extgcd(a, b int) (x, y int) {\n\ty = 1\n\tx = 0\n\tfor u, v := 1, 0; a != 0; {\n\t\tq := b / a\n\t\tu, x = x - q * u, u\n\t\tv, y = y - q * v, v\n\t\ta, b = b - q * a, a\n\t}\n\n\treturn\n}\n\nfunc modinv(a, m int) int {\n\tx, _ := extgcd(a, m)\n\treturn (m + x % m) % m\n}\n\nfunc fact(n, mod int) int {\n\tret := 1\n\tfor n > 1 {\n\t\tret = ret * n % mod\n\t\tn--\n\t}\n\treturn ret\n}\n\ntype P struct {\n\tw,p int\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.writer.Flush()\n\n\t//n := io.NextInt()\n\t//k := io.NextInt()\n\t//\n\t//vp := make([]P, n, n)\n\t//for i := 0; i < n; i++ {\n\t//\tvp[i].w = io.NextInt()\n\t//\tvp[i].p = io.NextInt()\n\t//}\n\n\tn := io.NextInt()\n\tio.Printf(\"%d\\n\", n + 24);\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?\n\nConstraints\n\n1≤M≤23\n\nM is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\n\nOutput\n\nIf we have x hours until New Year at M o'clock on 30th, December, print x.\n\nSample Input 1\n\n21\n\nSample Output 1\n\n27\n\nWe have 27 hours until New Year at 21 o'clock on 30th, December.\n\nSample Input 2\n\n12\n\nSample Output 2\n\n36", "sample_input": "21\n"}, "reference_outputs": ["27\n"], "source_document_id": "p03473", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?\n\nConstraints\n\n1≤M≤23\n\nM is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\n\nOutput\n\nIf we have x hours until New Year at M o'clock on 30th, December, print x.\n\nSample Input 1\n\n21\n\nSample Output 1\n\n27\n\nWe have 27 hours until New Year at 21 o'clock on 30th, December.\n\nSample Input 2\n\n12\n\nSample Output 2\n\n36", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2050, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s563110198", "group_id": "codeNet:p03474", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A int\n\tvar B int\n\tvar S string\n\n\tfmt.Scanf(\"%d %d\", &A, &B)\n\tfmt.Scanf(\"%s\", &S)\n\n\tif len(S) != A+B+1 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfor i := 0; i < A; i++ {\n\t\tif !IsNum(S[i]) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif S[A] != '-' {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfor i := A + 1; i < A+B+1; i++ {\n\t\tif !IsNum(S[i]) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n\nfunc IsNum(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n", "language": "Go", "metadata": {"date": 1514880942, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03474.html", "problem_id": "p03474", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03474/input.txt", "sample_output_relpath": "derived/input_output/data/p03474/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03474/Go/s563110198.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s563110198", "user_id": "u434572230"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A int\n\tvar B int\n\tvar S string\n\n\tfmt.Scanf(\"%d %d\", &A, &B)\n\tfmt.Scanf(\"%s\", &S)\n\n\tif len(S) != A+B+1 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfor i := 0; i < A; i++ {\n\t\tif !IsNum(S[i]) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif S[A] != '-' {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfor i := A + 1; i < A+B+1; i++ {\n\t\tif !IsNum(S[i]) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n\nfunc IsNum(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "sample_input": "3 4\n269-6650\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03474", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen -, and the other characters are digits from 0 through 9.\n\nYou are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.\n\nConstraints\n\n1≤A,B≤5\n\n|S|=A+B+1\n\nS consists of - and digits from 0 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\nS\n\nOutput\n\nPrint Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.\n\nSample Input 1\n\n3 4\n269-6650\n\nSample Output 1\n\nYes\n\nThe (A+1)-th character of S is -, and the other characters are digits from 0 through 9, so it follows the format.\n\nSample Input 2\n\n1 1\n---\n\nSample Output 2\n\nNo\n\nS contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.\n\nSample Input 3\n\n1 2\n7444\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 498, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s553889917", "group_id": "codeNet:p03475", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar (\n\tn int\n\tc []int\n\ts []int\n\tf []int\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn = nextInt()\n\tc = make([]int, n)\n\ts = make([]int, n)\n\tf = make([]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tc[i], s[i], f[i] = nextInt(), nextInt(), nextInt()\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tt := s[i] + c[i]\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif t <= s[j] {\n\t\t\t\tt += s[j] - t\n\t\t\t}\n\n\t\t\tif t > s[j] {\n\t\t\t\tif f[j] != 0 && (t-s[j])%f[j] != 0 {\n\t\t\t\t\tt += (t/c[j]+1)*c[j] - t\n\t\t\t\t}\n\n\t\t\t\t// if f[j] != 0 && t%f[j] != 0 {\n\n\t\t\t\t// }\n\t\t\t}\n\n\t\t\tt += c[j]\n\t\t}\n\t\tfmt.Println(t)\n\t}\n\tfmt.Println(0)\n}\n", "language": "Go", "metadata": {"date": 1562700158, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03475.html", "problem_id": "p03475", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03475/input.txt", "sample_output_relpath": "derived/input_output/data/p03475/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03475/Go/s553889917.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s553889917", "user_id": "u710190793"}, "prompt_components": {"gold_output": "12\n11\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar (\n\tn int\n\tc []int\n\ts []int\n\tf []int\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn = nextInt()\n\tc = make([]int, n)\n\ts = make([]int, n)\n\tf = make([]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tc[i], s[i], f[i] = nextInt(), nextInt(), nextInt()\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tt := s[i] + c[i]\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif t <= s[j] {\n\t\t\t\tt += s[j] - t\n\t\t\t}\n\n\t\t\tif t > s[j] {\n\t\t\t\tif f[j] != 0 && (t-s[j])%f[j] != 0 {\n\t\t\t\t\tt += (t/c[j]+1)*c[j] - t\n\t\t\t\t}\n\n\t\t\t\t// if f[j] != 0 && t%f[j] != 0 {\n\n\t\t\t\t// }\n\t\t\t}\n\n\t\t\tt += c[j]\n\t\t}\n\t\tfmt.Println(t)\n\t}\n\tfmt.Println(0)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA railroad running from west to east in Atcoder Kingdom is now complete.\n\nThere are N stations on the railroad, numbered 1 through N from west to east.\n\nTomorrow, the opening ceremony of the railroad will take place.\n\nOn this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i to Station i+1 in C_i seconds. No other trains will be operated.\n\nThe first train from Station i to Station i+1 will depart Station i S_i seconds after the ceremony begins. Thereafter, there will be a train that departs Station i every F_i seconds.\n\nHere, it is guaranteed that F_i divides S_i.\n\nThat is, for each Time t satisfying S_i≤t and t%F_i=0, there will be a train that departs Station i t seconds after the ceremony begins and arrives at Station i+1 t+C_i seconds after the ceremony begins, where A%B denotes A modulo B, and there will be no other trains.\n\nFor each i, find the earliest possible time we can reach Station N if we are at Station i when the ceremony begins, ignoring the time needed to change trains.\n\nConstraints\n\n1≤N≤500\n\n1≤C_i≤100\n\n1≤S_i≤10^5\n\n1≤F_i≤10\n\nS_i%F_i=0\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nC_1 S_1 F_1\n:\nC_{N-1} S_{N-1} F_{N-1}\n\nOutput\n\nPrint N lines. Assuming that we are at Station i (1≤i≤N) when the ceremony begins, if the earliest possible time we can reach Station N is x seconds after the ceremony begins, the i-th line should contain x.\n\nSample Input 1\n\n3\n6 5 1\n1 10 1\n\nSample Output 1\n\n12\n11\n0\n\nWe will travel from Station 1 as follows:\n\n5 seconds after the beginning: take the train to Station 2.\n\n11 seconds: arrive at Station 2.\n\n11 seconds: take the train to Station 3.\n\n12 seconds: arrive at Station 3.\n\nWe will travel from Station 2 as follows:\n\n10 seconds: take the train to Station 3.\n\n11 seconds: arrive at Station 3.\n\nNote that we should print 0 for Station 3.\n\nSample Input 2\n\n4\n12 24 6\n52 16 4\n99 2 2\n\nSample Output 2\n\n187\n167\n101\n0\n\nSample Input 3\n\n4\n12 13 1\n44 17 17\n66 4096 64\n\nSample Output 3\n\n4162\n4162\n4162\n0", "sample_input": "3\n6 5 1\n1 10 1\n"}, "reference_outputs": ["12\n11\n0\n"], "source_document_id": "p03475", "source_text": "Score : 300 points\n\nProblem Statement\n\nA railroad running from west to east in Atcoder Kingdom is now complete.\n\nThere are N stations on the railroad, numbered 1 through N from west to east.\n\nTomorrow, the opening ceremony of the railroad will take place.\n\nOn this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i to Station i+1 in C_i seconds. No other trains will be operated.\n\nThe first train from Station i to Station i+1 will depart Station i S_i seconds after the ceremony begins. Thereafter, there will be a train that departs Station i every F_i seconds.\n\nHere, it is guaranteed that F_i divides S_i.\n\nThat is, for each Time t satisfying S_i≤t and t%F_i=0, there will be a train that departs Station i t seconds after the ceremony begins and arrives at Station i+1 t+C_i seconds after the ceremony begins, where A%B denotes A modulo B, and there will be no other trains.\n\nFor each i, find the earliest possible time we can reach Station N if we are at Station i when the ceremony begins, ignoring the time needed to change trains.\n\nConstraints\n\n1≤N≤500\n\n1≤C_i≤100\n\n1≤S_i≤10^5\n\n1≤F_i≤10\n\nS_i%F_i=0\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nC_1 S_1 F_1\n:\nC_{N-1} S_{N-1} F_{N-1}\n\nOutput\n\nPrint N lines. Assuming that we are at Station i (1≤i≤N) when the ceremony begins, if the earliest possible time we can reach Station N is x seconds after the ceremony begins, the i-th line should contain x.\n\nSample Input 1\n\n3\n6 5 1\n1 10 1\n\nSample Output 1\n\n12\n11\n0\n\nWe will travel from Station 1 as follows:\n\n5 seconds after the beginning: take the train to Station 2.\n\n11 seconds: arrive at Station 2.\n\n11 seconds: take the train to Station 3.\n\n12 seconds: arrive at Station 3.\n\nWe will travel from Station 2 as follows:\n\n10 seconds: take the train to Station 3.\n\n11 seconds: arrive at Station 3.\n\nNote that we should print 0 for Station 3.\n\nSample Input 2\n\n4\n12 24 6\n52 16 4\n99 2 2\n\nSample Output 2\n\n187\n167\n101\n0\n\nSample Input 3\n\n4\n12 13 1\n44 17 17\n66 4096 64\n\nSample Output 3\n\n4162\n4162\n4162\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 772, "cpu_time_ms": 6, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s918013733", "group_id": "codeNet:p03476", "input_text": "package main\nimport (\n \"fmt\"\n \"math\"\n)\nfunc isPrime(a int) bool {\n if a == 2 {\n return true\n }\n if a == 1 || a%2 == 0 {\n return false\n }\n rootA := int(math.Sqrt(float64(a)))\n for i := 3; i <= rootA; i += 2 {\n if a%i == 0 {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n var q int\n fmt.Scan(&q)\n ls := make([]int, q)\n rs := make([]int, q)\n for i := 0; i < q; i++ {\n fmt.Scan(&ls[i], &rs[i])\n }\n primeMap := make(map[int]bool)\n for i := 0; i < q; i++ {\n r := rs[i]\n l := ls[i]\n result := 0\n for j := l; j <= r; j += 2 {\n if primeMap[j] {\n result++\n continue\n }\n if isPrime(j) && isPrime((j+1)/2) {\n result++\n primeMap[j] = true\n }\n }\n fmt.Println(result)\n }\n}", "language": "Go", "metadata": {"date": 1569073091, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03476.html", "problem_id": "p03476", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03476/input.txt", "sample_output_relpath": "derived/input_output/data/p03476/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03476/Go/s918013733.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s918013733", "user_id": "u142082997"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"math\"\n)\nfunc isPrime(a int) bool {\n if a == 2 {\n return true\n }\n if a == 1 || a%2 == 0 {\n return false\n }\n rootA := int(math.Sqrt(float64(a)))\n for i := 3; i <= rootA; i += 2 {\n if a%i == 0 {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n var q int\n fmt.Scan(&q)\n ls := make([]int, q)\n rs := make([]int, q)\n for i := 0; i < q; i++ {\n fmt.Scan(&ls[i], &rs[i])\n }\n primeMap := make(map[int]bool)\n for i := 0; i < q; i++ {\n r := rs[i]\n l := ls[i]\n result := 0\n for j := l; j <= r; j += 2 {\n if primeMap[j] {\n result++\n continue\n }\n if isPrime(j) && isPrime((j+1)/2) {\n result++\n primeMap[j] = true\n }\n }\n fmt.Println(result)\n }\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "sample_input": "1\n3 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03476", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\n\nYou are given Q queries.\n\nIn the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.\n\nConstraints\n\n1≤Q≤10^5\n\n1≤l_i≤r_i≤10^5\n\nl_i and r_i are odd.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nl_1 r_1\n:\nl_Q r_Q\n\nOutput\n\nPrint Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query.\n\nSample Input 1\n\n1\n3 7\n\nSample Output 1\n\n2\n\n3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n\n5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n\n7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\nSample Input 2\n\n4\n13 13\n7 11\n7 11\n2017 2017\n\nSample Output 2\n\n1\n0\n0\n1\n\nNote that 2017 is also similar to 2017.\n\nSample Input 3\n\n6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n\nSample Output 3\n\n4\n4\n1\n1\n1\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 766, "cpu_time_ms": 2108, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s003907292", "group_id": "codeNet:p03479", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tx, y :=bs.IntScan(), bs.IntScan()\n\tn := x\n\tmaxCount := 0\n\tfor !isPrime(n) && n < y - 1 {\n\t\tcount := countArray(n, y)\n\t\tif maxCount < count {\n\t\t\tmaxCount = count\n\t\t}\n\t\tn++\n\t}\n\tcount := countArray(n, y)\n\tif maxCount < count {\n\t\tmaxCount = count\n\t}\n\n\tbw.Printf(\"%v\", maxCount)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsNum := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sNum; i += 2 {\n\t\tif n % int(i) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc countArray(x, y int) int {\n\tcount := 0\n\tfor x <= y {\n\t\tcount++\n\t\tx *= 2\n\t}\n\treturn count\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "language": "Go", "metadata": {"date": 1585474976, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03479.html", "problem_id": "p03479", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03479/input.txt", "sample_output_relpath": "derived/input_output/data/p03479/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03479/Go/s003907292.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003907292", "user_id": "u647304231"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tx, y :=bs.IntScan(), bs.IntScan()\n\tn := x\n\tmaxCount := 0\n\tfor !isPrime(n) && n < y - 1 {\n\t\tcount := countArray(n, y)\n\t\tif maxCount < count {\n\t\t\tmaxCount = count\n\t\t}\n\t\tn++\n\t}\n\tcount := countArray(n, y)\n\tif maxCount < count {\n\t\tmaxCount = count\n\t}\n\n\tbw.Printf(\"%v\", maxCount)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsNum := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sNum; i += 2 {\n\t\tif n % int(i) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc countArray(x, y int) int {\n\tcount := 0\n\tfor x <= y {\n\t\tcount++\n\t\tx *= 2\n\t}\n\treturn count\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence.\nThe sequence A needs to satisfy the conditions below:\n\nA consists of integers between X and Y (inclusive).\n\nFor each 1\\leq i \\leq |A|-1, A_{i+1} is a multiple of A_i and strictly greater than A_i.\n\nFind the maximum possible length of the sequence.\n\nConstraints\n\n1 \\leq X \\leq Y \\leq 10^{18}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the maximum possible length of the sequence.\n\nSample Input 1\n\n3 20\n\nSample Output 1\n\n3\n\nThe sequence 3,6,18 satisfies the conditions.\n\nSample Input 2\n\n25 100\n\nSample Output 2\n\n3\n\nSample Input 3\n\n314159265 358979323846264338\n\nSample Output 3\n\n31", "sample_input": "3 20\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03479", "source_text": "Score : 300 points\n\nProblem Statement\n\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence.\nThe sequence A needs to satisfy the conditions below:\n\nA consists of integers between X and Y (inclusive).\n\nFor each 1\\leq i \\leq |A|-1, A_{i+1} is a multiple of A_i and strictly greater than A_i.\n\nFind the maximum possible length of the sequence.\n\nConstraints\n\n1 \\leq X \\leq Y \\leq 10^{18}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint the maximum possible length of the sequence.\n\nSample Input 1\n\n3 20\n\nSample Output 1\n\n3\n\nThe sequence 3,6,18 satisfies the conditions.\n\nSample Input 2\n\n25 100\n\nSample Output 2\n\n3\n\nSample Input 3\n\n314159265 358979323846264338\n\nSample Output 3\n\n31", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1698, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s013535912", "group_id": "codeNet:p03480", "input_text": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Wed Feb 6 12:22:28 2019\n//\npackage main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\n\tans := 1 << 60\n\tfor i := range S {\n\t\tif i+1 < len(S) {\n\t\t\tif S[i] != S[i+1] {\n\t\t\t\tans = min(ans, max(i+1, len(S)-i-1))\n\t\t\t}\n\t\t}\n\t}\n\n\tif ans == 1<<60 {\n\t\tif S[0] == '0' {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(len(S))\n\t\t}\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1549489431, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03480.html", "problem_id": "p03480", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03480/input.txt", "sample_output_relpath": "derived/input_output/data/p03480/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03480/Go/s013535912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s013535912", "user_id": "u802614675"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Wed Feb 6 12:22:28 2019\n//\npackage main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\n\tans := 1 << 60\n\tfor i := range S {\n\t\tif i+1 < len(S) {\n\t\t\tif S[i] != S[i+1] {\n\t\t\t\tans = min(ans, max(i+1, len(S)-i-1))\n\t\t\t}\n\t\t}\n\t}\n\n\tif ans == 1<<60 {\n\t\tif S[0] == '0' {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(len(S))\n\t\t}\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S consisting of 0 and 1.\nFind the maximum integer K not greater than |S| such that we can turn all the characters of S into 0 by repeating the following operation some number of times.\n\nChoose a contiguous segment [l,r] in S whose length is at least K (that is, r-l+1\\geq K must be satisfied). For each integer i such that l\\leq i\\leq r, do the following: if S_i is 0, replace it with 1; if S_i is 1, replace it with 0.\n\nConstraints\n\n1\\leq |S|\\leq 10^5\n\nS_i(1\\leq i\\leq N) is either 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum integer K such that we can turn all the characters of S into 0 by repeating the operation some number of times.\n\nSample Input 1\n\n010\n\nSample Output 1\n\n2\n\nWe can turn all the characters of S into 0 by the following operations:\n\nPerform the operation on the segment S[1,3] with length 3. S is now 101.\n\nPerform the operation on the segment S[1,2] with length 2. S is now 011.\n\nPerform the operation on the segment S[2,3] with length 2. S is now 000.\n\nSample Input 2\n\n100000000\n\nSample Output 2\n\n8\n\nSample Input 3\n\n00001111\n\nSample Output 3\n\n4", "sample_input": "010\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03480", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S consisting of 0 and 1.\nFind the maximum integer K not greater than |S| such that we can turn all the characters of S into 0 by repeating the following operation some number of times.\n\nChoose a contiguous segment [l,r] in S whose length is at least K (that is, r-l+1\\geq K must be satisfied). For each integer i such that l\\leq i\\leq r, do the following: if S_i is 0, replace it with 1; if S_i is 1, replace it with 0.\n\nConstraints\n\n1\\leq |S|\\leq 10^5\n\nS_i(1\\leq i\\leq N) is either 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum integer K such that we can turn all the characters of S into 0 by repeating the operation some number of times.\n\nSample Input 1\n\n010\n\nSample Output 1\n\n2\n\nWe can turn all the characters of S into 0 by the following operations:\n\nPerform the operation on the segment S[1,3] with length 3. S is now 101.\n\nPerform the operation on the segment S[1,2] with length 2. S is now 011.\n\nPerform the operation on the segment S[2,3] with length 2. S is now 000.\n\nSample Input 2\n\n100000000\n\nSample Output 2\n\n8\n\nSample Input 3\n\n00001111\n\nSample Output 3\n\n4", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 572, "cpu_time_ms": 57, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s167233441", "group_id": "codeNet:p03485", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif (a+b)%2 != 0 {\n\t\tfmt.Println((a+b)/2 + 1)\n\t} else {\n\t\tfmt.Println((a + b) / 2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584036381, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03485.html", "problem_id": "p03485", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03485/input.txt", "sample_output_relpath": "derived/input_output/data/p03485/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03485/Go/s167233441.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s167233441", "user_id": "u605443479"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif (a+b)%2 != 0 {\n\t\tfmt.Println((a+b)/2 + 1)\n\t} else {\n\t\tfmt.Println((a + b) / 2)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two positive integers a and b.\nLet x be the average of a and b.\nPrint x rounded up to the nearest integer.\n\nConstraints\n\na and b are integers.\n\n1 \\leq a, b \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint x rounded up to the nearest integer.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n2\n\nThe average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.\n\nSample Input 2\n\n7 4\n\nSample Output 2\n\n6\n\nThe average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n5", "sample_input": "1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03485", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two positive integers a and b.\nLet x be the average of a and b.\nPrint x rounded up to the nearest integer.\n\nConstraints\n\na and b are integers.\n\n1 \\leq a, b \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint x rounded up to the nearest integer.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n2\n\nThe average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.\n\nSample Input 2\n\n7 4\n\nSample Output 2\n\n6\n\nThe average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 162, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s542670458", "group_id": "codeNet:p03485", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println((a + b) / 2 + (a+b) % 2)\n}\n", "language": "Go", "metadata": {"date": 1556594864, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03485.html", "problem_id": "p03485", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03485/input.txt", "sample_output_relpath": "derived/input_output/data/p03485/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03485/Go/s542670458.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s542670458", "user_id": "u899421906"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println((a + b) / 2 + (a+b) % 2)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two positive integers a and b.\nLet x be the average of a and b.\nPrint x rounded up to the nearest integer.\n\nConstraints\n\na and b are integers.\n\n1 \\leq a, b \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint x rounded up to the nearest integer.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n2\n\nThe average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.\n\nSample Input 2\n\n7 4\n\nSample Output 2\n\n6\n\nThe average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n5", "sample_input": "1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03485", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two positive integers a and b.\nLet x be the average of a and b.\nPrint x rounded up to the nearest integer.\n\nConstraints\n\na and b are integers.\n\n1 \\leq a, b \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b\n\nOutput\n\nPrint x rounded up to the nearest integer.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n2\n\nThe average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.\n\nSample Input 2\n\n7 4\n\nSample Output 2\n\n6\n\nThe average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 119, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s054357627", "group_id": "codeNet:p03486", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\tarr_s := strings.Split(s, \"\")\n\tarr_t := strings.Split(t, \"\")\n\tsort.Sort(sort.StringSlice(arr_s))\n\tsort.Sort(sort.Reverse(sort.StringSlice(arr_t)))\n\n\tjudge := 0\n\tfor i, e := range arr_s {\n\t\tif e < arr_t[i] {\n\t\t\tjudge = 1\n\t\t\tbreak\n\t\t} else if e > arr_t[i] {\n\t\t\tjudge = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tswitch judge {\n\tcase 0:\n\t\tif len(arr_s) < len(arr_t) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\tcase 1:\n\t\tfmt.Println(\"Yes\")\n\tcase -1:\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1580704543, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03486.html", "problem_id": "p03486", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03486/input.txt", "sample_output_relpath": "derived/input_output/data/p03486/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03486/Go/s054357627.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s054357627", "user_id": "u315984289"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\tarr_s := strings.Split(s, \"\")\n\tarr_t := strings.Split(t, \"\")\n\tsort.Sort(sort.StringSlice(arr_s))\n\tsort.Sort(sort.Reverse(sort.StringSlice(arr_t)))\n\n\tjudge := 0\n\tfor i, e := range arr_s {\n\t\tif e < arr_t[i] {\n\t\t\tjudge = 1\n\t\t\tbreak\n\t\t} else if e > arr_t[i] {\n\t\t\tjudge = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tswitch judge {\n\tcase 0:\n\t\tif len(arr_s) < len(arr_t) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\tcase 1:\n\t\tfmt.Println(\"Yes\")\n\tcase -1:\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given strings s and t, consisting of lowercase English letters.\nYou will create a string s' by freely rearranging the characters in s.\nYou will also create a string t' by freely rearranging the characters in t.\nDetermine whether it is possible to satisfy s' < t' for the lexicographic order.\n\nNotes\n\nFor a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:\n\nN < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.\n\nThere exists i (1 \\leq i \\leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.\n\nFor example, xy < xya and atcoder < atlas.\n\nConstraints\n\nThe lengths of s and t are between 1 and 100 (inclusive).\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf it is possible to satisfy s' < t', print Yes; if it is not, print No.\n\nSample Input 1\n\nyx\naxy\n\nSample Output 1\n\nYes\n\nWe can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.\n\nSample Input 2\n\nratcode\natlas\n\nSample Output 2\n\nYes\n\nWe can, for example, rearrange ratcode into acdeort and atlas into tslaa. Then, acdeort < tslaa.\n\nSample Input 3\n\ncd\nabc\n\nSample Output 3\n\nNo\n\nNo matter how we rearrange cd and abc, we cannot achieve our objective.\n\nSample Input 4\n\nw\nww\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nzzz\nzzz\n\nSample Output 5\n\nNo", "sample_input": "yx\naxy\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03486", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given strings s and t, consisting of lowercase English letters.\nYou will create a string s' by freely rearranging the characters in s.\nYou will also create a string t' by freely rearranging the characters in t.\nDetermine whether it is possible to satisfy s' < t' for the lexicographic order.\n\nNotes\n\nFor a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:\n\nN < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.\n\nThere exists i (1 \\leq i \\leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.\n\nFor example, xy < xya and atcoder < atlas.\n\nConstraints\n\nThe lengths of s and t are between 1 and 100 (inclusive).\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf it is possible to satisfy s' < t', print Yes; if it is not, print No.\n\nSample Input 1\n\nyx\naxy\n\nSample Output 1\n\nYes\n\nWe can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.\n\nSample Input 2\n\nratcode\natlas\n\nSample Output 2\n\nYes\n\nWe can, for example, rearrange ratcode into acdeort and atlas into tslaa. Then, acdeort < tslaa.\n\nSample Input 3\n\ncd\nabc\n\nSample Output 3\n\nNo\n\nNo matter how we rearrange cd and abc, we cannot achieve our objective.\n\nSample Input 4\n\nw\nww\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nzzz\nzzz\n\nSample Output 5\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 567, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s055749286", "group_id": "codeNet:p03486", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tvar s, t string\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\tif sc.Scan() {\n\t\tt = sc.Text()\n\t}\n\n\tsOdr := order(s)\n\ttOdr := reverse(order(t))\n\n\tfor pos, sOdr_i := range sOdr {\n\t\tsNum := findNum(sOdr_i)\n\n\t\tfor _, tOdr_j := range tOdr {\n\t\t\ttNum := findNum(tOdr_j)\n\n\t\t\tif sNum < tNum {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif pos == len(tOdr)-1 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n\treturn\n}\n\nfunc findNum(s rune) int {\n\ta := \"abcdefghijklmopqrstwxyz\"\n\n\tfor pos, i := range a {\n\t\tif s == i {\n\t\t\treturn pos\n\t\t}\n\t}\n\n\treturn -1\n}\n\nfunc order(str string) string {\n\trs := []string{}\n\tfor _, r := range str {\n\t\trs = append(rs, strings.ToLower(string(r)))\n\t}\n\tsort.Strings(rs)\n\treturn strings.Join(rs, \"\")\n}\n\nfunc reverse(s string) string {\n\trs := []rune(s)\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\trs[i], rs[j] = rs[j], rs[i]\n\t}\n\treturn string(rs)\n}\n", "language": "Go", "metadata": {"date": 1563411086, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03486.html", "problem_id": "p03486", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03486/input.txt", "sample_output_relpath": "derived/input_output/data/p03486/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03486/Go/s055749286.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s055749286", "user_id": "u318027064"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tvar s, t string\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\tif sc.Scan() {\n\t\tt = sc.Text()\n\t}\n\n\tsOdr := order(s)\n\ttOdr := reverse(order(t))\n\n\tfor pos, sOdr_i := range sOdr {\n\t\tsNum := findNum(sOdr_i)\n\n\t\tfor _, tOdr_j := range tOdr {\n\t\t\ttNum := findNum(tOdr_j)\n\n\t\t\tif sNum < tNum {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif pos == len(tOdr)-1 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n\treturn\n}\n\nfunc findNum(s rune) int {\n\ta := \"abcdefghijklmopqrstwxyz\"\n\n\tfor pos, i := range a {\n\t\tif s == i {\n\t\t\treturn pos\n\t\t}\n\t}\n\n\treturn -1\n}\n\nfunc order(str string) string {\n\trs := []string{}\n\tfor _, r := range str {\n\t\trs = append(rs, strings.ToLower(string(r)))\n\t}\n\tsort.Strings(rs)\n\treturn strings.Join(rs, \"\")\n}\n\nfunc reverse(s string) string {\n\trs := []rune(s)\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\trs[i], rs[j] = rs[j], rs[i]\n\t}\n\treturn string(rs)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given strings s and t, consisting of lowercase English letters.\nYou will create a string s' by freely rearranging the characters in s.\nYou will also create a string t' by freely rearranging the characters in t.\nDetermine whether it is possible to satisfy s' < t' for the lexicographic order.\n\nNotes\n\nFor a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:\n\nN < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.\n\nThere exists i (1 \\leq i \\leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.\n\nFor example, xy < xya and atcoder < atlas.\n\nConstraints\n\nThe lengths of s and t are between 1 and 100 (inclusive).\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf it is possible to satisfy s' < t', print Yes; if it is not, print No.\n\nSample Input 1\n\nyx\naxy\n\nSample Output 1\n\nYes\n\nWe can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.\n\nSample Input 2\n\nratcode\natlas\n\nSample Output 2\n\nYes\n\nWe can, for example, rearrange ratcode into acdeort and atlas into tslaa. Then, acdeort < tslaa.\n\nSample Input 3\n\ncd\nabc\n\nSample Output 3\n\nNo\n\nNo matter how we rearrange cd and abc, we cannot achieve our objective.\n\nSample Input 4\n\nw\nww\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nzzz\nzzz\n\nSample Output 5\n\nNo", "sample_input": "yx\naxy\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03486", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given strings s and t, consisting of lowercase English letters.\nYou will create a string s' by freely rearranging the characters in s.\nYou will also create a string t' by freely rearranging the characters in t.\nDetermine whether it is possible to satisfy s' < t' for the lexicographic order.\n\nNotes\n\nFor a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:\n\nN < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.\n\nThere exists i (1 \\leq i \\leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.\n\nFor example, xy < xya and atcoder < atlas.\n\nConstraints\n\nThe lengths of s and t are between 1 and 100 (inclusive).\n\ns and t consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nIf it is possible to satisfy s' < t', print Yes; if it is not, print No.\n\nSample Input 1\n\nyx\naxy\n\nSample Output 1\n\nYes\n\nWe can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.\n\nSample Input 2\n\nratcode\natlas\n\nSample Output 2\n\nYes\n\nWe can, for example, rearrange ratcode into acdeort and atlas into tslaa. Then, acdeort < tslaa.\n\nSample Input 3\n\ncd\nabc\n\nSample Output 3\n\nNo\n\nNo matter how we rearrange cd and abc, we cannot achieve our objective.\n\nSample Input 4\n\nw\nww\n\nSample Output 4\n\nYes\n\nSample Input 5\n\nzzz\nzzz\n\nSample Output 5\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 998, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s142159677", "group_id": "codeNet:p03488", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc reachable(f []int, to int) bool {\n\tn := len(f)\n\tgrids := make([][20000]bool, n+1)\n\tgrids[0][0+10000] = true\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := f[i-1]; j < 20000-f[i-1]; j++ {\n\t\t\tgrids[i][j] = grids[i-1][j+f[i-1]] || grids[i-1][j-f[i-1]]\n\t\t}\n\t}\n\treturn grids[n][to+10000]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\ts, x, y := next(), nextInt(), nextInt()\n\n\tff := make([][]int, 2)\n\tff[0], ff[1] = []int{0}, []int{}\n\tfor i, t := 0, 0; i < len(s); i++ {\n\t\tif s[i] == 'T' {\n\t\t\tt++\n\t\t\tff[t%2] = append(ff[t%2], 0)\n\t\t} else {\n\t\t\tff[t%2][len(ff[t%2])-1]++\n\t\t}\n\t}\n\tx -= ff[0][0]\n\tff[0] = ff[0][1:]\n\n\tif reachable(ff[0], x) && reachable(ff[1], y) {\n\t\tputs(\"Yes\")\n\t} else {\n\t\tputs(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591159701, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03488.html", "problem_id": "p03488", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03488/input.txt", "sample_output_relpath": "derived/input_output/data/p03488/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03488/Go/s142159677.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s142159677", "user_id": "u502813058"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc reachable(f []int, to int) bool {\n\tn := len(f)\n\tgrids := make([][20000]bool, n+1)\n\tgrids[0][0+10000] = true\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := f[i-1]; j < 20000-f[i-1]; j++ {\n\t\t\tgrids[i][j] = grids[i-1][j+f[i-1]] || grids[i-1][j-f[i-1]]\n\t\t}\n\t}\n\treturn grids[n][to+10000]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\ts, x, y := next(), nextInt(), nextInt()\n\n\tff := make([][]int, 2)\n\tff[0], ff[1] = []int{0}, []int{}\n\tfor i, t := 0, 0; i < len(s); i++ {\n\t\tif s[i] == 'T' {\n\t\t\tt++\n\t\t\tff[t%2] = append(ff[t%2], 0)\n\t\t} else {\n\t\t\tff[t%2][len(ff[t%2])-1]++\n\t\t}\n\t}\n\tx -= ff[0][0]\n\tff[0] = ff[0][1:]\n\n\tif reachable(ff[0], x) && reachable(ff[1], y) {\n\t\tputs(\"Yes\")\n\t} else {\n\t\tputs(\"No\")\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "sample_input": "FTFFTFFF\n4 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03488", "source_text": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1134, "cpu_time_ms": 1293, "memory_kb": 110464}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s766031913", "group_id": "codeNet:p03488", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tS := sc.nextStr()\n\tX, Y := sc.nextInt(), sc.nextInt()\n\tAx := []int{}\n\tAy := []int{}\n\tstartX, startY := 0, 0\n\tcount := 0\n\tisX := true\n\tisFirst := true\n\tfor _, r := range S {\n\t\tif r == 'F' {\n\t\t\tcount++\n\t\t} else {\n\t\t\tif count > 0 {\n\t\t\t\tif isX {\n\t\t\t\t\tif isFirst {\n\t\t\t\t\t\tstartX += count\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAx = append(Ax, count)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tAy = append(Ay, count)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcount = 0\n\t\t\tisX = !isX\n\t\t\tisFirst = false\n\t\t}\n\t}\n\tif count > 0 {\n\t\tif isX {\n\t\t\tif isFirst {\n\t\t\t\tstartX += count\n\t\t\t} else {\n\t\t\t\tAx = append(Ax, count)\n\t\t\t}\n\t\t} else {\n\t\t\tAy = append(Ay, count)\n\t\t}\n\t}\n\n\tif f(X, Ax, startX) && f(Y, Ay, startY) {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n\nconst MAX = 8000\n\nfunc f(target int, A []int, start int) bool {\n\t// 0: -8000, 8000: 0, 16000: 8000\n\tdp := make([][MAX*2 + 1]bool, len(A)+1)\n\tdp[0][MAX+start] = true\n\tfor i := 1; i <= len(A); i++ {\n\t\tfor j := 0; j <= MAX*2; j++ {\n\t\t\tif dp[i-1][j] {\n\t\t\t\tdp[i][j+A[i-1]] = true\n\t\t\t\tdp[i][j-A[i-1]] = true\n\t\t\t}\n\t\t}\n\t}\n\treturn dp[len(A)][target+MAX]\n}\n", "language": "Go", "metadata": {"date": 1584219945, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03488.html", "problem_id": "p03488", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03488/input.txt", "sample_output_relpath": "derived/input_output/data/p03488/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03488/Go/s766031913.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s766031913", "user_id": "u924691798"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tS := sc.nextStr()\n\tX, Y := sc.nextInt(), sc.nextInt()\n\tAx := []int{}\n\tAy := []int{}\n\tstartX, startY := 0, 0\n\tcount := 0\n\tisX := true\n\tisFirst := true\n\tfor _, r := range S {\n\t\tif r == 'F' {\n\t\t\tcount++\n\t\t} else {\n\t\t\tif count > 0 {\n\t\t\t\tif isX {\n\t\t\t\t\tif isFirst {\n\t\t\t\t\t\tstartX += count\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAx = append(Ax, count)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tAy = append(Ay, count)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcount = 0\n\t\t\tisX = !isX\n\t\t\tisFirst = false\n\t\t}\n\t}\n\tif count > 0 {\n\t\tif isX {\n\t\t\tif isFirst {\n\t\t\t\tstartX += count\n\t\t\t} else {\n\t\t\t\tAx = append(Ax, count)\n\t\t\t}\n\t\t} else {\n\t\t\tAy = append(Ay, count)\n\t\t}\n\t}\n\n\tif f(X, Ax, startX) && f(Y, Ay, startY) {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n\nconst MAX = 8000\n\nfunc f(target int, A []int, start int) bool {\n\t// 0: -8000, 8000: 0, 16000: 8000\n\tdp := make([][MAX*2 + 1]bool, len(A)+1)\n\tdp[0][MAX+start] = true\n\tfor i := 1; i <= len(A); i++ {\n\t\tfor j := 0; j <= MAX*2; j++ {\n\t\t\tif dp[i-1][j] {\n\t\t\t\tdp[i][j+A[i-1]] = true\n\t\t\t\tdp[i][j-A[i-1]] = true\n\t\t\t}\n\t\t}\n\t}\n\treturn dp[len(A)][target+MAX]\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "sample_input": "FTFFTFFF\n4 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03488", "source_text": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2979, "cpu_time_ms": 183, "memory_kb": 63232}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s756899145", "group_id": "codeNet:p03488", "input_text": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Fri Jan 4 16:20:38 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nconst maxLen = 8000\n\nfunc canReach(fs []int, at int, startDirectionPuls bool) bool {\n\tdp := make([][]bool, len(fs)+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]bool, 2*maxLen+1)\n\t}\n\tif startDirectionPuls {\n\t\tdp[0][maxLen+fs[0]] = true\n\t\tfs = fs[1:]\n\t} else {\n\t\tdp[0][maxLen+0] = true\n\t}\n\n\tfor i := range fs {\n\t\tfor f := range dp[i] {\n\t\t\tif dp[i][f] {\n\t\t\t\tdp[i+1][f-fs[i]] = true\n\t\t\t\tdp[i+1][f+fs[i]] = true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dp[len(fs)][maxLen+at]\n}\n\nfunc splitCommand(s string) (xs []int, ys []int) {\n\tarms, move := []int{}, 0\n\tfor _, c := range s {\n\t\tif c == 'T' {\n\t\t\tarms = append(arms, move)\n\t\t\tmove = 0\n\t\t} else {\n\t\t\tmove++\n\t\t}\n\t}\n\tarms = append(arms, move)\n\n\tfor i := range arms {\n\t\tif i%2 == 0 {\n\t\t\txs = append(xs, arms[i])\n\t\t} else {\n\t\t\tys = append(ys, arms[i])\n\t\t}\n\t}\n\treturn xs, ys\n}\n\nfunc solve(s string, x, y int) bool {\n\txs, ys := splitCommand(s)\n\treturn canReach(xs, x, true) && canReach(ys, y, false)\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\n\tif solve(s, x, y) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1549871911, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03488.html", "problem_id": "p03488", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03488/input.txt", "sample_output_relpath": "derived/input_output/data/p03488/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03488/Go/s756899145.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s756899145", "user_id": "u802614675"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Fri Jan 4 16:20:38 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nconst maxLen = 8000\n\nfunc canReach(fs []int, at int, startDirectionPuls bool) bool {\n\tdp := make([][]bool, len(fs)+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]bool, 2*maxLen+1)\n\t}\n\tif startDirectionPuls {\n\t\tdp[0][maxLen+fs[0]] = true\n\t\tfs = fs[1:]\n\t} else {\n\t\tdp[0][maxLen+0] = true\n\t}\n\n\tfor i := range fs {\n\t\tfor f := range dp[i] {\n\t\t\tif dp[i][f] {\n\t\t\t\tdp[i+1][f-fs[i]] = true\n\t\t\t\tdp[i+1][f+fs[i]] = true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dp[len(fs)][maxLen+at]\n}\n\nfunc splitCommand(s string) (xs []int, ys []int) {\n\tarms, move := []int{}, 0\n\tfor _, c := range s {\n\t\tif c == 'T' {\n\t\t\tarms = append(arms, move)\n\t\t\tmove = 0\n\t\t} else {\n\t\t\tmove++\n\t\t}\n\t}\n\tarms = append(arms, move)\n\n\tfor i := range arms {\n\t\tif i%2 == 0 {\n\t\t\txs = append(xs, arms[i])\n\t\t} else {\n\t\t\tys = append(ys, arms[i])\n\t\t}\n\t}\n\treturn xs, ys\n}\n\nfunc solve(s string, x, y int) bool {\n\txs, ys := splitCommand(s)\n\treturn canReach(xs, x, true) && canReach(ys, y, false)\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\n\tif solve(s, x, y) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "sample_input": "FTFFTFFF\n4 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03488", "source_text": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1212, "cpu_time_ms": 229, "memory_kb": 66560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s725198381", "group_id": "codeNet:p03490", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n// var dx = [...]int{0, 1, 0, -1, 1, -1, -1, 1}\n// var dy = [...]int{1, 0, -1, 0, 1, 1, -1, -1}\n// var inf int = 1e13\n\n// var mod = 1000000007\nvar next = newScanner()\n\n// ---------------------------------------------------------\n\nvar s string\nvar x, y int\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\ts = next.String()\n\tx = next.Int()\n\ty = next.Int()\n\t// d := 0 // = x, 1 = y, 2 = -x, 3 = -y,\n\tans := \"No\"\n\tvar dir func(int, int, int, int)\n\tdir = func(nx, ny, di, step int) {\n\t\t// log.Println(nx, ny, step)\n\t\tif step == len(s) {\n\t\t\t// log.Println(nx, ny)\n\t\t\tif nx == x && ny == y {\n\t\t\t\tans = \"Yes\"\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tif !dist(nx, ny, step) {\n\t\t\treturn\n\t\t}\n\n\t\tif s[step] == 'T' {\n\t\t\tif di == 0 || di == 2 {\n\t\t\t\tdir(nx, ny, 1, step+1)\n\t\t\t\tdir(nx, ny, 3, step+1)\n\t\t\t}\n\t\t\tif di == 1 || di == 3 {\n\t\t\t\tdir(nx, ny, 0, step+1)\n\t\t\t\tdir(nx, ny, 2, step+1)\n\t\t\t}\n\n\t\t} else if s[step] == 'F' {\n\t\t\tswitch di {\n\t\t\tcase 0:\n\t\t\t\tdir(nx+1, ny, di, step+1)\n\t\t\tcase 1:\n\t\t\t\tdir(nx, ny+1, di, step+1)\n\t\t\tcase 2:\n\t\t\t\tdir(nx-1, ny, di, step+1)\n\t\t\tcase 3:\n\t\t\t\tdir(nx, ny-1, di, step+1)\n\t\t\t}\n\t\t}\n\n\t}\n\tgo dir(0, 0, 0, 0)\n\ttime.Sleep(1900 * time.Millisecond)\n\tfmt.Println(ans)\n}\n\nfunc dist(ax, ay, step int) bool {\n\tremainingStep := len(s) - step\n\tif remainingStep < abs(x-ax)+abs(y-ay) {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// ---------------------------------------------------------\n\n// // Pair is...\ntype Pair struct {\n\ta, b int\n}\n\n//\n// // Pairs is sorted by []Pair struct\n// type Pairs []Pair\n//\n// func (p Pairs) Len() int {\n// \treturn len(p)\n// }\n// func (p Pairs) Swap(i, j int) {\n// \tp[i], p[j] = p[j], p[i]\n// }\n//\n// func (p Pairs) Less(i, j int) bool {\n// \tif p[i].a < p[j].a {\n// \t\treturn true\n// \t} else if p[i].a == p[j].a {\n// \t\treturn p[i].b < p[j].b\n// \t}\n// \treturn false\n// }\n\n// ------int method-------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) int {\n\tr := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc pro(a []int) int {\n\tr := 1\n\tfor i := 0; i < len(a); i++ {\n\t\tr *= a[i]\n\t}\n\treturn r\n}\nfunc fill(a []int, n int) []int {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = n\n\t}\n\treturn a\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---------- buffered scanner -----------------------------------------\nfunc iferr(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\nfunc (s *scanner) Int() int {\n\tv, e := strconv.Atoi(s.next())\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) Ints(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = s.Int()\n\t}\n\treturn r\n}\nfunc (s *scanner) Int64() int64 {\n\tv, e := strconv.ParseInt(s.next(), 10, 64)\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) Uint64() uint64 {\n\tv, e := strconv.ParseUint(s.next(), 10, 64)\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) Float64() float64 {\n\tv, e := strconv.ParseFloat(s.next(), 64)\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tiferr(e)\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1513478906, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03490.html", "problem_id": "p03490", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03490/input.txt", "sample_output_relpath": "derived/input_output/data/p03490/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03490/Go/s725198381.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s725198381", "user_id": "u696272993"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n// var dx = [...]int{0, 1, 0, -1, 1, -1, -1, 1}\n// var dy = [...]int{1, 0, -1, 0, 1, 1, -1, -1}\n// var inf int = 1e13\n\n// var mod = 1000000007\nvar next = newScanner()\n\n// ---------------------------------------------------------\n\nvar s string\nvar x, y int\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\ts = next.String()\n\tx = next.Int()\n\ty = next.Int()\n\t// d := 0 // = x, 1 = y, 2 = -x, 3 = -y,\n\tans := \"No\"\n\tvar dir func(int, int, int, int)\n\tdir = func(nx, ny, di, step int) {\n\t\t// log.Println(nx, ny, step)\n\t\tif step == len(s) {\n\t\t\t// log.Println(nx, ny)\n\t\t\tif nx == x && ny == y {\n\t\t\t\tans = \"Yes\"\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tif !dist(nx, ny, step) {\n\t\t\treturn\n\t\t}\n\n\t\tif s[step] == 'T' {\n\t\t\tif di == 0 || di == 2 {\n\t\t\t\tdir(nx, ny, 1, step+1)\n\t\t\t\tdir(nx, ny, 3, step+1)\n\t\t\t}\n\t\t\tif di == 1 || di == 3 {\n\t\t\t\tdir(nx, ny, 0, step+1)\n\t\t\t\tdir(nx, ny, 2, step+1)\n\t\t\t}\n\n\t\t} else if s[step] == 'F' {\n\t\t\tswitch di {\n\t\t\tcase 0:\n\t\t\t\tdir(nx+1, ny, di, step+1)\n\t\t\tcase 1:\n\t\t\t\tdir(nx, ny+1, di, step+1)\n\t\t\tcase 2:\n\t\t\t\tdir(nx-1, ny, di, step+1)\n\t\t\tcase 3:\n\t\t\t\tdir(nx, ny-1, di, step+1)\n\t\t\t}\n\t\t}\n\n\t}\n\tgo dir(0, 0, 0, 0)\n\ttime.Sleep(1900 * time.Millisecond)\n\tfmt.Println(ans)\n}\n\nfunc dist(ax, ay, step int) bool {\n\tremainingStep := len(s) - step\n\tif remainingStep < abs(x-ax)+abs(y-ay) {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// ---------------------------------------------------------\n\n// // Pair is...\ntype Pair struct {\n\ta, b int\n}\n\n//\n// // Pairs is sorted by []Pair struct\n// type Pairs []Pair\n//\n// func (p Pairs) Len() int {\n// \treturn len(p)\n// }\n// func (p Pairs) Swap(i, j int) {\n// \tp[i], p[j] = p[j], p[i]\n// }\n//\n// func (p Pairs) Less(i, j int) bool {\n// \tif p[i].a < p[j].a {\n// \t\treturn true\n// \t} else if p[i].a == p[j].a {\n// \t\treturn p[i].b < p[j].b\n// \t}\n// \treturn false\n// }\n\n// ------int method-------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) int {\n\tr := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc pro(a []int) int {\n\tr := 1\n\tfor i := 0; i < len(a); i++ {\n\t\tr *= a[i]\n\t}\n\treturn r\n}\nfunc fill(a []int, n int) []int {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = n\n\t}\n\treturn a\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---------- buffered scanner -----------------------------------------\nfunc iferr(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\nfunc (s *scanner) Int() int {\n\tv, e := strconv.Atoi(s.next())\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) Ints(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = s.Int()\n\t}\n\treturn r\n}\nfunc (s *scanner) Int64() int64 {\n\tv, e := strconv.ParseInt(s.next(), 10, 64)\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) Uint64() uint64 {\n\tv, e := strconv.ParseUint(s.next(), 10, 64)\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) Float64() float64 {\n\tv, e := strconv.ParseFloat(s.next(), 64)\n\tiferr(e)\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tiferr(e)\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "sample_input": "FTFFTFFF\n4 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03490", "source_text": "Score : 500 points\n\nProblem Statement\n\nA robot is put at the origin in a two-dimensional plane.\nInitially, the robot is facing in the positive x-axis direction.\n\nThis robot will be given an instruction sequence s.\ns consists of the following two kinds of letters, and will be executed in order from front to back.\n\nF : Move in the current direction by distance 1.\n\nT : Turn 90 degrees, either clockwise or counterclockwise.\n\nThe objective of the robot is to be at coordinates (x, y) after all the instructions are executed.\nDetermine whether this objective is achievable.\n\nConstraints\n\ns consists of F and T.\n\n1 \\leq |s| \\leq 8 000\n\nx and y are integers.\n\n|x|, |y| \\leq |s|\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nx y\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\nFTFFTFFF\n4 2\n\nSample Output 1\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning clockwise in the second T.\n\nSample Input 2\n\nFTFFTFFF\n-2 -2\n\nSample Output 2\n\nYes\n\nThe objective can be achieved by, for example, turning clockwise in the first T and turning clockwise in the second T.\n\nSample Input 3\n\nFF\n1 0\n\nSample Output 3\n\nNo\n\nSample Input 4\n\nTF\n1 0\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nFFTTFF\n0 0\n\nSample Output 5\n\nYes\n\nThe objective can be achieved by, for example, turning counterclockwise in the first T and turning counterclockwise in the second T.\n\nSample Input 6\n\nTTTT\n1 0\n\nSample Output 6\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4199, "cpu_time_ms": 1902, "memory_kb": 1536}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s025379306", "group_id": "codeNet:p03491", "input_text": "package main\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\ntype Str []string\nfunc (S Str) Len() int { return len(S) }\nfunc (S Str) Less(i, j int) bool { return S[i] < S[j] }\nfunc (S Str) Swap(i, j int) { S[i], S[j] = S[j], S[i] }\n\nfunc Solve() {\n var N, L, c int\n NextInt(&N, &L)\n S := make([]string, N)\n for i := range S { S[i] = NextLine() }\n sort.Sort(Str(S))\n cnt := 0\n for j, s := range S[0] {\n if s == '1' { cnt ^= (L - j) & (j - L) }\n }\n for i := range S[1:] {\n c = 0\n for S[i][c] == S[i + 1][c] { c++ }\n for j := c + 1; j < len(S[i]); j++ {\n if S[i][j] == '0' { cnt ^= (L - j) & (j - L) }\n }\n for j := c + 1; j < len(S[i + 1]); j++ {\n if S[i + 1][j] == '1' { cnt ^= (L - j) & (j - L) }\n }\n }\n for j, s := range S[N - 1] {\n if s == '0' { cnt ^= (L - j) & (j - L) }\n }\n if cnt > 0 {\n Write(\"Alice\")\n } else {\n Write(\"Bob\")\n }\n}\n\nfunc main() {\n Solve()\n Output()\n}\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\nfunc SumInt(A ...int) int {\n sum := 0\n for _, a := range A {\n sum += a\n }\n return sum\n}\nfunc AbsInt(x int) int {\n if x < 0 { x = -x }\n return x\n}", "language": "Go", "metadata": {"date": 1591771641, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03491.html", "problem_id": "p03491", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03491/input.txt", "sample_output_relpath": "derived/input_output/data/p03491/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03491/Go/s025379306.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s025379306", "user_id": "u415905784"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": "package main\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\ntype Str []string\nfunc (S Str) Len() int { return len(S) }\nfunc (S Str) Less(i, j int) bool { return S[i] < S[j] }\nfunc (S Str) Swap(i, j int) { S[i], S[j] = S[j], S[i] }\n\nfunc Solve() {\n var N, L, c int\n NextInt(&N, &L)\n S := make([]string, N)\n for i := range S { S[i] = NextLine() }\n sort.Sort(Str(S))\n cnt := 0\n for j, s := range S[0] {\n if s == '1' { cnt ^= (L - j) & (j - L) }\n }\n for i := range S[1:] {\n c = 0\n for S[i][c] == S[i + 1][c] { c++ }\n for j := c + 1; j < len(S[i]); j++ {\n if S[i][j] == '0' { cnt ^= (L - j) & (j - L) }\n }\n for j := c + 1; j < len(S[i + 1]); j++ {\n if S[i + 1][j] == '1' { cnt ^= (L - j) & (j - L) }\n }\n }\n for j, s := range S[N - 1] {\n if s == '0' { cnt ^= (L - j) & (j - L) }\n }\n if cnt > 0 {\n Write(\"Alice\")\n } else {\n Write(\"Bob\")\n }\n}\n\nfunc main() {\n Solve()\n Output()\n}\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\nfunc SumInt(A ...int) int {\n sum := 0\n for _, a := range A {\n sum += a\n }\n return sum\n}\nfunc AbsInt(x int) int {\n if x < 0 { x = -x }\n return x\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nFor strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other.\n\nLet L be a positive integer. A set of strings S is a good string set when the following conditions hold true:\n\nEach string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1.\n\nAny two distinct strings in S are prefix-free.\n\nWe have a good string set S = \\{ s_1, s_2, ..., s_N \\}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice:\n\nAdd a new string to S. After addition, S must still be a good string set.\n\nThe first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq L \\leq 10^{18}\n\ns_1, s_2, ..., s_N are all distinct.\n\n{ s_1, s_2, ..., s_N } is a good string set.\n\n|s_1| + |s_2| + ... + |s_N| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf Alice will win, print Alice; if Bob will win, print Bob.\n\nSample Input 1\n\n2 2\n00\n01\n\nSample Output 1\n\nAlice\n\nIf Alice adds 1, Bob will be unable to add a new string.\n\nSample Input 2\n\n2 2\n00\n11\n\nSample Output 2\n\nBob\n\nThere are two strings that Alice can add on the first turn: 01 and 10.\nIn case she adds 01, if Bob add 10, she will be unable to add a new string.\nAlso, in case she adds 10, if Bob add 01, she will be unable to add a new string.\n\nSample Input 3\n\n3 3\n0\n10\n110\n\nSample Output 3\n\nAlice\n\nIf Alice adds 111, Bob will be unable to add a new string.\n\nSample Input 4\n\n2 1\n0\n1\n\nSample Output 4\n\nBob\n\nAlice is unable to add a new string on the first turn.\n\nSample Input 5\n\n1 2\n11\n\nSample Output 5\n\nAlice\n\nSample Input 6\n\n2 3\n101\n11\n\nSample Output 6\n\nBob", "sample_input": "2 2\n00\n01\n"}, "reference_outputs": ["Alice\n"], "source_document_id": "p03491", "source_text": "Score : 700 points\n\nProblem Statement\n\nFor strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other.\n\nLet L be a positive integer. A set of strings S is a good string set when the following conditions hold true:\n\nEach string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1.\n\nAny two distinct strings in S are prefix-free.\n\nWe have a good string set S = \\{ s_1, s_2, ..., s_N \\}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice:\n\nAdd a new string to S. After addition, S must still be a good string set.\n\nThe first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq L \\leq 10^{18}\n\ns_1, s_2, ..., s_N are all distinct.\n\n{ s_1, s_2, ..., s_N } is a good string set.\n\n|s_1| + |s_2| + ... + |s_N| \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN L\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf Alice will win, print Alice; if Bob will win, print Bob.\n\nSample Input 1\n\n2 2\n00\n01\n\nSample Output 1\n\nAlice\n\nIf Alice adds 1, Bob will be unable to add a new string.\n\nSample Input 2\n\n2 2\n00\n11\n\nSample Output 2\n\nBob\n\nThere are two strings that Alice can add on the first turn: 01 and 10.\nIn case she adds 01, if Bob add 10, she will be unable to add a new string.\nAlso, in case she adds 10, if Bob add 01, she will be unable to add a new string.\n\nSample Input 3\n\n3 3\n0\n10\n110\n\nSample Output 3\n\nAlice\n\nIf Alice adds 111, Bob will be unable to add a new string.\n\nSample Input 4\n\n2 1\n0\n1\n\nSample Output 4\n\nBob\n\nAlice is unable to add a new string on the first turn.\n\nSample Input 5\n\n1 2\n11\n\nSample Output 5\n\nAlice\n\nSample Input 6\n\n2 3\n101\n11\n\nSample Output 6\n\nBob", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2502, "cpu_time_ms": 5, "memory_kb": 1152}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s609918879", "group_id": "codeNet:p03494", "input_text": "package main\n\nimport \"fmt\"\n\nfunc diviedbyTwo(a int) int {\n\t// return 0 when % 2 == 1\n\tif a%2 == 0 {\n\t\treturn a / 2\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tcounter = 0\n\t)\n\tfmt.Scan(&n)\n\tblackboard := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&blackboard[i])\n\t}\n\tcondition := true\n\tfor condition {\n\t\tfor i := 0; i < n; i++ {\n\t\t\treturnN := diviedbyTwo(blackboard[i])\n\t\t\tblackboard[i] = returnN\n\t\t\tif returnN == 0 {\n\t\t\t\tcondition = false\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(blackboard)\n\t\tcounter++\n\t}\n\tfmt.Println(counter-1)\n}", "language": "Go", "metadata": {"date": 1529591576, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03494.html", "problem_id": "p03494", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03494/input.txt", "sample_output_relpath": "derived/input_output/data/p03494/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03494/Go/s609918879.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s609918879", "user_id": "u489838484"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc diviedbyTwo(a int) int {\n\t// return 0 when % 2 == 1\n\tif a%2 == 0 {\n\t\treturn a / 2\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tcounter = 0\n\t)\n\tfmt.Scan(&n)\n\tblackboard := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&blackboard[i])\n\t}\n\tcondition := true\n\tfor condition {\n\t\tfor i := 0; i < n; i++ {\n\t\t\treturnN := diviedbyTwo(blackboard[i])\n\t\t\tblackboard[i] = returnN\n\t\t\tif returnN == 0 {\n\t\t\t\tcondition = false\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(blackboard)\n\t\tcounter++\n\t}\n\tfmt.Println(counter-1)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "sample_input": "3\n8 12 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03494", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N positive integers written on a blackboard: A_1, ..., A_N.\n\nSnuke can perform the following operation when all integers on the blackboard are even:\n\nReplace each integer X on the blackboard by X divided by 2.\n\nFind the maximum possible number of operations that Snuke can perform.\n\nConstraints\n\n1 \\leq N \\leq 200\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n8 12 40\n\nSample Output 1\n\n2\n\nInitially, [8, 12, 40] are written on the blackboard.\nSince all those integers are even, Snuke can perform the operation.\n\nAfter the operation is performed once, [4, 6, 20] are written on the blackboard.\nSince all those integers are again even, he can perform the operation.\n\nAfter the operation is performed twice, [2, 3, 10] are written on the blackboard.\nNow, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.\n\nThus, Snuke can perform the operation at most twice.\n\nSample Input 2\n\n4\n5 6 8 10\n\nSample Output 2\n\n0\n\nSince there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.\n\nSample Input 3\n\n6\n382253568 723152896 37802240 379425024 404894720 471526144\n\nSample Output 3\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 539, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s026053174", "group_id": "codeNet:p03495", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, k, tmp int\n\tfmt.Scan(&n, &k)\n\n\tm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&tmp)\n\t\tm[tmp]++\n\t}\n\n\tkeys := make([]int, 0, len(m))\n\tfor key := range m {\n\t\tkeys = append(keys, key)\n\t}\n\tsort.Ints(keys)\n\n\tcount := 0\n\tfor i := 0; i < len(m)-k; i++ {\n\t\tcount += keys[i]\n\t}\n\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1512960579, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03495.html", "problem_id": "p03495", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03495/input.txt", "sample_output_relpath": "derived/input_output/data/p03495/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03495/Go/s026053174.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s026053174", "user_id": "u478134456"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, k, tmp int\n\tfmt.Scan(&n, &k)\n\n\tm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&tmp)\n\t\tm[tmp]++\n\t}\n\n\tkeys := make([]int, 0, len(m))\n\tfor key := range m {\n\t\tkeys = append(keys, key)\n\t}\n\tsort.Ints(keys)\n\n\tcount := 0\n\tfor i := 0; i < len(m)-k; i++ {\n\t\tcount += keys[i]\n\t}\n\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi has N balls. Initially, an integer A_i is written on the i-th ball.\n\nHe would like to rewrite the integer on some balls so that there are at most K different integers written on the N balls.\n\nFind the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 200000\n\n1 \\leq A_i \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nSample Input 1\n\n5 2\n1 1 2 2 5\n\nSample Output 1\n\n1\n\nFor example, if we rewrite the integer on the fifth ball to 2, there are two different integers written on the balls: 1 and 2.\nOn the other hand, it is not possible to rewrite the integers on zero balls so that there are at most two different integers written on the balls, so we should print 1.\n\nSample Input 2\n\n4 4\n1 1 2 2\n\nSample Output 2\n\n0\n\nAlready in the beginning, there are two different integers written on the balls, so we do not need to rewrite anything.\n\nSample Input 3\n\n10 3\n5 1 3 2 4 1 1 2 3 4\n\nSample Output 3\n\n3", "sample_input": "5 2\n1 1 2 2 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03495", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi has N balls. Initially, an integer A_i is written on the i-th ball.\n\nHe would like to rewrite the integer on some balls so that there are at most K different integers written on the N balls.\n\nFind the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 200000\n\n1 \\leq A_i \\leq N\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum number of balls that Takahashi needs to rewrite the integers on them.\n\nSample Input 1\n\n5 2\n1 1 2 2 5\n\nSample Output 1\n\n1\n\nFor example, if we rewrite the integer on the fifth ball to 2, there are two different integers written on the balls: 1 and 2.\nOn the other hand, it is not possible to rewrite the integers on zero balls so that there are at most two different integers written on the balls, so we should print 1.\n\nSample Input 2\n\n4 4\n1 1 2 2\n\nSample Output 2\n\n0\n\nAlready in the beginning, there are two different integers written on the balls, so we do not need to rewrite anything.\n\nSample Input 3\n\n10 3\n5 1 3 2 4 1 1 2 3 4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 367, "cpu_time_ms": 1080, "memory_kb": 12800}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s636642178", "group_id": "codeNet:p03496", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\taa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\n\tindex := solve(n, aa)\n\tfmt.Fprintln(writer, 2*n-1)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprintln(writer, fmt.Sprintf(\"%d %d\", index+1, i+1))\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tif aa[index] < 0 {\n\t\t\tfmt.Fprintln(writer, fmt.Sprintf(\"%d %d\", n-i+1, n-i))\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintln(writer, fmt.Sprintf(\"%d %d\", i, i+1))\n\t}\n\n\twriter.Flush()\n}\n\nfunc solve(n int, aa []int) int {\n\tabmax := 0\n\tabmaxi := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tabs := absint(aa[i])\n\t\tif abmax < abs {\n\t\t\tabmax = abs\n\t\t\tabmaxi = i\n\t\t}\n\t}\n\n\treturn abmaxi\n\n}\n\nfunc absint(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1564059505, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03496.html", "problem_id": "p03496", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03496/input.txt", "sample_output_relpath": "derived/input_output/data/p03496/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03496/Go/s636642178.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s636642178", "user_id": "u150542210"}, "prompt_components": {"gold_output": "2\n2 3\n3 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\taa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\n\tindex := solve(n, aa)\n\tfmt.Fprintln(writer, 2*n-1)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprintln(writer, fmt.Sprintf(\"%d %d\", index+1, i+1))\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tif aa[index] < 0 {\n\t\t\tfmt.Fprintln(writer, fmt.Sprintf(\"%d %d\", n-i+1, n-i))\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintln(writer, fmt.Sprintf(\"%d %d\", i, i+1))\n\t}\n\n\twriter.Flush()\n}\n\nfunc solve(n int, aa []int) int {\n\tabmax := 0\n\tabmaxi := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tabs := absint(aa[i])\n\t\tif abmax < abs {\n\t\t\tabmax = abs\n\t\t\tabmaxi = i\n\t\t}\n\t}\n\n\treturn abmaxi\n\n}\n\nfunc absint(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke has an integer sequence, a, of length N. The i-th element of a (1-indexed) is a_{i}.\n\nHe can perform the following operation any number of times:\n\nOperation: Choose integers x and y between 1 and N (inclusive), and add a_x to a_y.\n\nHe would like to perform this operation between 0 and 2N times (inclusive) so that a satisfies the condition below. Show one such sequence of operations.\nIt can be proved that such a sequence of operations always exists under the constraints in this problem.\n\nCondition: a_1 \\leq a_2 \\leq ... \\leq a_{N}\n\nConstraints\n\n2 \\leq N \\leq 50\n\n-10^{6} \\leq a_i \\leq 10^{6}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nLet m be the number of operations in your solution. In the first line, print m.\nIn the i-th of the subsequent m lines, print the numbers x and y chosen in the i-th operation, with a space in between.\nThe output will be considered correct if m is between 0 and 2N (inclusive) and a satisfies the condition after the m operations.\n\nSample Input 1\n\n3\n-2 5 -1\n\nSample Output 1\n\n2\n2 3\n3 3\n\nAfter the first operation, a = (-2,5,4).\n\nAfter the second operation, a = (-2,5,8), and the condition is now satisfied.\n\nSample Input 2\n\n2\n-1 -3\n\nSample Output 2\n\n1\n2 1\n\nAfter the first operation, a = (-4,-3) and the condition is now satisfied.\n\nSample Input 3\n\n5\n0 0 0 0 0\n\nSample Output 3\n\n0\n\nThe condition is satisfied already in the beginning.", "sample_input": "3\n-2 5 -1\n"}, "reference_outputs": ["2\n2 3\n3 3\n"], "source_document_id": "p03496", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke has an integer sequence, a, of length N. The i-th element of a (1-indexed) is a_{i}.\n\nHe can perform the following operation any number of times:\n\nOperation: Choose integers x and y between 1 and N (inclusive), and add a_x to a_y.\n\nHe would like to perform this operation between 0 and 2N times (inclusive) so that a satisfies the condition below. Show one such sequence of operations.\nIt can be proved that such a sequence of operations always exists under the constraints in this problem.\n\nCondition: a_1 \\leq a_2 \\leq ... \\leq a_{N}\n\nConstraints\n\n2 \\leq N \\leq 50\n\n-10^{6} \\leq a_i \\leq 10^{6}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nLet m be the number of operations in your solution. In the first line, print m.\nIn the i-th of the subsequent m lines, print the numbers x and y chosen in the i-th operation, with a space in between.\nThe output will be considered correct if m is between 0 and 2N (inclusive) and a satisfies the condition after the m operations.\n\nSample Input 1\n\n3\n-2 5 -1\n\nSample Output 1\n\n2\n2 3\n3 3\n\nAfter the first operation, a = (-2,5,4).\n\nAfter the second operation, a = (-2,5,8), and the condition is now satisfied.\n\nSample Input 2\n\n2\n-1 -3\n\nSample Output 2\n\n1\n2 1\n\nAfter the first operation, a = (-4,-3) and the condition is now satisfied.\n\nSample Input 3\n\n5\n0 0 0 0 0\n\nSample Output 3\n\n0\n\nThe condition is satisfied already in the beginning.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1401, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s177493317", "group_id": "codeNet:p03498", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, minI, maxI int\n\tFscan(in, &n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t\tif a[i] < a[minI] {\n\t\t\tminI = i\n\t\t} else if a[i] > a[maxI] {\n\t\t\tmaxI = i\n\t\t}\n\t}\n\tans := [][]int{}\n\td := 1\n\tif a[minI] < 0 && a[maxI] > 0 {\n\t\tif a[maxI] > -a[minI] {\n\t\t\tfor i, v := range a {\n\t\t\t\tif v < 0 {\n\t\t\t\t\tans = append(ans, []int{maxI + 1, i + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor i, v := range a {\n\t\t\t\tif v > 0 {\n\t\t\t\t\tans = append(ans, []int{minI + 1, i + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t\td = 0\n\t\t}\n\t} else if a[maxI] <= 0 {\n\t\td = 0\n\t}\n\tif d == 1 {\n\t\tfor i := 1; i < n; i++ {\n\t\t\tans = append(ans, []int{i, i + 1})\n\t\t}\n\t} else {\n\t\tfor i := n; i > 1; i-- {\n\t\t\tans = append(ans, []int{i, i - 1})\n\t\t}\n\t}\n\tFprintln(out, len(ans))\n\tfor _, p := range ans {\n\t\tFprintln(out, p[0], p[1])\n\t}\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "language": "Go", "metadata": {"date": 1594518901, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03498.html", "problem_id": "p03498", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03498/input.txt", "sample_output_relpath": "derived/input_output/data/p03498/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03498/Go/s177493317.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s177493317", "user_id": "u235132324"}, "prompt_components": {"gold_output": "2\n2 3\n3 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, minI, maxI int\n\tFscan(in, &n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t\tif a[i] < a[minI] {\n\t\t\tminI = i\n\t\t} else if a[i] > a[maxI] {\n\t\t\tmaxI = i\n\t\t}\n\t}\n\tans := [][]int{}\n\td := 1\n\tif a[minI] < 0 && a[maxI] > 0 {\n\t\tif a[maxI] > -a[minI] {\n\t\t\tfor i, v := range a {\n\t\t\t\tif v < 0 {\n\t\t\t\t\tans = append(ans, []int{maxI + 1, i + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor i, v := range a {\n\t\t\t\tif v > 0 {\n\t\t\t\t\tans = append(ans, []int{minI + 1, i + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t\td = 0\n\t\t}\n\t} else if a[maxI] <= 0 {\n\t\td = 0\n\t}\n\tif d == 1 {\n\t\tfor i := 1; i < n; i++ {\n\t\t\tans = append(ans, []int{i, i + 1})\n\t\t}\n\t} else {\n\t\tfor i := n; i > 1; i-- {\n\t\t\tans = append(ans, []int{i, i - 1})\n\t\t}\n\t}\n\tFprintln(out, len(ans))\n\tfor _, p := range ans {\n\t\tFprintln(out, p[0], p[1])\n\t}\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke has an integer sequence, a, of length N. The i-th element of a (1-indexed) is a_{i}.\n\nHe can perform the following operation any number of times:\n\nOperation: Choose integers x and y between 1 and N (inclusive), and add a_x to a_y.\n\nHe would like to perform this operation between 0 and 2N times (inclusive) so that a satisfies the condition below. Show one such sequence of operations.\nIt can be proved that such a sequence of operations always exists under the constraints in this problem.\n\nCondition: a_1 \\leq a_2 \\leq ... \\leq a_{N}\n\nConstraints\n\n2 \\leq N \\leq 50\n\n-10^{6} \\leq a_i \\leq 10^{6}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nLet m be the number of operations in your solution. In the first line, print m.\nIn the i-th of the subsequent m lines, print the numbers x and y chosen in the i-th operation, with a space in between.\nThe output will be considered correct if m is between 0 and 2N (inclusive) and a satisfies the condition after the m operations.\n\nSample Input 1\n\n3\n-2 5 -1\n\nSample Output 1\n\n2\n2 3\n3 3\n\nAfter the first operation, a = (-2,5,4).\n\nAfter the second operation, a = (-2,5,8), and the condition is now satisfied.\n\nSample Input 2\n\n2\n-1 -3\n\nSample Output 2\n\n1\n2 1\n\nAfter the first operation, a = (-4,-3) and the condition is now satisfied.\n\nSample Input 3\n\n5\n0 0 0 0 0\n\nSample Output 3\n\n0\n\nThe condition is satisfied already in the beginning.", "sample_input": "3\n-2 5 -1\n"}, "reference_outputs": ["2\n2 3\n3 3\n"], "source_document_id": "p03498", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke has an integer sequence, a, of length N. The i-th element of a (1-indexed) is a_{i}.\n\nHe can perform the following operation any number of times:\n\nOperation: Choose integers x and y between 1 and N (inclusive), and add a_x to a_y.\n\nHe would like to perform this operation between 0 and 2N times (inclusive) so that a satisfies the condition below. Show one such sequence of operations.\nIt can be proved that such a sequence of operations always exists under the constraints in this problem.\n\nCondition: a_1 \\leq a_2 \\leq ... \\leq a_{N}\n\nConstraints\n\n2 \\leq N \\leq 50\n\n-10^{6} \\leq a_i \\leq 10^{6}\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{N}\n\nOutput\n\nLet m be the number of operations in your solution. In the first line, print m.\nIn the i-th of the subsequent m lines, print the numbers x and y chosen in the i-th operation, with a space in between.\nThe output will be considered correct if m is between 0 and 2N (inclusive) and a satisfies the condition after the m operations.\n\nSample Input 1\n\n3\n-2 5 -1\n\nSample Output 1\n\n2\n2 3\n3 3\n\nAfter the first operation, a = (-2,5,4).\n\nAfter the second operation, a = (-2,5,8), and the condition is now satisfied.\n\nSample Input 2\n\n2\n-1 -3\n\nSample Output 2\n\n1\n2 1\n\nAfter the first operation, a = (-4,-3) and the condition is now satisfied.\n\nSample Input 3\n\n5\n0 0 0 0 0\n\nSample Output 3\n\n0\n\nThe condition is satisfied already in the beginning.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1022, "cpu_time_ms": 7, "memory_kb": 1868}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s131170850", "group_id": "codeNet:p03501", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\ta := readInt()\n\tb := readInt()\n\n\tprintln(minInt(n*a, b))\n}\n", "language": "Go", "metadata": {"date": 1532311263, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03501.html", "problem_id": "p03501", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03501/input.txt", "sample_output_relpath": "derived/input_output/data/p03501/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03501/Go/s131170850.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s131170850", "user_id": "u705974985"}, "prompt_components": {"gold_output": "119\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\ta := readInt()\n\tb := readInt()\n\n\tprintln(minInt(n*a, b))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are parking at a parking lot. You can choose from the following two fee plans:\n\nPlan 1: The fee will be A×T yen (the currency of Japan) when you park for T hours.\n\nPlan 2: The fee will be B yen, regardless of the duration.\n\nFind the minimum fee when you park for N hours.\n\nConstraints\n\n1≤N≤20\n\n1≤A≤100\n\n1≤B≤2000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nWhen the minimum fee is x yen, print the value of x.\n\nSample Input 1\n\n7 17 120\n\nSample Output 1\n\n119\n\nIf you choose Plan 1, the fee will be 7×17=119 yen.\n\nIf you choose Plan 2, the fee will be 120 yen.\n\nThus, the minimum fee is 119 yen.\n\nSample Input 2\n\n5 20 100\n\nSample Output 2\n\n100\n\nThe fee might be the same in the two plans.\n\nSample Input 3\n\n6 18 100\n\nSample Output 3\n\n100", "sample_input": "7 17 120\n"}, "reference_outputs": ["119\n"], "source_document_id": "p03501", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are parking at a parking lot. You can choose from the following two fee plans:\n\nPlan 1: The fee will be A×T yen (the currency of Japan) when you park for T hours.\n\nPlan 2: The fee will be B yen, regardless of the duration.\n\nFind the minimum fee when you park for N hours.\n\nConstraints\n\n1≤N≤20\n\n1≤A≤100\n\n1≤B≤2000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nWhen the minimum fee is x yen, print the value of x.\n\nSample Input 1\n\n7 17 120\n\nSample Output 1\n\n119\n\nIf you choose Plan 1, the fee will be 7×17=119 yen.\n\nIf you choose Plan 2, the fee will be 120 yen.\n\nThus, the minimum fee is 119 yen.\n\nSample Input 2\n\n5 20 100\n\nSample Output 2\n\n100\n\nThe fee might be the same in the two plans.\n\nSample Input 3\n\n6 18 100\n\nSample Output 3\n\n100", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1936, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s606018782", "group_id": "codeNet:p03502", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\tfx := getDigitSum(x)\n\n\tif x%fx == 0 {\n\t\tfmt.Printf(\"Yes\")\n\t} else {\n\t\tfmt.Printf(\"No\")\n\t}\n\n}\n\nfunc getDigitSum(n int) int {\n\tvar total int\n\tfor n > 0 {\n\t\ttotal = n % 10\n\t\tn /= 10\n\t}\n\treturn total\n}\n", "language": "Go", "metadata": {"date": 1596472367, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03502.html", "problem_id": "p03502", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03502/input.txt", "sample_output_relpath": "derived/input_output/data/p03502/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03502/Go/s606018782.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s606018782", "user_id": "u763116131"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\tfx := getDigitSum(x)\n\n\tif x%fx == 0 {\n\t\tfmt.Printf(\"Yes\")\n\t} else {\n\t\tfmt.Printf(\"No\")\n\t}\n\n}\n\nfunc getDigitSum(n int) int {\n\tvar total int\n\tfor n > 0 {\n\t\ttotal = n % 10\n\t\tn /= 10\n\t}\n\treturn total\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03502", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 273, "cpu_time_ms": 6, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s505168818", "group_id": "codeNet:p03502", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar sum int // nの各桁の和\n\tfor x := n; x > 0; {\n\t\tsum += x % 10\n\t\tx /= 10\n\t}\n\n\tif n%sum == 0 {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1551914339, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03502.html", "problem_id": "p03502", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03502/input.txt", "sample_output_relpath": "derived/input_output/data/p03502/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03502/Go/s505168818.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s505168818", "user_id": "u543933043"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar sum int // nの各桁の和\n\tfor x := n; x > 0; {\n\t\tsum += x % 10\n\t\tx /= 10\n\t}\n\n\tif n%sum == 0 {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03502", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 224, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s191614560", "group_id": "codeNet:p03502", "input_text": "package main\n\nimport \"fmt\"\n\nfunc sum_digits(n int) int {\n\tif n < 10 {\n\t\treturn n\n\t} else {\n\t\treturn n%10 + sum_digits(n/10)\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%sum_digits(n) == 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1548648970, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03502.html", "problem_id": "p03502", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03502/input.txt", "sample_output_relpath": "derived/input_output/data/p03502/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03502/Go/s191614560.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s191614560", "user_id": "u113872560"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc sum_digits(n int) int {\n\tif n < 10 {\n\t\treturn n\n\t} else {\n\t\treturn n%10 + sum_digits(n/10)\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%sum_digits(n) == 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03502", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s014423089", "group_id": "codeNet:p03502", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\n\tM := N\n\tk := 0\n\tfor M > 0 {\n\t\tk += M % 10\n\t\tM /= 10\n\t}\n\tif N%k == 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1512352985, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03502.html", "problem_id": "p03502", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03502/input.txt", "sample_output_relpath": "derived/input_output/data/p03502/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03502/Go/s014423089.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s014423089", "user_id": "u504669764"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\n\tM := N\n\tk := 0\n\tfor M > 0 {\n\t\tk += M % 10\n\t\tM /= 10\n\t}\n\tif N%k == 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "sample_input": "12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03502", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\n\nGiven an integer N, determine whether it is a Harshad number.\n\nConstraints\n\n1?N?10^8\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint Yes if N is a Harshad number; print No otherwise.\n\nSample Input 1\n\n12\n\nSample Output 1\n\nYes\n\nf(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.\n\nSample Input 2\n\n57\n\nSample Output 2\n\nNo\n\nf(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.\n\nSample Input 3\n\n148\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2068, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s995322781", "group_id": "codeNet:p03524", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tS := readBytes()\n\tcount := make([]int, 3)\n\tfor i := range S {\n\t\tcount[S[i]-'a']++\n\t}\n\tsort.Ints(count)\n\tif count[2]-1 <= count[1] && count[2]-1 <= count[0] {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1558794551, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03524.html", "problem_id": "p03524", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03524/input.txt", "sample_output_relpath": "derived/input_output/data/p03524/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03524/Go/s995322781.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s995322781", "user_id": "u705974985"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tS := readBytes()\n\tcount := make([]int, 3)\n\tfor i := range S {\n\t\tcount[S[i]-'a']++\n\t}\n\tsort.Ints(count)\n\tif count[2]-1 <= count[1] && count[2]-1 <= count[0] {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n\n// -----------------------------------------------------------------------------\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has a string S consisting of three kinds of letters: a, b and c.\n\nHe has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the objective is achievable, print YES; if it is unachievable, print NO.\n\nSample Input 1\n\nabac\n\nSample Output 1\n\nYES\n\nAs it stands now, S contains a palindrome aba, but we can permute the characters to get acba, for example, that does not contain a palindrome of length 2 or more.\n\nSample Input 2\n\naba\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nbabacccabab\n\nSample Output 3\n\nYES", "sample_input": "abac\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03524", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has a string S consisting of three kinds of letters: a, b and c.\n\nHe has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of a, b and c.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the objective is achievable, print YES; if it is unachievable, print NO.\n\nSample Input 1\n\nabac\n\nSample Output 1\n\nYES\n\nAs it stands now, S contains a palindrome aba, but we can permute the characters to get acba, for example, that does not contain a palindrome of length 2 or more.\n\nSample Input 2\n\naba\n\nSample Output 2\n\nNO\n\nSample Input 3\n\nbabacccabab\n\nSample Output 3\n\nYES", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1817, "cpu_time_ms": 5, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s130297623", "group_id": "codeNet:p03543", "input_text": "package main\nimport \"fmt\"\n\nfunc main() {\n\n var input string\n fmt.Scan(&input)\n list := make(map[rune]int)\n for _,element := range input {\n \t if _, ok := list[element]; ok {\n list[element] += 1\n } else {\n list[element] = 1\n }\n }\n result := false\n for _,val := range list {\n if val >= 3 {\n result = true\n break\n }\n }\n \n if result {\n fmt.Printf(\"Yes\")\n } else {\n fmt.Printf(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1553280947, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03543.html", "problem_id": "p03543", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03543/input.txt", "sample_output_relpath": "derived/input_output/data/p03543/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03543/Go/s130297623.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s130297623", "user_id": "u924715151"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\nfunc main() {\n\n var input string\n fmt.Scan(&input)\n list := make(map[rune]int)\n for _,element := range input {\n \t if _, ok := list[element]; ok {\n list[element] += 1\n } else {\n list[element] = 1\n }\n }\n result := false\n for _,val := range list {\n if val >= 3 {\n result = true\n break\n }\n }\n \n if result {\n fmt.Printf(\"Yes\")\n } else {\n fmt.Printf(\"No\")\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe call a 4-digit integer with three or more consecutive same digits, such as 1118, good.\n\nYou are given a 4-digit integer N. Answer the question: Is N good?\n\nConstraints\n\n1000 ≤ N ≤ 9999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is good, print Yes; otherwise, print No.\n\nSample Input 1\n\n1118\n\nSample Output 1\n\nYes\n\nN is good, since it contains three consecutive 1.\n\nSample Input 2\n\n7777\n\nSample Output 2\n\nYes\n\nAn integer is also good when all the digits are the same.\n\nSample Input 3\n\n1234\n\nSample Output 3\n\nNo", "sample_input": "1118\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03543", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe call a 4-digit integer with three or more consecutive same digits, such as 1118, good.\n\nYou are given a 4-digit integer N. Answer the question: Is N good?\n\nConstraints\n\n1000 ≤ N ≤ 9999\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is good, print Yes; otherwise, print No.\n\nSample Input 1\n\n1118\n\nSample Output 1\n\nYes\n\nN is good, since it contains three consecutive 1.\n\nSample Input 2\n\n7777\n\nSample Output 2\n\nYes\n\nAn integer is also good when all the digits are the same.\n\nSample Input 3\n\n1234\n\nSample Output 3\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 438, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s534871954", "group_id": "codeNet:p03544", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tL := make([]int,N+1)\n\tL[0] = 2\n\tL[1] = 1\n\n\tfor i := 2; i <= N; i++{\n\t\tL[i] = L[i-1] + L[i-2]\n\t}\t\n\t\n\tfmt.Println(L[N])\n\n}", "language": "Go", "metadata": {"date": 1577550424, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03544.html", "problem_id": "p03544", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03544/input.txt", "sample_output_relpath": "derived/input_output/data/p03544/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03544/Go/s534871954.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s534871954", "user_id": "u689167014"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tL := make([]int,N+1)\n\tL[0] = 2\n\tL[1] = 1\n\n\tfor i := 2; i <= N; i++{\n\t\tL[i] = L[i-1] + L[i-2]\n\t}\t\n\t\n\tfmt.Println(L[N])\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.\n\nYou are given an integer N. Find the N-th Lucas number.\n\nHere, the i-th Lucas number L_i is defined as follows:\n\nL_0=2\n\nL_1=1\n\nL_i=L_{i-1}+L_{i-2} (i≥2)\n\nConstraints\n\n1≤N≤86\n\nIt is guaranteed that the answer is less than 10^{18}.\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the N-th Lucas number.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n11\n\nL_0=2\n\nL_1=1\n\nL_2=L_0+L_1=3\n\nL_3=L_1+L_2=4\n\nL_4=L_2+L_3=7\n\nL_5=L_3+L_4=11\n\nThus, the 5-th Lucas number is 11.\n\nSample Input 2\n\n86\n\nSample Output 2\n\n939587134549734843", "sample_input": "5\n"}, "reference_outputs": ["11\n"], "source_document_id": "p03544", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.\n\nYou are given an integer N. Find the N-th Lucas number.\n\nHere, the i-th Lucas number L_i is defined as follows:\n\nL_0=2\n\nL_1=1\n\nL_i=L_{i-1}+L_{i-2} (i≥2)\n\nConstraints\n\n1≤N≤86\n\nIt is guaranteed that the answer is less than 10^{18}.\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the N-th Lucas number.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n11\n\nL_0=2\n\nL_1=1\n\nL_2=L_0+L_1=3\n\nL_3=L_1+L_2=4\n\nL_4=L_2+L_3=7\n\nL_5=L_3+L_4=11\n\nThus, the 5-th Lucas number is 11.\n\nSample Input 2\n\n86\n\nSample Output 2\n\n939587134549734843", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 194, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s585398689", "group_id": "codeNet:p03545", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst mod = 1000000007\n\n// 1MB\nconst ioBufferSize = 1 * 1024 * 1024\n\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tn := nextInt()\n\ta, b, c, d := n/1000, (n/100)%10, (n/10)%10, n%10\n\n\tif a+b+c+d == 7 {\n\t\tfmt.Printf(\"%d+%d+%d+%d=7\\n\", a, b, c, d)\n\t} else if a+b+c-d == 7 {\n\t\tfmt.Printf(\"%d+%d+%d-%d=7\\n\", a, b, c, d)\n\t} else if a+b-c+d == 7 {\n\t\tfmt.Printf(\"%d+%d-%d+%d=7\\n\", a, b, c, d)\n\t} else if a+b-c-d == 7 {\n\t\tfmt.Printf(\"%d+%d-%d-%d=7\\n\", a, b, c, d)\n\t} else if a-b+c+d == 7 {\n\t\tfmt.Printf(\"%d-%d+%d+%d=7\\n\", a, b, c, d)\n\t} else if a-b+c-d == 7 {\n\t\tfmt.Printf(\"%d-%d+%d-%d=7\\n\", a, b, c, d)\n\t} else if a-b-c+d == 7 {\n\t\tfmt.Printf(\"%d-%d-%d+%d=7\\n\", a, b, c, d)\n\t} else if a-b-c-d == 7 {\n\t\tfmt.Printf(\"%d-%d-%d-%d=7\\n\", a, b, c, d)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592458562, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03545.html", "problem_id": "p03545", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03545/input.txt", "sample_output_relpath": "derived/input_output/data/p03545/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03545/Go/s585398689.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s585398689", "user_id": "u703739962"}, "prompt_components": {"gold_output": "1+2+2+2=7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst mod = 1000000007\n\n// 1MB\nconst ioBufferSize = 1 * 1024 * 1024\n\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tn := nextInt()\n\ta, b, c, d := n/1000, (n/100)%10, (n/10)%10, n%10\n\n\tif a+b+c+d == 7 {\n\t\tfmt.Printf(\"%d+%d+%d+%d=7\\n\", a, b, c, d)\n\t} else if a+b+c-d == 7 {\n\t\tfmt.Printf(\"%d+%d+%d-%d=7\\n\", a, b, c, d)\n\t} else if a+b-c+d == 7 {\n\t\tfmt.Printf(\"%d+%d-%d+%d=7\\n\", a, b, c, d)\n\t} else if a+b-c-d == 7 {\n\t\tfmt.Printf(\"%d+%d-%d-%d=7\\n\", a, b, c, d)\n\t} else if a-b+c+d == 7 {\n\t\tfmt.Printf(\"%d-%d+%d+%d=7\\n\", a, b, c, d)\n\t} else if a-b+c-d == 7 {\n\t\tfmt.Printf(\"%d-%d+%d-%d=7\\n\", a, b, c, d)\n\t} else if a-b-c+d == 7 {\n\t\tfmt.Printf(\"%d-%d-%d+%d=7\\n\", a, b, c, d)\n\t} else if a-b-c-d == 7 {\n\t\tfmt.Printf(\"%d-%d-%d-%d=7\\n\", a, b, c, d)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "sample_input": "1222\n"}, "reference_outputs": ["1+2+2+2=7\n"], "source_document_id": "p03545", "source_text": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1153, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s750355992", "group_id": "codeNet:p03545", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar ans = \"\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tar := make([]int, 4)\n\n\tfor i, v := range s {\n\t\tar[i] = int(v - '0')\n\t}\n\tf(0, ar[0], s[0:1], ar)\n\tfmt.Println(ans)\n}\n\nfunc f(n, sum int, s string, ar []int) {\n\tif n == 3 {\n\t\tif sum == 7 {\n\t\t\tans = s + \"=7\"\n\t\t}\n\t\treturn\n\t}\n\tf(n+1, sum+ar[n+1], s+\"+\"+fmt.Sprintf(\"%d\", ar[n+1]), ar)\n\tf(n+1, sum-ar[n+1], s+\"-\"+fmt.Sprintf(\"%d\", ar[n+1]), ar)\n}\n", "language": "Go", "metadata": {"date": 1558479474, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03545.html", "problem_id": "p03545", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03545/input.txt", "sample_output_relpath": "derived/input_output/data/p03545/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03545/Go/s750355992.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s750355992", "user_id": "u375977529"}, "prompt_components": {"gold_output": "1+2+2+2=7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar ans = \"\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tar := make([]int, 4)\n\n\tfor i, v := range s {\n\t\tar[i] = int(v - '0')\n\t}\n\tf(0, ar[0], s[0:1], ar)\n\tfmt.Println(ans)\n}\n\nfunc f(n, sum int, s string, ar []int) {\n\tif n == 3 {\n\t\tif sum == 7 {\n\t\t\tans = s + \"=7\"\n\t\t}\n\t\treturn\n\t}\n\tf(n+1, sum+ar[n+1], s+\"+\"+fmt.Sprintf(\"%d\", ar[n+1]), ar)\n\tf(n+1, sum-ar[n+1], s+\"-\"+fmt.Sprintf(\"%d\", ar[n+1]), ar)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "sample_input": "1222\n"}, "reference_outputs": ["1+2+2+2=7\n"], "source_document_id": "p03545", "source_text": "Score : 300 points\n\nProblem Statement\n\nSitting in a station waiting room, Joisino is gazing at her train ticket.\n\nThe ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).\n\nIn the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.\n\nThe given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.\n\nConstraints\n\n0≤A,B,C,D≤9\n\nAll input values are integers.\n\nIt is guaranteed that there is a solution.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nABCD\n\nOutput\n\nPrint the formula you made, including the part =7.\n\nUse the signs + and -.\n\nDo not print a space between a digit and a sign.\n\nSample Input 1\n\n1222\n\nSample Output 1\n\n1+2+2+2=7\n\nThis is the only valid solution.\n\nSample Input 2\n\n0290\n\nSample Output 2\n\n0-2+9+0=7\n\n0 - 2 + 9 - 0 = 7 is also a valid solution.\n\nSample Input 3\n\n3242\n\nSample Output 3\n\n3+2+4-2=7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 431, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s648530250", "group_id": "codeNet:p03546", "input_text": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar h, w int\n\tvar dp [10][10]int\n\tfmt.Scan(&h, &w)\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tfmt.Scan(&dp[i][j])\n\t\t}\n\t}\n\tfor k := 0; k < 10; k++ {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\tdp[i][j] = min(dp[i][k]+dp[k][j], dp[i][j])\n\t\t\t}\n\t\t}\n\t}\n\tset := make(map[int]int, 0)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tvar v int\n\t\t\tfmt.Scan(&v)\n\t\t\tif v != -1 && v != 1 {\n\t\t\t\tset[v]++\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor k, v := range set {\n\t\tans += dp[k][1] * v\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1579917925, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03546.html", "problem_id": "p03546", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03546/input.txt", "sample_output_relpath": "derived/input_output/data/p03546/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03546/Go/s648530250.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s648530250", "user_id": "u196030116"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar h, w int\n\tvar dp [10][10]int\n\tfmt.Scan(&h, &w)\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tfmt.Scan(&dp[i][j])\n\t\t}\n\t}\n\tfor k := 0; k < 10; k++ {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\tdp[i][j] = min(dp[i][k]+dp[k][j], dp[i][j])\n\t\t\t}\n\t\t}\n\t}\n\tset := make(map[int]int, 0)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tvar v int\n\t\t\tfmt.Scan(&v)\n\t\t\tif v != -1 && v != 1 {\n\t\t\t\tset[v]++\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor k, v := range set {\n\t\tans += dp[k][1] * v\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nJoisino the magical girl has decided to turn every single digit that exists on this world into 1.\n\nRewriting a digit i with j (0≤i,j≤9) costs c_{i,j} MP (Magic Points).\n\nShe is now standing before a wall. The wall is divided into HW squares in H rows and W columns, and at least one square contains a digit between 0 and 9 (inclusive).\n\nYou are given A_{i,j} that describes the square at the i-th row from the top and j-th column from the left, as follows:\n\nIf A_{i,j}≠-1, the square contains a digit A_{i,j}.\n\nIf A_{i,j}=-1, the square does not contain a digit.\n\nFind the minimum total amount of MP required to turn every digit on this wall into 1 in the end.\n\nConstraints\n\n1≤H,W≤200\n\n1≤c_{i,j}≤10^3 (i≠j)\n\nc_{i,j}=0 (i=j)\n\n-1≤A_{i,j}≤9\n\nAll input values are integers.\n\nThere is at least one digit on the wall.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nc_{0,0} ... c_{0,9}\n:\nc_{9,0} ... c_{9,9}\nA_{1,1} ... A_{1,W}\n:\nA_{H,1} ... A_{H,W}\n\nOutput\n\nPrint the minimum total amount of MP required to turn every digit on the wall into 1 in the end.\n\nSample Input 1\n\n2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n\nSample Output 1\n\n12\n\nTo turn a single 8 into 1, it is optimal to first turn 8 into 4, then turn 4 into 9, and finally turn 9 into 1, costing 6 MP.\n\nThe wall contains two 8s, so the minimum total MP required is 6×2=12.\n\nSample Input 2\n\n5 5\n0 999 999 999 999 999 999 999 999 999\n999 0 999 999 999 999 999 999 999 999\n999 999 0 999 999 999 999 999 999 999\n999 999 999 0 999 999 999 999 999 999\n999 999 999 999 0 999 999 999 999 999\n999 999 999 999 999 0 999 999 999 999\n999 999 999 999 999 999 0 999 999 999\n999 999 999 999 999 999 999 0 999 999\n999 999 999 999 999 999 999 999 0 999\n999 999 999 999 999 999 999 999 999 0\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\n\nSample Output 2\n\n0\n\nNote that she may not need to change any digit.\n\nSample Input 3\n\n3 5\n0 4 3 6 2 7 2 5 3 3\n4 0 5 3 7 5 3 7 2 7\n5 7 0 7 2 9 3 2 9 1\n3 6 2 0 2 4 6 4 2 3\n3 5 7 4 0 6 9 7 6 7\n9 8 5 2 2 0 4 7 6 5\n5 4 6 3 2 3 0 5 4 3\n3 6 2 3 4 2 4 0 8 9\n4 6 5 4 3 5 3 2 0 8\n2 1 3 4 5 7 8 6 4 0\n3 5 2 6 1\n2 5 3 2 1\n6 9 2 5 6\n\nSample Output 3\n\n47", "sample_input": "2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03546", "source_text": "Score : 400 points\n\nProblem Statement\n\nJoisino the magical girl has decided to turn every single digit that exists on this world into 1.\n\nRewriting a digit i with j (0≤i,j≤9) costs c_{i,j} MP (Magic Points).\n\nShe is now standing before a wall. The wall is divided into HW squares in H rows and W columns, and at least one square contains a digit between 0 and 9 (inclusive).\n\nYou are given A_{i,j} that describes the square at the i-th row from the top and j-th column from the left, as follows:\n\nIf A_{i,j}≠-1, the square contains a digit A_{i,j}.\n\nIf A_{i,j}=-1, the square does not contain a digit.\n\nFind the minimum total amount of MP required to turn every digit on this wall into 1 in the end.\n\nConstraints\n\n1≤H,W≤200\n\n1≤c_{i,j}≤10^3 (i≠j)\n\nc_{i,j}=0 (i=j)\n\n-1≤A_{i,j}≤9\n\nAll input values are integers.\n\nThere is at least one digit on the wall.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nc_{0,0} ... c_{0,9}\n:\nc_{9,0} ... c_{9,9}\nA_{1,1} ... A_{1,W}\n:\nA_{H,1} ... A_{H,W}\n\nOutput\n\nPrint the minimum total amount of MP required to turn every digit on the wall into 1 in the end.\n\nSample Input 1\n\n2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n\nSample Output 1\n\n12\n\nTo turn a single 8 into 1, it is optimal to first turn 8 into 4, then turn 4 into 9, and finally turn 9 into 1, costing 6 MP.\n\nThe wall contains two 8s, so the minimum total MP required is 6×2=12.\n\nSample Input 2\n\n5 5\n0 999 999 999 999 999 999 999 999 999\n999 0 999 999 999 999 999 999 999 999\n999 999 0 999 999 999 999 999 999 999\n999 999 999 0 999 999 999 999 999 999\n999 999 999 999 0 999 999 999 999 999\n999 999 999 999 999 0 999 999 999 999\n999 999 999 999 999 999 0 999 999 999\n999 999 999 999 999 999 999 0 999 999\n999 999 999 999 999 999 999 999 0 999\n999 999 999 999 999 999 999 999 999 0\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\n\nSample Output 2\n\n0\n\nNote that she may not need to change any digit.\n\nSample Input 3\n\n3 5\n0 4 3 6 2 7 2 5 3 3\n4 0 5 3 7 5 3 7 2 7\n5 7 0 7 2 9 3 2 9 1\n3 6 2 0 2 4 6 4 2 3\n3 5 7 4 0 6 9 7 6 7\n9 8 5 2 2 0 4 7 6 5\n5 4 6 3 2 3 0 5 4 3\n3 6 2 3 4 2 4 0 8 9\n4 6 5 4 3 5 3 2 0 8\n2 1 3 4 5 7 8 6 4 0\n3 5 2 6 1\n2 5 3 2 1\n6 9 2 5 6\n\nSample Output 3\n\n47", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 629, "cpu_time_ms": 108, "memory_kb": 3200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s637407483", "group_id": "codeNet:p03546", "input_text": "package main\n\nimport (\n\t. \"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := newScanner()\n\th, w := next.Int(), next.Int()\n\tc := make([][]int, 10)\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\ta := next.Int()\n\n\t\t\tc[i] = append(c[i], a)\n\t\t}\n\t}\n\tfor k := 0; k < 10; k++ {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\tc[i][j] = min(c[i][j], c[i][k] + c[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\ta := next.Int()\n\n\t\t\tif a == -1 {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tans += c[a][1]\n\t\t\t}\n\t\t}\n\t}\n\n\tPrintln(ans)\n}\n\n// Scanner begin\n\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc newScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Scanner end\n\n// Standard Function begin\n\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\n// Standard Struct begin\n\ntype pair struct {\n\tfirst, second int\n}\n\ntype pairs []pair\n\nfunc Newpair() *pair {\n\treturn &pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\tif p[i].first < p[j].first {\n\t\treturn true\n\t} else if p[i].first == p[j].first {\n\t\treturn p[i].second < p[j].second\n\t} else {\n\t\treturn false\n\t}\n}\n", "language": "Go", "metadata": {"date": 1529870336, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03546.html", "problem_id": "p03546", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03546/input.txt", "sample_output_relpath": "derived/input_output/data/p03546/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03546/Go/s637407483.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s637407483", "user_id": "u424655672"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t. \"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := newScanner()\n\th, w := next.Int(), next.Int()\n\tc := make([][]int, 10)\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\ta := next.Int()\n\n\t\t\tc[i] = append(c[i], a)\n\t\t}\n\t}\n\tfor k := 0; k < 10; k++ {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tfor j := 0; j < 10; j++ {\n\t\t\t\tc[i][j] = min(c[i][j], c[i][k] + c[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\ta := next.Int()\n\n\t\t\tif a == -1 {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tans += c[a][1]\n\t\t\t}\n\t\t}\n\t}\n\n\tPrintln(ans)\n}\n\n// Scanner begin\n\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc newScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Scanner end\n\n// Standard Function begin\n\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\n// Standard Struct begin\n\ntype pair struct {\n\tfirst, second int\n}\n\ntype pairs []pair\n\nfunc Newpair() *pair {\n\treturn &pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\tif p[i].first < p[j].first {\n\t\treturn true\n\t} else if p[i].first == p[j].first {\n\t\treturn p[i].second < p[j].second\n\t} else {\n\t\treturn false\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nJoisino the magical girl has decided to turn every single digit that exists on this world into 1.\n\nRewriting a digit i with j (0≤i,j≤9) costs c_{i,j} MP (Magic Points).\n\nShe is now standing before a wall. The wall is divided into HW squares in H rows and W columns, and at least one square contains a digit between 0 and 9 (inclusive).\n\nYou are given A_{i,j} that describes the square at the i-th row from the top and j-th column from the left, as follows:\n\nIf A_{i,j}≠-1, the square contains a digit A_{i,j}.\n\nIf A_{i,j}=-1, the square does not contain a digit.\n\nFind the minimum total amount of MP required to turn every digit on this wall into 1 in the end.\n\nConstraints\n\n1≤H,W≤200\n\n1≤c_{i,j}≤10^3 (i≠j)\n\nc_{i,j}=0 (i=j)\n\n-1≤A_{i,j}≤9\n\nAll input values are integers.\n\nThere is at least one digit on the wall.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nc_{0,0} ... c_{0,9}\n:\nc_{9,0} ... c_{9,9}\nA_{1,1} ... A_{1,W}\n:\nA_{H,1} ... A_{H,W}\n\nOutput\n\nPrint the minimum total amount of MP required to turn every digit on the wall into 1 in the end.\n\nSample Input 1\n\n2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n\nSample Output 1\n\n12\n\nTo turn a single 8 into 1, it is optimal to first turn 8 into 4, then turn 4 into 9, and finally turn 9 into 1, costing 6 MP.\n\nThe wall contains two 8s, so the minimum total MP required is 6×2=12.\n\nSample Input 2\n\n5 5\n0 999 999 999 999 999 999 999 999 999\n999 0 999 999 999 999 999 999 999 999\n999 999 0 999 999 999 999 999 999 999\n999 999 999 0 999 999 999 999 999 999\n999 999 999 999 0 999 999 999 999 999\n999 999 999 999 999 0 999 999 999 999\n999 999 999 999 999 999 0 999 999 999\n999 999 999 999 999 999 999 0 999 999\n999 999 999 999 999 999 999 999 0 999\n999 999 999 999 999 999 999 999 999 0\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\n\nSample Output 2\n\n0\n\nNote that she may not need to change any digit.\n\nSample Input 3\n\n3 5\n0 4 3 6 2 7 2 5 3 3\n4 0 5 3 7 5 3 7 2 7\n5 7 0 7 2 9 3 2 9 1\n3 6 2 0 2 4 6 4 2 3\n3 5 7 4 0 6 9 7 6 7\n9 8 5 2 2 0 4 7 6 5\n5 4 6 3 2 3 0 5 4 3\n3 6 2 3 4 2 4 0 8 9\n4 6 5 4 3 5 3 2 0 8\n2 1 3 4 5 7 8 6 4 0\n3 5 2 6 1\n2 5 3 2 1\n6 9 2 5 6\n\nSample Output 3\n\n47", "sample_input": "2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03546", "source_text": "Score : 400 points\n\nProblem Statement\n\nJoisino the magical girl has decided to turn every single digit that exists on this world into 1.\n\nRewriting a digit i with j (0≤i,j≤9) costs c_{i,j} MP (Magic Points).\n\nShe is now standing before a wall. The wall is divided into HW squares in H rows and W columns, and at least one square contains a digit between 0 and 9 (inclusive).\n\nYou are given A_{i,j} that describes the square at the i-th row from the top and j-th column from the left, as follows:\n\nIf A_{i,j}≠-1, the square contains a digit A_{i,j}.\n\nIf A_{i,j}=-1, the square does not contain a digit.\n\nFind the minimum total amount of MP required to turn every digit on this wall into 1 in the end.\n\nConstraints\n\n1≤H,W≤200\n\n1≤c_{i,j}≤10^3 (i≠j)\n\nc_{i,j}=0 (i=j)\n\n-1≤A_{i,j}≤9\n\nAll input values are integers.\n\nThere is at least one digit on the wall.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nc_{0,0} ... c_{0,9}\n:\nc_{9,0} ... c_{9,9}\nA_{1,1} ... A_{1,W}\n:\nA_{H,1} ... A_{H,W}\n\nOutput\n\nPrint the minimum total amount of MP required to turn every digit on the wall into 1 in the end.\n\nSample Input 1\n\n2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n\nSample Output 1\n\n12\n\nTo turn a single 8 into 1, it is optimal to first turn 8 into 4, then turn 4 into 9, and finally turn 9 into 1, costing 6 MP.\n\nThe wall contains two 8s, so the minimum total MP required is 6×2=12.\n\nSample Input 2\n\n5 5\n0 999 999 999 999 999 999 999 999 999\n999 0 999 999 999 999 999 999 999 999\n999 999 0 999 999 999 999 999 999 999\n999 999 999 0 999 999 999 999 999 999\n999 999 999 999 0 999 999 999 999 999\n999 999 999 999 999 0 999 999 999 999\n999 999 999 999 999 999 0 999 999 999\n999 999 999 999 999 999 999 0 999 999\n999 999 999 999 999 999 999 999 0 999\n999 999 999 999 999 999 999 999 999 0\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\n\nSample Output 2\n\n0\n\nNote that she may not need to change any digit.\n\nSample Input 3\n\n3 5\n0 4 3 6 2 7 2 5 3 3\n4 0 5 3 7 5 3 7 2 7\n5 7 0 7 2 9 3 2 9 1\n3 6 2 0 2 4 6 4 2 3\n3 5 7 4 0 6 9 7 6 7\n9 8 5 2 2 0 4 7 6 5\n5 4 6 3 2 3 0 5 4 3\n3 6 2 3 4 2 4 0 8 9\n4 6 5 4 3 5 3 2 0 8\n2 1 3 4 5 7 8 6 4 0\n3 5 2 6 1\n2 5 3 2 1\n6 9 2 5 6\n\nSample Output 3\n\n47", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3702, "cpu_time_ms": 4, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s050438809", "group_id": "codeNet:p03547", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y string\n\tfmt.Scan(&x, &y)\n\n\tif x < y {\n\t\tfmt.Println(\"<\")\n\t} else if x > y {\n\t\tfmt.Println(\">\")\n\t} else {\n\t\tfmt.Println(\"=\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1597203275, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03547.html", "problem_id": "p03547", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03547/input.txt", "sample_output_relpath": "derived/input_output/data/p03547/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03547/Go/s050438809.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s050438809", "user_id": "u061804469"}, "prompt_components": {"gold_output": "<\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y string\n\tfmt.Scan(&x, &y)\n\n\tif x < y {\n\t\tfmt.Println(\"<\")\n\t} else if x > y {\n\t\tfmt.Println(\">\")\n\t} else {\n\t\tfmt.Println(\"=\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "sample_input": "A B\n"}, "reference_outputs": ["<\n"], "source_document_id": "p03547", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn programming, hexadecimal notation is often used.\n\nIn hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters A, B, C, D, E and F are used to represent the values 10, 11, 12, 13, 14 and 15, respectively.\n\nIn this problem, you are given two letters X and Y. Each X and Y is A, B, C, D, E or F.\n\nWhen X and Y are seen as hexadecimal numbers, which is larger?\n\nConstraints\n\nEach X and Y is A, B, C, D, E or F.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf X is smaller, print <; if Y is smaller, print >; if they are equal, print =.\n\nSample Input 1\n\nA B\n\nSample Output 1\n\n<\n\n10 < 11.\n\nSample Input 2\n\nE C\n\nSample Output 2\n\n>\n\n14 > 12.\n\nSample Input 3\n\nF F\n\nSample Output 3\n\n=\n\n15 = 15.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 186, "cpu_time_ms": 4, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s354703792", "group_id": "codeNet:p03548", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar x, y, z int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tx, y, z = tmp[0], tmp[1], tmp[2]\n\tq := x / (z + y)\n\tdiff := x % (z + y)\n\tif diff >= z {\n\t\tfmt.Println(q)\n\t} else {\n\t\tfmt.Println(q - 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1543106130, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03548.html", "problem_id": "p03548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03548/input.txt", "sample_output_relpath": "derived/input_output/data/p03548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03548/Go/s354703792.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s354703792", "user_id": "u103600314"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar x, y, z int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tx, y, z = tmp[0], tmp[1], tmp[2]\n\tq := x / (z + y)\n\tdiff := x % (z + y)\n\tif diff >= z {\n\t\tfmt.Println(q)\n\t} else {\n\t\tfmt.Println(q - 1)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a long seat of width X centimeters.\nThere are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.\n\nWe would like to seat as many people as possible, but they are all very shy, and there must be a gap of length at least Z centimeters between two people, and between the end of the seat and a person.\n\nAt most how many people can sit on the seat?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq X, Y, Z \\leq 10^5\n\nY+2Z \\leq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n13 3 1\n\nSample Output 1\n\n3\n\nThere is just enough room for three, as shown below:\n\nFigure\n\nSample Input 2\n\n12 3 1\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1 1\n\nSample Output 3\n\n49999\n\nSample Input 4\n\n64146 123 456\n\nSample Output 4\n\n110\n\nSample Input 5\n\n64145 123 456\n\nSample Output 5\n\n109", "sample_input": "13 3 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03548", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a long seat of width X centimeters.\nThere are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.\n\nWe would like to seat as many people as possible, but they are all very shy, and there must be a gap of length at least Z centimeters between two people, and between the end of the seat and a person.\n\nAt most how many people can sit on the seat?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq X, Y, Z \\leq 10^5\n\nY+2Z \\leq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n13 3 1\n\nSample Output 1\n\n3\n\nThere is just enough room for three, as shown below:\n\nFigure\n\nSample Input 2\n\n12 3 1\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1 1\n\nSample Output 3\n\n49999\n\nSample Input 4\n\n64146 123 456\n\nSample Output 4\n\n110\n\nSample Input 5\n\n64145 123 456\n\nSample Output 5\n\n109", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4720, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s272466277", "group_id": "codeNet:p03549", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, M := getInt(), getInt()\n\n\ttotal := (N-M)*100 + 1900*M\n\tnum := 1 << uint(M)\n\n\tout(total * num)\n}\n", "language": "Go", "metadata": {"date": 1588272052, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03549.html", "problem_id": "p03549", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03549/input.txt", "sample_output_relpath": "derived/input_output/data/p03549/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03549/Go/s272466277.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272466277", "user_id": "u814575783"}, "prompt_components": {"gold_output": "3800\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, M := getInt(), getInt()\n\n\ttotal := (N-M)*100 + 1900*M\n\tnum := 1 << uint(M)\n\n\tout(total * num)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is now competing in a programming contest, but he received TLE in a problem where the answer is YES or NO.\n\nWhen he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases.\n\nThen, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds.\n\nNow, he goes through the following process:\n\nSubmit the code.\n\nWait until the code finishes execution on all the cases.\n\nIf the code fails to correctly solve some of the M cases, submit it again.\n\nRepeat until the code correctly solve all the cases in one submission.\n\nLet the expected value of the total execution time of the code be X milliseconds. Print X (as an integer).\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq M \\leq {\\rm min}(N, 5)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9.\n\nSample Input 1\n\n1 1\n\nSample Output 1\n\n3800\n\nIn this input, there is only one case. Takahashi will repeatedly submit the code that correctly solves this case with 1/2 probability in 1900 milliseconds.\n\nThe code will succeed in one attempt with 1/2 probability, in two attempts with 1/4 probability, and in three attempts with 1/8 probability, and so on.\n\nThus, the answer is 1900 \\times 1/2 + (2 \\times 1900) \\times 1/4 + (3 \\times 1900) \\times 1/8 + ... = 3800.\n\nSample Input 2\n\n10 2\n\nSample Output 2\n\n18400\n\nThe code will take 1900 milliseconds in each of the 2 cases, and 100 milliseconds in each of the 10-2=8 cases. The probability of the code correctly solving all the cases is 1/2 \\times 1/2 = 1/4.\n\nSample Input 3\n\n100 5\n\nSample Output 3\n\n608000", "sample_input": "1 1\n"}, "reference_outputs": ["3800\n"], "source_document_id": "p03549", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is now competing in a programming contest, but he received TLE in a problem where the answer is YES or NO.\n\nWhen he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases.\n\nThen, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds.\n\nNow, he goes through the following process:\n\nSubmit the code.\n\nWait until the code finishes execution on all the cases.\n\nIf the code fails to correctly solve some of the M cases, submit it again.\n\nRepeat until the code correctly solve all the cases in one submission.\n\nLet the expected value of the total execution time of the code be X milliseconds. Print X (as an integer).\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq M \\leq {\\rm min}(N, 5)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9.\n\nSample Input 1\n\n1 1\n\nSample Output 1\n\n3800\n\nIn this input, there is only one case. Takahashi will repeatedly submit the code that correctly solves this case with 1/2 probability in 1900 milliseconds.\n\nThe code will succeed in one attempt with 1/2 probability, in two attempts with 1/4 probability, and in three attempts with 1/8 probability, and so on.\n\nThus, the answer is 1900 \\times 1/2 + (2 \\times 1900) \\times 1/4 + (3 \\times 1900) \\times 1/8 + ... = 3800.\n\nSample Input 2\n\n10 2\n\nSample Output 2\n\n18400\n\nThe code will take 1900 milliseconds in each of the 2 cases, and 100 milliseconds in each of the 10-2=8 cases. The probability of the code correctly solving all the cases is 1/2 \\times 1/2 = 1/4.\n\nSample Input 3\n\n100 5\n\nSample Output 3\n\n608000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 757, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s055050918", "group_id": "codeNet:p03552", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\tz := getNextInt(scanner)\n\tw := getNextInt(scanner)\n\n\taa := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\n\tif n == 1 {\n\t\tfmt.Println(absint(w - aa[n-1]))\n\t}\n\n\tfmt.Fprintln(writer, maxint(absint(w-aa[n-1]), absint(aa[n-2]-aa[n-1])))\n\n\twriter.Flush()\n\tfmt.Fprintln(writer, z)\n}\n\nfunc maxint(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc absint(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1576466058, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03552.html", "problem_id": "p03552", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03552/input.txt", "sample_output_relpath": "derived/input_output/data/p03552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03552/Go/s055050918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s055050918", "user_id": "u150542210"}, "prompt_components": {"gold_output": "900\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\tz := getNextInt(scanner)\n\tw := getNextInt(scanner)\n\n\taa := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\n\tif n == 1 {\n\t\tfmt.Println(absint(w - aa[n-1]))\n\t}\n\n\tfmt.Fprintln(writer, maxint(absint(w-aa[n-1]), absint(aa[n-2]-aa[n-1])))\n\n\twriter.Flush()\n\tfmt.Fprintln(writer, z)\n}\n\nfunc maxint(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc absint(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.\n\nTwo people X and Y will play a game using this deck. Initially, X has a card with Z written on it in his hand, and Y has a card with W written on it in his hand. Then, starting from X, they will alternately perform the following action:\n\nDraw some number of cards from the top of the deck. Then, discard the card in his hand and keep the last drawn card instead. Here, at least one card must be drawn.\n\nThe game ends when there is no more card in the deck. The score of the game is the absolute difference of the integers written on the cards in the two players' hand.\n\nX will play the game so that the score will be maximized, and Y will play the game so that the score will be minimized. What will be the score of the game?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq Z, W, a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Z W\na_1 a_2 ... a_N\n\nOutput\n\nPrint the score.\n\nSample Input 1\n\n3 100 100\n10 1000 100\n\nSample Output 1\n\n900\n\nIf X draws two cards first, Y will draw the last card, and the score will be |1000 - 100| = 900.\n\nSample Input 2\n\n3 100 1000\n10 100 100\n\nSample Output 2\n\n900\n\nIf X draws all the cards first, the score will be |1000 - 100| = 900.\n\nSample Input 3\n\n5 1 1\n1 1 1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 1 1\n1000000000\n\nSample Output 4\n\n999999999", "sample_input": "3 100 100\n10 1000 100\n"}, "reference_outputs": ["900\n"], "source_document_id": "p03552", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.\n\nTwo people X and Y will play a game using this deck. Initially, X has a card with Z written on it in his hand, and Y has a card with W written on it in his hand. Then, starting from X, they will alternately perform the following action:\n\nDraw some number of cards from the top of the deck. Then, discard the card in his hand and keep the last drawn card instead. Here, at least one card must be drawn.\n\nThe game ends when there is no more card in the deck. The score of the game is the absolute difference of the integers written on the cards in the two players' hand.\n\nX will play the game so that the score will be maximized, and Y will play the game so that the score will be minimized. What will be the score of the game?\n\nConstraints\n\nAll input values are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq Z, W, a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Z W\na_1 a_2 ... a_N\n\nOutput\n\nPrint the score.\n\nSample Input 1\n\n3 100 100\n10 1000 100\n\nSample Output 1\n\n900\n\nIf X draws two cards first, Y will draw the last card, and the score will be |1000 - 100| = 900.\n\nSample Input 2\n\n3 100 1000\n10 100 100\n\nSample Output 2\n\n900\n\nIf X draws all the cards first, the score will be |1000 - 100| = 900.\n\nSample Input 3\n\n5 1 1\n1 1 1 1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 1 1\n1000000000\n\nSample Output 4\n\n999999999", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1585, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s167088647", "group_id": "codeNet:p03556", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\troot := math.Sqrt(float64(N))\n\tupper := int(math.Floor(root))\n\tfmt.Println(pow(upper, 2))\n}\n", "language": "Go", "metadata": {"date": 1574549898, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03556.html", "problem_id": "p03556", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03556/input.txt", "sample_output_relpath": "derived/input_output/data/p03556/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03556/Go/s167088647.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s167088647", "user_id": "u924691798"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\troot := math.Sqrt(float64(N))\n\tupper := int(math.Floor(root))\n\tfmt.Println(pow(upper, 2))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the largest square number not exceeding N. Here, a square number is an integer that can be represented as the square of an integer.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the largest square number not exceeding N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\n10 is not square, but 9 = 3 × 3 is. Thus, we print 9.\n\nSample Input 2\n\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\n271828182\n\nSample Output 3\n\n271821169", "sample_input": "10\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03556", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the largest square number not exceeding N. Here, a square number is an integer that can be represented as the square of an integer.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the largest square number not exceeding N.\n\nSample Input 1\n\n10\n\nSample Output 1\n\n9\n\n10 is not square, but 9 = 3 × 3 is. Thus, we print 9.\n\nSample Input 2\n\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\n271828182\n\nSample Output 3\n\n271821169", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1179, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s042557761", "group_id": "codeNet:p03557", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, r int\n\tfmt.Scan(&N)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tc := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tb[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tc[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\tsort.Sort(sort.Reverse(sort.IntSlice(c)))\n\tfor i := 0; i < N; i++ {\n\t\tac := 0\n\t\tcc := 0\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif a[j] < b[i] {\n\t\t\t\tac++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif b[i] < c[j] {\n\t\t\t\tcc++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tr += ac * cc\n\t}\n\tfmt.Println(r)\n\n}", "language": "Go", "metadata": {"date": 1562587395, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03557.html", "problem_id": "p03557", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03557/input.txt", "sample_output_relpath": "derived/input_output/data/p03557/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03557/Go/s042557761.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s042557761", "user_id": "u298152049"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, r int\n\tfmt.Scan(&N)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tc := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tb[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tc[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\tsort.Sort(sort.Reverse(sort.IntSlice(c)))\n\tfor i := 0; i < N; i++ {\n\t\tac := 0\n\t\tcc := 0\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif a[j] < b[i] {\n\t\t\t\tac++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif b[i] < c[j] {\n\t\t\t\tcc++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tr += ac * cc\n\t}\n\tfmt.Println(r)\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower.\n\nHe has N parts for each of the three categories. The size of the i-th upper part is A_i, the size of the i-th middle part is B_i, and the size of the i-th lower part is C_i.\n\nTo build an altar, the size of the middle part must be strictly greater than that of the upper part, and the size of the lower part must be strictly greater than that of the middle part. On the other hand, any three parts that satisfy these conditions can be combined to form an altar.\n\nHow many different altars can Ringo build? Here, two altars are considered different when at least one of the three parts used is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq C_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\nB_1 ... B_N\nC_1 ... C_N\n\nOutput\n\nPrint the number of different altars that Ringo can build.\n\nSample Input 1\n\n2\n1 5\n2 4\n3 6\n\nSample Output 1\n\n3\n\nThe following three altars can be built:\n\nUpper: 1-st part, Middle: 1-st part, Lower: 1-st part\n\nUpper: 1-st part, Middle: 1-st part, Lower: 2-nd part\n\nUpper: 1-st part, Middle: 2-nd part, Lower: 2-nd part\n\nSample Input 2\n\n3\n1 1 1\n2 2 2\n3 3 3\n\nSample Output 2\n\n27\n\nSample Input 3\n\n6\n3 14 159 2 6 53\n58 9 79 323 84 6\n2643 383 2 79 50 288\n\nSample Output 3\n\n87", "sample_input": "2\n1 5\n2 4\n3 6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03557", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower.\n\nHe has N parts for each of the three categories. The size of the i-th upper part is A_i, the size of the i-th middle part is B_i, and the size of the i-th lower part is C_i.\n\nTo build an altar, the size of the middle part must be strictly greater than that of the upper part, and the size of the lower part must be strictly greater than that of the middle part. On the other hand, any three parts that satisfy these conditions can be combined to form an altar.\n\nHow many different altars can Ringo build? Here, two altars are considered different when at least one of the three parts used is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq C_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\nB_1 ... B_N\nC_1 ... C_N\n\nOutput\n\nPrint the number of different altars that Ringo can build.\n\nSample Input 1\n\n2\n1 5\n2 4\n3 6\n\nSample Output 1\n\n3\n\nThe following three altars can be built:\n\nUpper: 1-st part, Middle: 1-st part, Lower: 1-st part\n\nUpper: 1-st part, Middle: 1-st part, Lower: 2-nd part\n\nUpper: 1-st part, Middle: 2-nd part, Lower: 2-nd part\n\nSample Input 2\n\n3\n1 1 1\n2 2 2\n3 3 3\n\nSample Output 2\n\n27\n\nSample Input 3\n\n6\n3 14 159 2 6 53\n58 9 79 323 84 6\n2643 383 2 79 50 288\n\nSample Output 3\n\n87", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 792, "cpu_time_ms": 2108, "memory_kb": 6016}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s458104461", "group_id": "codeNet:p03557", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tc := make([]int, N)\n\tcw := make([]int, 100010)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&b[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&c[i])\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\tsort.Sort(sort.IntSlice(b))\n\tsort.Sort(sort.IntSlice(c))\n\tfor i := 0; i < N; i++ {\n\t\tcw[c[i]]++\n\t}\n\tfor i := 1; i < len(cw); i++ {\n\t\tcw[i] += cw[i-1]\n\t}\n\tr := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif b[j] <= a[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := 0; k < N; k++ {\n\t\t\t\tif c[k] <= b[j] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tct := N - cw[b[j]]\n\t\t\t\tr += ct\n\t\t\t\t//fmt.Printf(\"a:%d b:%d c:%d ct:%d r:%d\\n\", a[i], b[j], c[k], ct, r)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\n\n}", "language": "Go", "metadata": {"date": 1562525830, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03557.html", "problem_id": "p03557", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03557/input.txt", "sample_output_relpath": "derived/input_output/data/p03557/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03557/Go/s458104461.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s458104461", "user_id": "u298152049"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tc := make([]int, N)\n\tcw := make([]int, 100010)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&b[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&c[i])\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\tsort.Sort(sort.IntSlice(b))\n\tsort.Sort(sort.IntSlice(c))\n\tfor i := 0; i < N; i++ {\n\t\tcw[c[i]]++\n\t}\n\tfor i := 1; i < len(cw); i++ {\n\t\tcw[i] += cw[i-1]\n\t}\n\tr := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif b[j] <= a[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := 0; k < N; k++ {\n\t\t\t\tif c[k] <= b[j] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tct := N - cw[b[j]]\n\t\t\t\tr += ct\n\t\t\t\t//fmt.Printf(\"a:%d b:%d c:%d ct:%d r:%d\\n\", a[i], b[j], c[k], ct, r)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower.\n\nHe has N parts for each of the three categories. The size of the i-th upper part is A_i, the size of the i-th middle part is B_i, and the size of the i-th lower part is C_i.\n\nTo build an altar, the size of the middle part must be strictly greater than that of the upper part, and the size of the lower part must be strictly greater than that of the middle part. On the other hand, any three parts that satisfy these conditions can be combined to form an altar.\n\nHow many different altars can Ringo build? Here, two altars are considered different when at least one of the three parts used is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq C_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\nB_1 ... B_N\nC_1 ... C_N\n\nOutput\n\nPrint the number of different altars that Ringo can build.\n\nSample Input 1\n\n2\n1 5\n2 4\n3 6\n\nSample Output 1\n\n3\n\nThe following three altars can be built:\n\nUpper: 1-st part, Middle: 1-st part, Lower: 1-st part\n\nUpper: 1-st part, Middle: 1-st part, Lower: 2-nd part\n\nUpper: 1-st part, Middle: 2-nd part, Lower: 2-nd part\n\nSample Input 2\n\n3\n1 1 1\n2 2 2\n3 3 3\n\nSample Output 2\n\n27\n\nSample Input 3\n\n6\n3 14 159 2 6 53\n58 9 79 323 84 6\n2643 383 2 79 50 288\n\nSample Output 3\n\n87", "sample_input": "2\n1 5\n2 4\n3 6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03557", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower.\n\nHe has N parts for each of the three categories. The size of the i-th upper part is A_i, the size of the i-th middle part is B_i, and the size of the i-th lower part is C_i.\n\nTo build an altar, the size of the middle part must be strictly greater than that of the upper part, and the size of the lower part must be strictly greater than that of the middle part. On the other hand, any three parts that satisfy these conditions can be combined to form an altar.\n\nHow many different altars can Ringo build? Here, two altars are considered different when at least one of the three parts used is different.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\n1 \\leq C_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\nB_1 ... B_N\nC_1 ... C_N\n\nOutput\n\nPrint the number of different altars that Ringo can build.\n\nSample Input 1\n\n2\n1 5\n2 4\n3 6\n\nSample Output 1\n\n3\n\nThe following three altars can be built:\n\nUpper: 1-st part, Middle: 1-st part, Lower: 1-st part\n\nUpper: 1-st part, Middle: 1-st part, Lower: 2-nd part\n\nUpper: 1-st part, Middle: 2-nd part, Lower: 2-nd part\n\nSample Input 2\n\n3\n1 1 1\n2 2 2\n3 3 3\n\nSample Output 2\n\n27\n\nSample Input 3\n\n6\n3 14 159 2 6 53\n58 9 79 323 84 6\n2643 383 2 79 50 288\n\nSample Output 3\n\n87", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 812, "cpu_time_ms": 2108, "memory_kb": 9728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s409940356", "group_id": "codeNet:p03563", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar R, G int\n\nfunc main() {\n\tfmt.Scan(&R, &G)\n\n\t// (R+x)/2 = G\n\tfmt.Println(2*G - R)\n}\n\n/* ---------------------------------------- */\n\nfunc combination(x, y int) int {\n\treturn permutation(x, y) / permutation(y, y)\n}\n\nfunc permutation(x, y int) int {\n\tvar ans int = 1\n\tfor i := x - y; 0 < i; i-- {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\n\ntype XY struct {\n\tx int\n\ty int\n}\ntype SortBy []XY\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\tif a[i].x == a[j].x {\n\t\treturn a[i].y > a[j].y\n\t}\n\treturn a[i].x > a[j].x\n}\n", "language": "Go", "metadata": {"date": 1560823868, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03563.html", "problem_id": "p03563", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03563/input.txt", "sample_output_relpath": "derived/input_output/data/p03563/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03563/Go/s409940356.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s409940356", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2032\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar R, G int\n\nfunc main() {\n\tfmt.Scan(&R, &G)\n\n\t// (R+x)/2 = G\n\tfmt.Println(2*G - R)\n}\n\n/* ---------------------------------------- */\n\nfunc combination(x, y int) int {\n\treturn permutation(x, y) / permutation(y, y)\n}\n\nfunc permutation(x, y int) int {\n\tvar ans int = 1\n\tfor i := x - y; 0 < i; i-- {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\n\ntype XY struct {\n\tx int\n\ty int\n}\ntype SortBy []XY\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\tif a[i].x == a[j].x {\n\t\treturn a[i].y > a[j].y\n\t}\n\treturn a[i].x > a[j].x\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a user of a site that hosts programming contests.\n\nWhen a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:\n\nLet the current rating of the user be a.\n\nSuppose that the performance of the user in the contest is b.\n\nThen, the new rating of the user will be the avarage of a and b.\n\nFor example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.\n\nTakahashi's current rating is R, and he wants his rating to be exactly G after the next contest.\n\nFind the performance required to achieve it.\n\nConstraints\n\n0 \\leq R, G \\leq 4500\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\nG\n\nOutput\n\nPrint the performance required to achieve the objective.\n\nSample Input 1\n\n2002\n2017\n\nSample Output 1\n\n2032\n\nTakahashi's current rating is 2002.\n\nIf his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.\n\nSample Input 2\n\n4500\n0\n\nSample Output 2\n\n-4500\n\nAlthough the current and desired ratings are between 0 and 4500, the performance of a user can be below 0.", "sample_input": "2002\n2017\n"}, "reference_outputs": ["2032\n"], "source_document_id": "p03563", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a user of a site that hosts programming contests.\n\nWhen a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:\n\nLet the current rating of the user be a.\n\nSuppose that the performance of the user in the contest is b.\n\nThen, the new rating of the user will be the avarage of a and b.\n\nFor example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.\n\nTakahashi's current rating is R, and he wants his rating to be exactly G after the next contest.\n\nFind the performance required to achieve it.\n\nConstraints\n\n0 \\leq R, G \\leq 4500\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\nG\n\nOutput\n\nPrint the performance required to achieve the objective.\n\nSample Input 1\n\n2002\n2017\n\nSample Output 1\n\n2032\n\nTakahashi's current rating is 2002.\n\nIf his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.\n\nSample Input 2\n\n4500\n0\n\nSample Output 2\n\n-4500\n\nAlthough the current and desired ratings are between 0 and 4500, the performance of a user can be below 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1128, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s976916702", "group_id": "codeNet:p03569", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tlineScanner *bufio.Scanner\n\twordScanner *bufio.Scanner\n}\n\nvar Stdin *Scanner\n\nfunc NewScanner() *Scanner {\n\tscanner := &Scanner{\n\t\tlineScanner: bufio.NewScanner(os.Stdin),\n\t\twordScanner: bufio.NewScanner(os.Stdin),\n\t}\n\tscanner.lineScanner.Split(bufio.ScanLines)\n\tscanner.wordScanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nfunc (sc *Scanner) NextLine() string {\n\tStdin.lineScanner.Scan()\n\treturn Stdin.lineScanner.Text()\n}\n\nfunc (sc *Scanner) Next() string {\n\tStdin.wordScanner.Scan()\n\treturn Stdin.wordScanner.Text()\n}\n\nfunc (sc *Scanner) NextInt() int {\n\tStdin.wordScanner.Scan()\n\tret, err := strconv.Atoi(Stdin.wordScanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\n\nfunc (sc *Scanner) NextNInts(N int) []int {\n\tints := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tints[i] = sc.NextInt()\n\t}\n\treturn ints\n}\n\nfunc (sc *Scanner) NextInt64() int64 {\n\tStdin.wordScanner.Scan()\n\tret, err := strconv.ParseInt(Stdin.wordScanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\n\nfunc (sc *Scanner) NextFloat() float64 {\n\tStdin.wordScanner.Scan()\n\tret, err := strconv.ParseFloat(Stdin.wordScanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\n\ntype StringSlice []string\n\nfunc (ss StringSlice) Contains(s string) bool {\n\tfor _, element := range ss {\n\t\tif element == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (ss StringSlice) CountIf(predicate func(string) bool) int {\n\tcount := 0\n\tfor _, s := range ss {\n\t\tif predicate(s) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc (ss StringSlice) Filter(predicate func(string) bool) StringSlice {\n\tret := make([]string, 0)\n\tfor _, s := range ss {\n\t\tif predicate(s) {\n\t\t\tret = append(ret, s)\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc (ss StringSlice) Map(mapper func(string) string) StringSlice {\n\tret := make([]string, 0)\n\tfor _, s := range ss {\n\t\tret = append(ret, mapper(s))\n\t}\n\treturn ret\n}\n\ntype IntSlice []int\n\nfunc (is IntSlice) CountIf(predicate func(int) bool) int {\n\tcount := 0\n\tfor _, i := range is {\n\t\tif predicate(i) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc Pow(base int, power int) int {\n\tp := 1\n\tfor i := 0; i < power; i++ {\n\t\tp *= base\n\t}\n\treturn p\n}\n\nfunc init() {\n\tStdin = NewScanner()\n}\n\nfunc main() {\n\ts := Stdin.NextLine()\n\tN := len(s)\n\n\tif N == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcount := 0\n\tleftIndex := 0\n\trightIndex := N - 1\n\n\tfor leftIndex < rightIndex {\n\n\t\tleft := string(s[leftIndex])\n\t\tright := string(s[rightIndex])\n\n\t\tif left != \"x\" && right == \"x\" {\n\t\t\tcount++\n\t\t\trightIndex--\n\t\t} else if left == \"x\" && right != \"x\" {\n\t\t\tcount++\n\t\t\tleftIndex++\n\t\t} else if left == right {\n\t\t\tleftIndex++\n\t\t\trightIndex--\n\t\t} else {\n\t\t\tcount = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1508828083, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03569.html", "problem_id": "p03569", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03569/input.txt", "sample_output_relpath": "derived/input_output/data/p03569/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03569/Go/s976916702.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s976916702", "user_id": "u446970874"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Scanner struct {\n\tlineScanner *bufio.Scanner\n\twordScanner *bufio.Scanner\n}\n\nvar Stdin *Scanner\n\nfunc NewScanner() *Scanner {\n\tscanner := &Scanner{\n\t\tlineScanner: bufio.NewScanner(os.Stdin),\n\t\twordScanner: bufio.NewScanner(os.Stdin),\n\t}\n\tscanner.lineScanner.Split(bufio.ScanLines)\n\tscanner.wordScanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nfunc (sc *Scanner) NextLine() string {\n\tStdin.lineScanner.Scan()\n\treturn Stdin.lineScanner.Text()\n}\n\nfunc (sc *Scanner) Next() string {\n\tStdin.wordScanner.Scan()\n\treturn Stdin.wordScanner.Text()\n}\n\nfunc (sc *Scanner) NextInt() int {\n\tStdin.wordScanner.Scan()\n\tret, err := strconv.Atoi(Stdin.wordScanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\n\nfunc (sc *Scanner) NextNInts(N int) []int {\n\tints := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tints[i] = sc.NextInt()\n\t}\n\treturn ints\n}\n\nfunc (sc *Scanner) NextInt64() int64 {\n\tStdin.wordScanner.Scan()\n\tret, err := strconv.ParseInt(Stdin.wordScanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\n\nfunc (sc *Scanner) NextFloat() float64 {\n\tStdin.wordScanner.Scan()\n\tret, err := strconv.ParseFloat(Stdin.wordScanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\n\ntype StringSlice []string\n\nfunc (ss StringSlice) Contains(s string) bool {\n\tfor _, element := range ss {\n\t\tif element == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (ss StringSlice) CountIf(predicate func(string) bool) int {\n\tcount := 0\n\tfor _, s := range ss {\n\t\tif predicate(s) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc (ss StringSlice) Filter(predicate func(string) bool) StringSlice {\n\tret := make([]string, 0)\n\tfor _, s := range ss {\n\t\tif predicate(s) {\n\t\t\tret = append(ret, s)\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc (ss StringSlice) Map(mapper func(string) string) StringSlice {\n\tret := make([]string, 0)\n\tfor _, s := range ss {\n\t\tret = append(ret, mapper(s))\n\t}\n\treturn ret\n}\n\ntype IntSlice []int\n\nfunc (is IntSlice) CountIf(predicate func(int) bool) int {\n\tcount := 0\n\tfor _, i := range is {\n\t\tif predicate(i) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc Pow(base int, power int) int {\n\tp := 1\n\tfor i := 0; i < power; i++ {\n\t\tp *= base\n\t}\n\treturn p\n}\n\nfunc init() {\n\tStdin = NewScanner()\n}\n\nfunc main() {\n\ts := Stdin.NextLine()\n\tN := len(s)\n\n\tif N == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcount := 0\n\tleftIndex := 0\n\trightIndex := N - 1\n\n\tfor leftIndex < rightIndex {\n\n\t\tleft := string(s[leftIndex])\n\t\tright := string(s[rightIndex])\n\n\t\tif left != \"x\" && right == \"x\" {\n\t\t\tcount++\n\t\t\trightIndex--\n\t\t} else if left == \"x\" && right != \"x\" {\n\t\t\tcount++\n\t\t\tleftIndex++\n\t\t} else if left == right {\n\t\t\tleftIndex++\n\t\t\trightIndex--\n\t\t} else {\n\t\t\tcount = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string s consisting of lowercase English letters.\nSnuke can perform the following operation repeatedly:\n\nInsert a letter x to any position in s of his choice, including the beginning and end of s.\n\nSnuke's objective is to turn s into a palindrome.\nDetermine whether the objective is achievable. If it is achievable, find the minimum number of operations required.\n\nNotes\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are palindromes, while ab, abab and abcda are not.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\n\ns consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf the objective is achievable, print the number of operations required.\nIf it is not, print -1 instead.\n\nSample Input 1\n\nxabxa\n\nSample Output 1\n\n2\n\nOne solution is as follows (newly inserted x are shown in bold):\n\nxabxa → xaxbxa → xaxbxax\n\nSample Input 2\n\nab\n\nSample Output 2\n\n-1\n\nNo sequence of operations can turn s into a palindrome.\n\nSample Input 3\n\na\n\nSample Output 3\n\n0\n\ns is a palindrome already at the beginning.\n\nSample Input 4\n\noxxx\n\nSample Output 4\n\n3\n\nOne solution is as follows:\n\noxxx → xoxxx → xxoxxx → xxxoxxx", "sample_input": "xabxa\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03569", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string s consisting of lowercase English letters.\nSnuke can perform the following operation repeatedly:\n\nInsert a letter x to any position in s of his choice, including the beginning and end of s.\n\nSnuke's objective is to turn s into a palindrome.\nDetermine whether the objective is achievable. If it is achievable, find the minimum number of operations required.\n\nNotes\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are palindromes, while ab, abab and abcda are not.\n\nConstraints\n\n1 \\leq |s| \\leq 10^5\n\ns consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nIf the objective is achievable, print the number of operations required.\nIf it is not, print -1 instead.\n\nSample Input 1\n\nxabxa\n\nSample Output 1\n\n2\n\nOne solution is as follows (newly inserted x are shown in bold):\n\nxabxa → xaxbxa → xaxbxax\n\nSample Input 2\n\nab\n\nSample Output 2\n\n-1\n\nNo sequence of operations can turn s into a palindrome.\n\nSample Input 3\n\na\n\nSample Output 3\n\n0\n\ns is a palindrome already at the beginning.\n\nSample Input 4\n\noxxx\n\nSample Output 4\n\n3\n\nOne solution is as follows:\n\noxxx → xoxxx → xxoxxx → xxxoxxx", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2737, "cpu_time_ms": 2, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s421976918", "group_id": "codeNet:p03576", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, K int\n\tfmt.Scan(&n, &K)\n\n\tps := make([]Point, n)\n\tvar x, y int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tps[i] = Point{i, x, y}\n\t}\n\n\tans := int(1e18 * 4)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tp1, p2, p3 := ps[i], ps[j], ps[k]\n\t\t\t\tx1 := min(p1.x, min(p2.x, p3.x))\n\t\t\t\ty1 := min(p1.y, min(p2.y, p3.y))\n\t\t\t\tx2 := max(p1.x, max(p2.x, p3.x))\n\t\t\t\ty2 := max(p1.y, max(p2.y, p3.y))\n\n\t\t\t\tcnt := 0\n\t\t\t\tfor _, p := range ps {\n\t\t\t\t\tif x1 <= p.x && p.x <= x2 && y1 <= p.y && p.y <= y2 {\n\t\t\t\t\t\tcnt++\n\t\t\t\t\t\tif K <= cnt {\n\t\t\t\t\t\t\tans = min(ans, (x2-x1)*(y2-y1))\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Point .\ntype Point struct {\n\ti, x, y int\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1594317043, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03576.html", "problem_id": "p03576", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03576/input.txt", "sample_output_relpath": "derived/input_output/data/p03576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03576/Go/s421976918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s421976918", "user_id": "u902409225"}, "prompt_components": {"gold_output": "21\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, K int\n\tfmt.Scan(&n, &K)\n\n\tps := make([]Point, n)\n\tvar x, y int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tps[i] = Point{i, x, y}\n\t}\n\n\tans := int(1e18 * 4)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tp1, p2, p3 := ps[i], ps[j], ps[k]\n\t\t\t\tx1 := min(p1.x, min(p2.x, p3.x))\n\t\t\t\ty1 := min(p1.y, min(p2.y, p3.y))\n\t\t\t\tx2 := max(p1.x, max(p2.x, p3.x))\n\t\t\t\ty2 := max(p1.y, max(p2.y, p3.y))\n\n\t\t\t\tcnt := 0\n\t\t\t\tfor _, p := range ps {\n\t\t\t\t\tif x1 <= p.x && p.x <= x2 && y1 <= p.y && p.y <= y2 {\n\t\t\t\t\t\tcnt++\n\t\t\t\t\t\tif K <= cnt {\n\t\t\t\t\t\t\tans = min(ans, (x2-x1)*(y2-y1))\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Point .\ntype Point struct {\n\ti, x, y int\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N points in a two-dimensional plane.\n\nThe coordinates of the i-th point (1 \\leq i \\leq N) are (x_i,y_i).\n\nLet us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior.\n\nHere, points on the sides of the rectangle are considered to be in the interior.\n\nFind the minimum possible area of such a rectangle.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 50\n\n-10^9 \\leq x_i,y_i \\leq 10^9 (1 \\leq i \\leq N)\n\nx_i≠x_j (1 \\leq i 0; i >>= 1 {\n\t\tdepth++\n\t}\n\treturn depth * 2\n}\n\ntype _sort_lessSwap struct {\n\tLess func(i, j int) bool\n\tSwap func(i, j int)\n}\n\n// Auto-generated variant of sort.go:insertionSort\nfunc _sort_insertionSort_func(data _sort_lessSwap, a, b int) {\n\tfor i := a + 1; i < b; i++ {\n\t\tfor j := i; j > a && data.Less(j, j-1); j-- {\n\t\t\tdata.Swap(j, j-1)\n\t\t}\n\t}\n}\n\n// Auto-generated variant of sort.go:siftDown\nfunc _sort_siftDown_func(data _sort_lessSwap, lo, hi, first int) {\n\troot := lo\n\tfor {\n\t\tchild := 2*root + 1\n\t\tif child >= hi {\n\t\t\tbreak\n\t\t}\n\t\tif child+1 < hi && data.Less(first+child, first+child+1) {\n\t\t\tchild++\n\t\t}\n\t\tif !data.Less(first+root, first+child) {\n\t\t\treturn\n\t\t}\n\t\tdata.Swap(first+root, first+child)\n\t\troot = child\n\t}\n}\n\n// Auto-generated variant of sort.go:heapSort\nfunc _sort_heapSort_func(data _sort_lessSwap, a, b int) {\n\tfirst := a\n\tlo := 0\n\thi := b - a\n\tfor i := (hi - 1) / 2; i >= 0; i-- {\n\t\t_sort_siftDown_func(data, i, hi, first)\n\t}\n\tfor i := hi - 1; i >= 0; i-- {\n\t\tdata.Swap(first, first+i)\n\t\t_sort_siftDown_func(data, lo, i, first)\n\t}\n}\n\n// Auto-generated variant of sort.go:medianOfThree\nfunc _sort_medianOfThree_func(data _sort_lessSwap, m1, m0, m2 int) {\n\tif data.Less(m1, m0) {\n\t\tdata.Swap(m1, m0)\n\t}\n\tif data.Less(m2, m1) {\n\t\tdata.Swap(m2, m1)\n\t\tif data.Less(m1, m0) {\n\t\t\tdata.Swap(m1, m0)\n\t\t}\n\t}\n}\n\n// Auto-generated variant of sort.go:doPivot\nfunc _sort_doPivot_func(data _sort_lessSwap, lo, hi int) (midlo, midhi int) {\n\tm := int(uint(lo+hi) >> 1)\n\tif hi-lo > 40 {\n\t\ts := (hi - lo) / 8\n\t\t_sort_medianOfThree_func(data, lo, lo+s, lo+2*s)\n\t\t_sort_medianOfThree_func(data, m, m-s, m+s)\n\t\t_sort_medianOfThree_func(data, hi-1, hi-1-s, hi-1-2*s)\n\t}\n\t_sort_medianOfThree_func(data, lo, m, hi-1)\n\tpivot := lo\n\ta, c := lo+1, hi-1\n\tfor ; a < c && data.Less(a, pivot); a++ {\n\t}\n\tb := a\n\tfor {\n\t\tfor ; b < c && !data.Less(pivot, b); b++ {\n\t\t}\n\t\tfor ; b < c && data.Less(pivot, c-1); c-- {\n\t\t}\n\t\tif b >= c {\n\t\t\tbreak\n\t\t}\n\t\tdata.Swap(b, c-1)\n\t\tb++\n\t\tc--\n\t}\n\tprotect := hi-c < 5\n\tif !protect && hi-c < (hi-lo)/4 {\n\t\tdups := 0\n\t\tif !data.Less(pivot, hi-1) {\n\t\t\tdata.Swap(c, hi-1)\n\t\t\tc++\n\t\t\tdups++\n\t\t}\n\t\tif !data.Less(b-1, pivot) {\n\t\t\tb--\n\t\t\tdups++\n\t\t}\n\t\tif !data.Less(m, pivot) {\n\t\t\tdata.Swap(m, b-1)\n\t\t\tb--\n\t\t\tdups++\n\t\t}\n\t\tprotect = dups > 1\n\t}\n\tif protect {\n\t\tfor {\n\t\t\tfor ; a < b && !data.Less(b-1, pivot); b-- {\n\t\t\t}\n\t\t\tfor ; a < b && data.Less(a, pivot); a++ {\n\t\t\t}\n\t\t\tif a >= b {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tdata.Swap(a, b-1)\n\t\t\ta++\n\t\t\tb--\n\t\t}\n\t}\n\tdata.Swap(pivot, b-1)\n\treturn b - 1, c\n}\n\n// Auto-generated variant of sort.go:quickSort\nfunc _sort_quickSort_func(data _sort_lessSwap, a, b, maxDepth int) {\n\tfor b-a > 12 {\n\t\tif maxDepth == 0 {\n\t\t\t_sort_heapSort_func(data, a, b)\n\t\t\treturn\n\t\t}\n\t\tmaxDepth--\n\t\tmlo, mhi := _sort_doPivot_func(data, a, b)\n\t\tif mlo-a < b-mhi {\n\t\t\t_sort_quickSort_func(data, a, mlo, maxDepth)\n\t\t\ta = mhi\n\t\t} else {\n\t\t\t_sort_quickSort_func(data, mhi, b, maxDepth)\n\t\t\tb = mlo\n\t\t}\n\t}\n\tif b-a > 1 {\n\t\tfor i := a + 6; i < b; i++ {\n\t\t\tif data.Less(i, i-6) {\n\t\t\t\tdata.Swap(i, i-6)\n\t\t\t}\n\t\t}\n\t\t_sort_insertionSort_func(data, a, b)\n\t}\n}\n\n// ----------------------------------------------------------------------------\n\nfunc _sort_Swapper(slice interface{}) func(i, j int) {\n\tv := reflect.ValueOf(slice)\n\tvdata := v.Pointer()\n\tvlen := v.Len()\n\tvcap := v.Cap()\n\n\tsz := int(v.Type().Elem().Size())\n\n\t// for typical small elements\n\tswitch sz {\n\tcase 24: // for slice\n\t\tvar s [][3]int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 16: // for string\n\t\tvar s [][2]int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 8:\n\t\tvar s []int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 4:\n\t\tvar s []int32\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 2:\n\t\tvar s []int16\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 1:\n\t\tvar s []int8\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\t}\n\n\t// for large elements\n\tif sz%16 == 0 {\n\t\tm := sz / 16\n\t\tvar s [][2]int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n\tif sz%8 == 0 {\n\t\tm := sz / 8\n\t\tvar s []int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n\tif sz%4 == 0 {\n\t\tm := sz / 4\n\t\tvar s []int32\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n\tif sz%2 == 0 {\n\t\tm := sz / 2\n\t\tvar s []int16\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tm := sz\n\t\tvar s []int8\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n}\n\n// =============================================================================\n", "language": "Go", "metadata": {"date": 1558630488, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03576.html", "problem_id": "p03576", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03576/input.txt", "sample_output_relpath": "derived/input_output/data/p03576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03576/Go/s519469019.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s519469019", "user_id": "u705974985"}, "prompt_components": {"gold_output": "21\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"unsafe\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tN := readInt()\n\tK := readInt()\n\tps := make([]Point, N)\n\tfor i := range ps {\n\t\tps[i].x = readInt64()\n\t\tps[i].y = readInt64()\n\t}\n\n\tSort(ps, func(i, j int) bool { return ps[i].x < ps[j].x })\n\n\tinf := int64(1000000001)\n\tmins := 2 * inf * 2 * inf\n\tfor i := 0; i+K <= N; i++ {\n\t\tvar minX, maxX, minY, maxY int64\n\t\tminX = inf\n\t\tminY = inf\n\t\tmaxX = -inf\n\t\tmaxY = -inf\n\n\t\tfor j := i; j < i+K; j++ {\n\t\t\t//eprintln(\"chcking ps\", j, ps[j])\n\t\t\tminX = min(minX, ps[j].x)\n\t\t\tmaxX = max(maxX, ps[j].x)\n\t\t\tminY = min(minY, ps[j].y)\n\t\t\tmaxY = max(maxY, ps[j].y)\n\t\t}\n\t\t//eprintln(maxX, minX, maxY, minY)\n\t\tmins = min(mins, (maxX-minX)*(maxY-minY))\n\t}\n\tprintln(mins)\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\ntype Point struct {\n\tx, y int64\n}\n\n// -----------------------------------------------------------------------------\n\n// =============================================================================\n\n// Copyright 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// name of functions are changed\n\n// The function panics if the provided interface is not a slice.\nfunc Sort(slice interface{}, less func(i, j int) bool) {\n\trv := reflect.ValueOf(slice)\n\tswap := _sort_Swapper(slice)\n\tlength := rv.Len()\n\t_sort_quickSort_func(_sort_lessSwap{less, swap}, 0, length, _sort_maxDepth(length))\n}\n\nfunc _sort_maxDepth(n int) int {\n\tvar depth int\n\tfor i := n; i > 0; i >>= 1 {\n\t\tdepth++\n\t}\n\treturn depth * 2\n}\n\ntype _sort_lessSwap struct {\n\tLess func(i, j int) bool\n\tSwap func(i, j int)\n}\n\n// Auto-generated variant of sort.go:insertionSort\nfunc _sort_insertionSort_func(data _sort_lessSwap, a, b int) {\n\tfor i := a + 1; i < b; i++ {\n\t\tfor j := i; j > a && data.Less(j, j-1); j-- {\n\t\t\tdata.Swap(j, j-1)\n\t\t}\n\t}\n}\n\n// Auto-generated variant of sort.go:siftDown\nfunc _sort_siftDown_func(data _sort_lessSwap, lo, hi, first int) {\n\troot := lo\n\tfor {\n\t\tchild := 2*root + 1\n\t\tif child >= hi {\n\t\t\tbreak\n\t\t}\n\t\tif child+1 < hi && data.Less(first+child, first+child+1) {\n\t\t\tchild++\n\t\t}\n\t\tif !data.Less(first+root, first+child) {\n\t\t\treturn\n\t\t}\n\t\tdata.Swap(first+root, first+child)\n\t\troot = child\n\t}\n}\n\n// Auto-generated variant of sort.go:heapSort\nfunc _sort_heapSort_func(data _sort_lessSwap, a, b int) {\n\tfirst := a\n\tlo := 0\n\thi := b - a\n\tfor i := (hi - 1) / 2; i >= 0; i-- {\n\t\t_sort_siftDown_func(data, i, hi, first)\n\t}\n\tfor i := hi - 1; i >= 0; i-- {\n\t\tdata.Swap(first, first+i)\n\t\t_sort_siftDown_func(data, lo, i, first)\n\t}\n}\n\n// Auto-generated variant of sort.go:medianOfThree\nfunc _sort_medianOfThree_func(data _sort_lessSwap, m1, m0, m2 int) {\n\tif data.Less(m1, m0) {\n\t\tdata.Swap(m1, m0)\n\t}\n\tif data.Less(m2, m1) {\n\t\tdata.Swap(m2, m1)\n\t\tif data.Less(m1, m0) {\n\t\t\tdata.Swap(m1, m0)\n\t\t}\n\t}\n}\n\n// Auto-generated variant of sort.go:doPivot\nfunc _sort_doPivot_func(data _sort_lessSwap, lo, hi int) (midlo, midhi int) {\n\tm := int(uint(lo+hi) >> 1)\n\tif hi-lo > 40 {\n\t\ts := (hi - lo) / 8\n\t\t_sort_medianOfThree_func(data, lo, lo+s, lo+2*s)\n\t\t_sort_medianOfThree_func(data, m, m-s, m+s)\n\t\t_sort_medianOfThree_func(data, hi-1, hi-1-s, hi-1-2*s)\n\t}\n\t_sort_medianOfThree_func(data, lo, m, hi-1)\n\tpivot := lo\n\ta, c := lo+1, hi-1\n\tfor ; a < c && data.Less(a, pivot); a++ {\n\t}\n\tb := a\n\tfor {\n\t\tfor ; b < c && !data.Less(pivot, b); b++ {\n\t\t}\n\t\tfor ; b < c && data.Less(pivot, c-1); c-- {\n\t\t}\n\t\tif b >= c {\n\t\t\tbreak\n\t\t}\n\t\tdata.Swap(b, c-1)\n\t\tb++\n\t\tc--\n\t}\n\tprotect := hi-c < 5\n\tif !protect && hi-c < (hi-lo)/4 {\n\t\tdups := 0\n\t\tif !data.Less(pivot, hi-1) {\n\t\t\tdata.Swap(c, hi-1)\n\t\t\tc++\n\t\t\tdups++\n\t\t}\n\t\tif !data.Less(b-1, pivot) {\n\t\t\tb--\n\t\t\tdups++\n\t\t}\n\t\tif !data.Less(m, pivot) {\n\t\t\tdata.Swap(m, b-1)\n\t\t\tb--\n\t\t\tdups++\n\t\t}\n\t\tprotect = dups > 1\n\t}\n\tif protect {\n\t\tfor {\n\t\t\tfor ; a < b && !data.Less(b-1, pivot); b-- {\n\t\t\t}\n\t\t\tfor ; a < b && data.Less(a, pivot); a++ {\n\t\t\t}\n\t\t\tif a >= b {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tdata.Swap(a, b-1)\n\t\t\ta++\n\t\t\tb--\n\t\t}\n\t}\n\tdata.Swap(pivot, b-1)\n\treturn b - 1, c\n}\n\n// Auto-generated variant of sort.go:quickSort\nfunc _sort_quickSort_func(data _sort_lessSwap, a, b, maxDepth int) {\n\tfor b-a > 12 {\n\t\tif maxDepth == 0 {\n\t\t\t_sort_heapSort_func(data, a, b)\n\t\t\treturn\n\t\t}\n\t\tmaxDepth--\n\t\tmlo, mhi := _sort_doPivot_func(data, a, b)\n\t\tif mlo-a < b-mhi {\n\t\t\t_sort_quickSort_func(data, a, mlo, maxDepth)\n\t\t\ta = mhi\n\t\t} else {\n\t\t\t_sort_quickSort_func(data, mhi, b, maxDepth)\n\t\t\tb = mlo\n\t\t}\n\t}\n\tif b-a > 1 {\n\t\tfor i := a + 6; i < b; i++ {\n\t\t\tif data.Less(i, i-6) {\n\t\t\t\tdata.Swap(i, i-6)\n\t\t\t}\n\t\t}\n\t\t_sort_insertionSort_func(data, a, b)\n\t}\n}\n\n// ----------------------------------------------------------------------------\n\nfunc _sort_Swapper(slice interface{}) func(i, j int) {\n\tv := reflect.ValueOf(slice)\n\tvdata := v.Pointer()\n\tvlen := v.Len()\n\tvcap := v.Cap()\n\n\tsz := int(v.Type().Elem().Size())\n\n\t// for typical small elements\n\tswitch sz {\n\tcase 24: // for slice\n\t\tvar s [][3]int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 16: // for string\n\t\tvar s [][2]int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 8:\n\t\tvar s []int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 4:\n\t\tvar s []int32\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 2:\n\t\tvar s []int16\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\tcase 1:\n\t\tvar s []int8\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen\n\t\th.Cap = vcap\n\t\treturn func(i, j int) { s[i], s[j] = s[j], s[i] }\n\t}\n\n\t// for large elements\n\tif sz%16 == 0 {\n\t\tm := sz / 16\n\t\tvar s [][2]int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n\tif sz%8 == 0 {\n\t\tm := sz / 8\n\t\tvar s []int64\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n\tif sz%4 == 0 {\n\t\tm := sz / 4\n\t\tvar s []int32\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n\tif sz%2 == 0 {\n\t\tm := sz / 2\n\t\tvar s []int16\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tm := sz\n\t\tvar s []int8\n\t\th := (*reflect.SliceHeader)(unsafe.Pointer(&s))\n\t\th.Data = vdata\n\t\th.Len = vlen * m\n\t\th.Cap = vcap * m\n\t\treturn func(i, j int) {\n\t\t\tfor k := 0; k < m; k++ {\n\t\t\t\tri := i*m + k\n\t\t\t\trj := j*m + k\n\t\t\t\ts[ri], s[rj] = s[rj], s[ri]\n\t\t\t}\n\t\t}\n\t}\n}\n\n// =============================================================================\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N points in a two-dimensional plane.\n\nThe coordinates of the i-th point (1 \\leq i \\leq N) are (x_i,y_i).\n\nLet us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior.\n\nHere, points on the sides of the rectangle are considered to be in the interior.\n\nFind the minimum possible area of such a rectangle.\n\nConstraints\n\n2 \\leq K \\leq N \\leq 50\n\n-10^9 \\leq x_i,y_i \\leq 10^9 (1 \\leq i \\leq N)\n\nx_i≠x_j (1 \\leq i ans.sugar/ans.water\n\t\tif sw.sugar*ans.water > ans.sugar*sw.water {\n\t\t\tans = sw\n\t\t}\n\t}\n\tfmt.Println(ans.water+ans.sugar, ans.sugar)\n}\n", "language": "Go", "metadata": {"date": 1573158963, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03599.html", "problem_id": "p03599", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03599/input.txt", "sample_output_relpath": "derived/input_output/data/p03599/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03599/Go/s304044975.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304044975", "user_id": "u712822150"}, "prompt_components": {"gold_output": "110 10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype sugarWater struct {\n\twater int\n\tsugar int\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\ta, b, c, d, e, f := nextInt(), nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\n\tsugarWaterArray := make([]sugarWater, 0)\n\tfor ai := 0; ai*a*100 <= f; ai++ {\n\t\tsugarWaterArray = append(sugarWaterArray, sugarWater{ai * a * 100, 0})\n\t}\n\n\tl := len(sugarWaterArray)\n\tfor li := 0; li < l; li++ {\n\t\tsw := sugarWaterArray[0]\n\t\tsugarWaterArray = sugarWaterArray[1:]\n\t\tfor bi := 0; bi*b*100+sw.water <= f; bi++ {\n\t\t\tsugarWaterArray = append(sugarWaterArray, sugarWater{bi*b*100 + sw.water, 0})\n\t\t}\n\t}\n\n\tl = len(sugarWaterArray)\n\tfor li := 0; li < l; li++ {\n\t\tsw := sugarWaterArray[0]\n\t\tsugarWaterArray = sugarWaterArray[1:]\n\t\tif sw.water == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor ci := 0; ci*c+sw.water <= f; ci++ {\n\t\t\tsugarWaterArray = append(sugarWaterArray, sugarWater{sw.water, ci * c})\n\t\t}\n\t}\n\n\tfor swi := range sugarWaterArray {\n\t\tmaxSugar1 := f - (sugarWaterArray[swi].water + sugarWaterArray[swi].sugar)\n\t\tmaxSugar2 := (sugarWaterArray[swi].water * e / 100) - sugarWaterArray[swi].sugar\n\t\tvar maxSugar int\n\t\tswitch {\n\t\tcase maxSugar1 < maxSugar2:\n\t\t\tmaxSugar = maxSugar1\n\t\tdefault:\n\t\t\tmaxSugar = maxSugar2\n\t\t}\n\t\tswitch {\n\t\tcase maxSugar < 0:\n\t\t\tsugarWaterArray[swi].sugar = 0\n\t\tdefault:\n\t\t\tsugarWaterArray[swi].sugar += (maxSugar / d) * d\n\t\t}\n\t}\n\n\tans := sugarWaterArray[0]\n\tfor _, sw := range sugarWaterArray {\n\t\t// sw.sugar/sw.water > ans.sugar/ans.water\n\t\tif sw.sugar*ans.water > ans.sugar*sw.water {\n\t\t\tans = sw\n\t\t}\n\t}\n\tfmt.Println(ans.water+ans.sugar, ans.sugar)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke is making sugar water in a beaker.\nInitially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations.\n\nOperation 1: Pour 100A grams of water into the beaker.\n\nOperation 2: Pour 100B grams of water into the beaker.\n\nOperation 3: Put C grams of sugar into the beaker.\n\nOperation 4: Put D grams of sugar into the beaker.\n\nIn our experimental environment, E grams of sugar can dissolve into 100 grams of water.\n\nSnuke will make sugar water with the highest possible density.\n\nThe beaker can contain at most F grams of substances (water and sugar combined), and there must not be any undissolved sugar in the beaker.\nFind the mass of the sugar water Snuke will make, and the mass of sugar dissolved in it.\nIf there is more than one candidate, any of them will be accepted.\n\nWe remind you that the sugar water that contains a grams of water and b grams of sugar is \\frac{100b}{a + b} percent.\nAlso, in this problem, pure water that does not contain any sugar is regarded as 0 percent density sugar water.\n\nConstraints\n\n1 \\leq A < B \\leq 30\n\n1 \\leq C < D \\leq 30\n\n1 \\leq E \\leq 100\n\n100A \\leq F \\leq 3 000\n\nA, B, C, D, E and F are all integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nA B C D E F\n\nOutputs\n\nPrint two integers separated by a space.\nThe first integer should be the mass of the desired sugar water, and the second should be the mass of the sugar dissolved in it.\n\nSample Input 1\n\n1 2 10 20 15 200\n\nSample Output 1\n\n110 10\n\nIn this environment, 15 grams of sugar can dissolve into 100 grams of water, and the beaker can contain at most 200 grams of substances.\n\nWe can make 110 grams of sugar water by performing Operation 1 once and Operation 3 once.\nIt is not possible to make sugar water with higher density.\nFor example, the following sequences of operations are infeasible:\n\nIf we perform Operation 1 once and Operation 4 once, there will be undissolved sugar in the beaker.\n\nIf we perform Operation 2 once and Operation 3 three times, the mass of substances in the beaker will exceed 200 grams.\n\nSample Input 2\n\n1 2 1 2 100 1000\n\nSample Output 2\n\n200 100\n\nThere are other acceptable outputs, such as:\n\n400 200\n\nHowever, the output below is not acceptable:\n\n300 150\n\nThis is because, in order to make 300 grams of sugar water containing 150 grams of sugar, we need to pour exactly 150 grams of water into the beaker, which is impossible.\n\nSample Input 3\n\n17 19 22 26 55 2802\n\nSample Output 3\n\n2634 934", "sample_input": "1 2 10 20 15 200\n"}, "reference_outputs": ["110 10\n"], "source_document_id": "p03599", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke is making sugar water in a beaker.\nInitially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations.\n\nOperation 1: Pour 100A grams of water into the beaker.\n\nOperation 2: Pour 100B grams of water into the beaker.\n\nOperation 3: Put C grams of sugar into the beaker.\n\nOperation 4: Put D grams of sugar into the beaker.\n\nIn our experimental environment, E grams of sugar can dissolve into 100 grams of water.\n\nSnuke will make sugar water with the highest possible density.\n\nThe beaker can contain at most F grams of substances (water and sugar combined), and there must not be any undissolved sugar in the beaker.\nFind the mass of the sugar water Snuke will make, and the mass of sugar dissolved in it.\nIf there is more than one candidate, any of them will be accepted.\n\nWe remind you that the sugar water that contains a grams of water and b grams of sugar is \\frac{100b}{a + b} percent.\nAlso, in this problem, pure water that does not contain any sugar is regarded as 0 percent density sugar water.\n\nConstraints\n\n1 \\leq A < B \\leq 30\n\n1 \\leq C < D \\leq 30\n\n1 \\leq E \\leq 100\n\n100A \\leq F \\leq 3 000\n\nA, B, C, D, E and F are all integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nA B C D E F\n\nOutputs\n\nPrint two integers separated by a space.\nThe first integer should be the mass of the desired sugar water, and the second should be the mass of the sugar dissolved in it.\n\nSample Input 1\n\n1 2 10 20 15 200\n\nSample Output 1\n\n110 10\n\nIn this environment, 15 grams of sugar can dissolve into 100 grams of water, and the beaker can contain at most 200 grams of substances.\n\nWe can make 110 grams of sugar water by performing Operation 1 once and Operation 3 once.\nIt is not possible to make sugar water with higher density.\nFor example, the following sequences of operations are infeasible:\n\nIf we perform Operation 1 once and Operation 4 once, there will be undissolved sugar in the beaker.\n\nIf we perform Operation 2 once and Operation 3 three times, the mass of substances in the beaker will exceed 200 grams.\n\nSample Input 2\n\n1 2 1 2 100 1000\n\nSample Output 2\n\n200 100\n\nThere are other acceptable outputs, such as:\n\n400 200\n\nHowever, the output below is not acceptable:\n\n300 150\n\nThis is because, in order to make 300 grams of sugar water containing 150 grams of sugar, we need to pour exactly 150 grams of water into the beaker, which is impossible.\n\nSample Input 3\n\n17 19 22 26 55 2802\n\nSample Output 3\n\n2634 934", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1874, "cpu_time_ms": 2, "memory_kb": 1536}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s898091579", "group_id": "codeNet:p03599", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype sugarWater struct {\n\tsugar, water int\n}\n\nvar (\n\tchecked = map[sugarWater]struct{}{}\n\ta, b, c, d, e, f int\n\tans sugarWater\n)\n\nfunc dfs(sugar, water int) {\n\tif sugar+water > f || 100*sugar > e*water {\n\t\treturn\n\t}\n\tif _, in := checked[sugarWater{sugar, water}]; in {\n\t\treturn\n\t}\n\tif sugar*ans.water > water*ans.sugar {\n\t\tans = sugarWater{sugar, water}\n\t}\n\tchecked[sugarWater{sugar, water}] = struct{}{}\n\n\tdfs(sugar, water+100*a)\n\tdfs(sugar, water+100*b)\n\tdfs(sugar+c, water)\n\tdfs(sugar+d, water)\n}\n\nfunc main() {\n\tans = sugarWater{-1, 0}\n\tfmt.Scan(&a, &b, &c, &d, &e, &f)\n\n\tdfs(0, 100*a)\n\tdfs(0, 100*b)\n\n\tfmt.Println(ans.sugar+ans.water, ans.sugar)\n}\n", "language": "Go", "metadata": {"date": 1550305287, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03599.html", "problem_id": "p03599", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03599/input.txt", "sample_output_relpath": "derived/input_output/data/p03599/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03599/Go/s898091579.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s898091579", "user_id": "u323680411"}, "prompt_components": {"gold_output": "110 10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype sugarWater struct {\n\tsugar, water int\n}\n\nvar (\n\tchecked = map[sugarWater]struct{}{}\n\ta, b, c, d, e, f int\n\tans sugarWater\n)\n\nfunc dfs(sugar, water int) {\n\tif sugar+water > f || 100*sugar > e*water {\n\t\treturn\n\t}\n\tif _, in := checked[sugarWater{sugar, water}]; in {\n\t\treturn\n\t}\n\tif sugar*ans.water > water*ans.sugar {\n\t\tans = sugarWater{sugar, water}\n\t}\n\tchecked[sugarWater{sugar, water}] = struct{}{}\n\n\tdfs(sugar, water+100*a)\n\tdfs(sugar, water+100*b)\n\tdfs(sugar+c, water)\n\tdfs(sugar+d, water)\n}\n\nfunc main() {\n\tans = sugarWater{-1, 0}\n\tfmt.Scan(&a, &b, &c, &d, &e, &f)\n\n\tdfs(0, 100*a)\n\tdfs(0, 100*b)\n\n\tfmt.Println(ans.sugar+ans.water, ans.sugar)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke is making sugar water in a beaker.\nInitially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations.\n\nOperation 1: Pour 100A grams of water into the beaker.\n\nOperation 2: Pour 100B grams of water into the beaker.\n\nOperation 3: Put C grams of sugar into the beaker.\n\nOperation 4: Put D grams of sugar into the beaker.\n\nIn our experimental environment, E grams of sugar can dissolve into 100 grams of water.\n\nSnuke will make sugar water with the highest possible density.\n\nThe beaker can contain at most F grams of substances (water and sugar combined), and there must not be any undissolved sugar in the beaker.\nFind the mass of the sugar water Snuke will make, and the mass of sugar dissolved in it.\nIf there is more than one candidate, any of them will be accepted.\n\nWe remind you that the sugar water that contains a grams of water and b grams of sugar is \\frac{100b}{a + b} percent.\nAlso, in this problem, pure water that does not contain any sugar is regarded as 0 percent density sugar water.\n\nConstraints\n\n1 \\leq A < B \\leq 30\n\n1 \\leq C < D \\leq 30\n\n1 \\leq E \\leq 100\n\n100A \\leq F \\leq 3 000\n\nA, B, C, D, E and F are all integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nA B C D E F\n\nOutputs\n\nPrint two integers separated by a space.\nThe first integer should be the mass of the desired sugar water, and the second should be the mass of the sugar dissolved in it.\n\nSample Input 1\n\n1 2 10 20 15 200\n\nSample Output 1\n\n110 10\n\nIn this environment, 15 grams of sugar can dissolve into 100 grams of water, and the beaker can contain at most 200 grams of substances.\n\nWe can make 110 grams of sugar water by performing Operation 1 once and Operation 3 once.\nIt is not possible to make sugar water with higher density.\nFor example, the following sequences of operations are infeasible:\n\nIf we perform Operation 1 once and Operation 4 once, there will be undissolved sugar in the beaker.\n\nIf we perform Operation 2 once and Operation 3 three times, the mass of substances in the beaker will exceed 200 grams.\n\nSample Input 2\n\n1 2 1 2 100 1000\n\nSample Output 2\n\n200 100\n\nThere are other acceptable outputs, such as:\n\n400 200\n\nHowever, the output below is not acceptable:\n\n300 150\n\nThis is because, in order to make 300 grams of sugar water containing 150 grams of sugar, we need to pour exactly 150 grams of water into the beaker, which is impossible.\n\nSample Input 3\n\n17 19 22 26 55 2802\n\nSample Output 3\n\n2634 934", "sample_input": "1 2 10 20 15 200\n"}, "reference_outputs": ["110 10\n"], "source_document_id": "p03599", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke is making sugar water in a beaker.\nInitially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations.\n\nOperation 1: Pour 100A grams of water into the beaker.\n\nOperation 2: Pour 100B grams of water into the beaker.\n\nOperation 3: Put C grams of sugar into the beaker.\n\nOperation 4: Put D grams of sugar into the beaker.\n\nIn our experimental environment, E grams of sugar can dissolve into 100 grams of water.\n\nSnuke will make sugar water with the highest possible density.\n\nThe beaker can contain at most F grams of substances (water and sugar combined), and there must not be any undissolved sugar in the beaker.\nFind the mass of the sugar water Snuke will make, and the mass of sugar dissolved in it.\nIf there is more than one candidate, any of them will be accepted.\n\nWe remind you that the sugar water that contains a grams of water and b grams of sugar is \\frac{100b}{a + b} percent.\nAlso, in this problem, pure water that does not contain any sugar is regarded as 0 percent density sugar water.\n\nConstraints\n\n1 \\leq A < B \\leq 30\n\n1 \\leq C < D \\leq 30\n\n1 \\leq E \\leq 100\n\n100A \\leq F \\leq 3 000\n\nA, B, C, D, E and F are all integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nA B C D E F\n\nOutputs\n\nPrint two integers separated by a space.\nThe first integer should be the mass of the desired sugar water, and the second should be the mass of the sugar dissolved in it.\n\nSample Input 1\n\n1 2 10 20 15 200\n\nSample Output 1\n\n110 10\n\nIn this environment, 15 grams of sugar can dissolve into 100 grams of water, and the beaker can contain at most 200 grams of substances.\n\nWe can make 110 grams of sugar water by performing Operation 1 once and Operation 3 once.\nIt is not possible to make sugar water with higher density.\nFor example, the following sequences of operations are infeasible:\n\nIf we perform Operation 1 once and Operation 4 once, there will be undissolved sugar in the beaker.\n\nIf we perform Operation 2 once and Operation 3 three times, the mass of substances in the beaker will exceed 200 grams.\n\nSample Input 2\n\n1 2 1 2 100 1000\n\nSample Output 2\n\n200 100\n\nThere are other acceptable outputs, such as:\n\n400 200\n\nHowever, the output below is not acceptable:\n\n300 150\n\nThis is because, in order to make 300 grams of sugar water containing 150 grams of sugar, we need to pour exactly 150 grams of water into the beaker, which is impossible.\n\nSample Input 3\n\n17 19 22 26 55 2802\n\nSample Output 3\n\n2634 934", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 708, "cpu_time_ms": 5, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448081716", "group_id": "codeNet:p03600", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc intMin(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := scanInt()\n\tA, B := make([][]int, N), make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = make([]int, N)\n\t\tB[i] = make([]int, N)\n\t\tfor j := 0; j < N; j++ {\n\t\t\tA[i][j] = scanInt()\n\t\t\tB[i][j] = A[i][j]\n\t\t}\n\t}\n\n\tfor k := 0; k < N; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\tB[i][j] = intMin(B[i][j], B[i][k]+B[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i; j < N; j++ {\n\t\t\tif B[i][j] < A[i][j] {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tfor k := 0; k < N; k++ {\n\t\t\t\tif (i-k)*(j-k) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif A[i][k]+A[k][j] == A[i][j] {\n\t\t\t\t\tB[i][j] = -1\n\t\t\t\t\tB[j][i] = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif B[i][j] != -1 {\n\t\t\t\tans += B[i][j]\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1599067912, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03600.html", "problem_id": "p03600", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03600/input.txt", "sample_output_relpath": "derived/input_output/data/p03600/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03600/Go/s448081716.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448081716", "user_id": "u941434715"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc intMin(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := scanInt()\n\tA, B := make([][]int, N), make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = make([]int, N)\n\t\tB[i] = make([]int, N)\n\t\tfor j := 0; j < N; j++ {\n\t\t\tA[i][j] = scanInt()\n\t\t\tB[i][j] = A[i][j]\n\t\t}\n\t}\n\n\tfor k := 0; k < N; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\tB[i][j] = intMin(B[i][j], B[i][k]+B[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i; j < N; j++ {\n\t\t\tif B[i][j] < A[i][j] {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tfor k := 0; k < N; k++ {\n\t\t\t\tif (i-k)*(j-k) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif A[i][k]+A[k][j] == A[i][j] {\n\t\t\t\t\tB[i][j] = -1\n\t\t\t\t\tB[j][i] = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif B[i][j] != -1 {\n\t\t\t\tans += B[i][j]\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "sample_input": "3\n0 1 3\n1 0 2\n3 2 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03600", "source_text": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1186, "cpu_time_ms": 209, "memory_kb": 4876}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s263926044", "group_id": "codeNet:p03600", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\ta := make([][]int, N)\n\tb := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = make([]int, N)\n\t\tb[i] = make([]int, N)\n\t\tfor j := 0; j < N; j++ {\n\t\t\ta[i][j] = getInt()\n\t\t\tb[i][j] = a[i][j]\n\t\t}\n\t}\n\n\tfor k := 0; k < N; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\tif b[i][j] > b[i][k]+b[k][j] {\n\t\t\t\t\tout(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor k := 0; k < N; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\tif a[i][j] == a[i][k]+a[k][j] {\n\t\t\t\t\tif i != k && j != k {\n\t\t\t\t\t\tb[i][j] = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// out(\"----\")\n\t// for i := 0; i < N; i++ {\n\t// \tout(b[i])\n\t// }\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tans += b[i][j]\n\t\t}\n\t}\n\tout(ans / 2)\n}\n", "language": "Go", "metadata": {"date": 1589855237, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03600.html", "problem_id": "p03600", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03600/input.txt", "sample_output_relpath": "derived/input_output/data/p03600/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03600/Go/s263926044.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s263926044", "user_id": "u814575783"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\ta := make([][]int, N)\n\tb := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = make([]int, N)\n\t\tb[i] = make([]int, N)\n\t\tfor j := 0; j < N; j++ {\n\t\t\ta[i][j] = getInt()\n\t\t\tb[i][j] = a[i][j]\n\t\t}\n\t}\n\n\tfor k := 0; k < N; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\tif b[i][j] > b[i][k]+b[k][j] {\n\t\t\t\t\tout(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor k := 0; k < N; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\tif a[i][j] == a[i][k]+a[k][j] {\n\t\t\t\t\tif i != k && j != k {\n\t\t\t\t\t\tb[i][j] = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// out(\"----\")\n\t// for i := 0; i < N; i++ {\n\t// \tout(b[i])\n\t// }\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tans += b[i][j]\n\t\t}\n\t}\n\tout(ans / 2)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "sample_input": "3\n0 1 3\n1 0 2\n3 2 0\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03600", "source_text": "Score : 500 points\n\nProblem Statement\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n\nPeople traveled between cities only through roads. It was possible to reach any city from any other city, via intermediate cities if necessary.\n\nDifferent roads may have had different lengths, but all the lengths were positive integers.\n\nSnuke the archeologist found a table with N rows and N columns, A, in the ruin of Takahashi Kingdom.\nHe thought that it represented the shortest distances between the cities along the roads in the kingdom.\n\nDetermine whether there exists a road network such that for each u and v, the integer A_{u, v} at the u-th row and v-th column of A is equal to the length of the shortest path from City u to City v.\nIf such a network exist, find the shortest possible total length of the roads.\n\nConstraints\n\n1 \\leq N \\leq 300\n\nIf i ≠ j, 1 \\leq A_{i, j} = A_{j, i} \\leq 10^9.\n\nA_{i, i} = 0\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} ... A_{1, N}\nA_{2, 1} A_{2, 2} ... A_{2, N}\n...\nA_{N, 1} A_{N, 2} ... A_{N, N}\n\nOutputs\n\nIf there exists no network that satisfies the condition, print -1.\nIf it exists, print the shortest possible total length of the roads.\n\nSample Input 1\n\n3\n0 1 3\n1 0 2\n3 2 0\n\nSample Output 1\n\n3\n\nThe network below satisfies the condition:\n\nCity 1 and City 2 is connected by a road of length 1.\n\nCity 2 and City 3 is connected by a road of length 2.\n\nCity 3 and City 1 is not connected by a road.\n\nSample Input 2\n\n3\n0 1 3\n1 0 1\n3 1 0\n\nSample Output 2\n\n-1\n\nAs there is a path of length 1 from City 1 to City 2 and City 2 to City 3, there is a path of length 2 from City 1 to City 3.\nHowever, according to the table, the shortest distance between City 1 and City 3 must be 3.\n\nThus, we conclude that there exists no network that satisfies the condition.\n\nSample Input 3\n\n5\n0 21 18 11 28\n21 0 13 10 26\n18 13 0 23 13\n11 10 23 0 17\n28 26 13 17 0\n\nSample Output 3\n\n82\n\nSample Input 4\n\n3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n\nSample Output 4\n\n3000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1641, "cpu_time_ms": 232, "memory_kb": 3712}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s311524261", "group_id": "codeNet:p03603", "input_text": "package main\nimport \"fmt\"\nvar tree [][]int\nvar x []int64\nfunc main() {\n var n,p int\n fmt.Scan(&n)\n if n == 1 { fmt.Println(\"POSSIBLE\");return }\n tree = make([][]int,n)\n x = make([]int64,n)\n for i:=1;i z { y,z = z,y }\n if y > 0 { zero = false }\n s += y+z\n for i:=x[v];i>y-1;i-- {\n if dp[i-y] { dp[i] = true;continue }\n if i > z-1 && dp[i-z] { dp[i] = true }\n }\n }\n dp[0] = zero\n for i:=x[v];i>-1;i-- {\n if dp[i] { return s-int64(i) }\n }\n return -1\n}", "language": "Go", "metadata": {"date": 1560709752, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03603.html", "problem_id": "p03603", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03603/input.txt", "sample_output_relpath": "derived/input_output/data/p03603/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03603/Go/s311524261.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s311524261", "user_id": "u506403362"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "package main\nimport \"fmt\"\nvar tree [][]int\nvar x []int64\nfunc main() {\n var n,p int\n fmt.Scan(&n)\n if n == 1 { fmt.Println(\"POSSIBLE\");return }\n tree = make([][]int,n)\n x = make([]int64,n)\n for i:=1;i z { y,z = z,y }\n if y > 0 { zero = false }\n s += y+z\n for i:=x[v];i>y-1;i-- {\n if dp[i-y] { dp[i] = true;continue }\n if i > z-1 && dp[i-z] { dp[i] = true }\n }\n }\n dp[0] = zero\n for i:=x[v];i>-1;i-- {\n if dp[i] { return s-int64(i) }\n }\n return -1\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a tree with N vertices. Vertex 1 is the root of the tree, and the parent of Vertex i (2 \\leq i \\leq N) is Vertex P_i.\n\nTo each vertex in the tree, Snuke will allocate a color, either black or white, and a non-negative integer weight.\n\nSnuke has a favorite integer sequence, X_1, X_2, ..., X_N, so he wants to allocate colors and weights so that the following condition is satisfied for all v.\n\nThe total weight of the vertices with the same color as v among the vertices contained in the subtree whose root is v, is X_v.\n\nHere, the subtree whose root is v is the tree consisting of Vertex v and all of its descendants.\n\nDetermine whether it is possible to allocate colors and weights in this way.\n\nConstraints\n\n1 \\leq N \\leq 1 000\n\n1 \\leq P_i \\leq i - 1\n\n0 \\leq X_i \\leq 5 000\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nP_2 P_3 ... P_N\nX_1 X_2 ... X_N\n\nOutputs\n\nIf it is possible to allocate colors and weights to the vertices so that the condition is satisfied, print POSSIBLE; otherwise, print IMPOSSIBLE.\n\nSample Input 1\n\n3\n1 1\n4 3 2\n\nSample Output 1\n\nPOSSIBLE\n\nFor example, the following allocation satisfies the condition:\n\nSet the color of Vertex 1 to white and its weight to 2.\n\nSet the color of Vertex 2 to black and its weight to 3.\n\nSet the color of Vertex 3 to white and its weight to 2.\n\nThere are also other possible allocations.\n\nSample Input 2\n\n3\n1 2\n1 2 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nIf the same color is allocated to Vertex 2 and Vertex 3, Vertex 2 cannot be allocated a non-negative weight.\n\nIf different colors are allocated to Vertex 2 and 3, no matter which color is allocated to Vertex 1, it cannot be allocated a non-negative weight.\n\nThus, there exists no allocation of colors and weights that satisfies the condition.\n\nSample Input 3\n\n8\n1 1 1 3 4 5 5\n4 1 6 2 2 1 3 3\n\nSample Output 3\n\nPOSSIBLE\n\nSample Input 4\n\n1\n\n0\n\nSample Output 4\n\nPOSSIBLE", "sample_input": "3\n1 1\n4 3 2\n"}, "reference_outputs": ["POSSIBLE\n"], "source_document_id": "p03603", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a tree with N vertices. Vertex 1 is the root of the tree, and the parent of Vertex i (2 \\leq i \\leq N) is Vertex P_i.\n\nTo each vertex in the tree, Snuke will allocate a color, either black or white, and a non-negative integer weight.\n\nSnuke has a favorite integer sequence, X_1, X_2, ..., X_N, so he wants to allocate colors and weights so that the following condition is satisfied for all v.\n\nThe total weight of the vertices with the same color as v among the vertices contained in the subtree whose root is v, is X_v.\n\nHere, the subtree whose root is v is the tree consisting of Vertex v and all of its descendants.\n\nDetermine whether it is possible to allocate colors and weights in this way.\n\nConstraints\n\n1 \\leq N \\leq 1 000\n\n1 \\leq P_i \\leq i - 1\n\n0 \\leq X_i \\leq 5 000\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nP_2 P_3 ... P_N\nX_1 X_2 ... X_N\n\nOutputs\n\nIf it is possible to allocate colors and weights to the vertices so that the condition is satisfied, print POSSIBLE; otherwise, print IMPOSSIBLE.\n\nSample Input 1\n\n3\n1 1\n4 3 2\n\nSample Output 1\n\nPOSSIBLE\n\nFor example, the following allocation satisfies the condition:\n\nSet the color of Vertex 1 to white and its weight to 2.\n\nSet the color of Vertex 2 to black and its weight to 3.\n\nSet the color of Vertex 3 to white and its weight to 2.\n\nThere are also other possible allocations.\n\nSample Input 2\n\n3\n1 2\n1 2 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nIf the same color is allocated to Vertex 2 and Vertex 3, Vertex 2 cannot be allocated a non-negative weight.\n\nIf different colors are allocated to Vertex 2 and 3, no matter which color is allocated to Vertex 1, it cannot be allocated a non-negative weight.\n\nThus, there exists no allocation of colors and weights that satisfies the condition.\n\nSample Input 3\n\n8\n1 1 1 3 4 5 5\n4 1 6 2 2 1 3 3\n\nSample Output 3\n\nPOSSIBLE\n\nSample Input 4\n\n1\n\n0\n\nSample Output 4\n\nPOSSIBLE", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 912, "cpu_time_ms": 12, "memory_kb": 2816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s169196093", "group_id": "codeNet:p03607", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tn := scanInt(sc)\n\n\tns := make(map[int]int, n)\n\tflip := []int{-1, 1}\n\ttotal := 0\n\n\tfor i := 0; i < n; i++ {\n\t\ta := scanInt(sc) - 1\n\t\tns[a] = (ns[a] + 1) % 2\n\t\ttotal += flip[ns[a]]\n\t}\n\n\tfmt.Println(total)\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}", "language": "Go", "metadata": {"date": 1534475677, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03607.html", "problem_id": "p03607", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03607/input.txt", "sample_output_relpath": "derived/input_output/data/p03607/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03607/Go/s169196093.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s169196093", "user_id": "u307252896"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tn := scanInt(sc)\n\n\tns := make(map[int]int, n)\n\tflip := []int{-1, 1}\n\ttotal := 0\n\n\tfor i := 0; i < n; i++ {\n\t\ta := scanInt(sc) - 1\n\t\tns[a] = (ns[a] + 1) % 2\n\t\ttotal += flip[ns[a]]\n\t}\n\n\tfmt.Println(total)\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are playing the following game with Joisino.\n\nInitially, you have a blank sheet of paper.\n\nJoisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.\n\nThen, you are asked a question: How many numbers are written on the sheet now?\n\nThe numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?\n\nConstraints\n\n1≤N≤100000\n\n1≤A_i≤1000000000(=10^9)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint how many numbers will be written on the sheet at the end of the game.\n\nSample Input 1\n\n3\n6\n2\n6\n\nSample Output 1\n\n1\n\nThe game proceeds as follows:\n\n6 is not written on the sheet, so write 6.\n\n2 is not written on the sheet, so write 2.\n\n6 is written on the sheet, so erase 6.\n\nThus, the sheet contains only 2 in the end. The answer is 1.\n\nSample Input 2\n\n4\n2\n5\n5\n2\n\nSample Output 2\n\n0\n\nIt is possible that no number is written on the sheet in the end.\n\nSample Input 3\n\n6\n12\n22\n16\n22\n18\n12\n\nSample Output 3\n\n2", "sample_input": "3\n6\n2\n6\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03607", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are playing the following game with Joisino.\n\nInitially, you have a blank sheet of paper.\n\nJoisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.\n\nThen, you are asked a question: How many numbers are written on the sheet now?\n\nThe numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?\n\nConstraints\n\n1≤N≤100000\n\n1≤A_i≤1000000000(=10^9)\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint how many numbers will be written on the sheet at the end of the game.\n\nSample Input 1\n\n3\n6\n2\n6\n\nSample Output 1\n\n1\n\nThe game proceeds as follows:\n\n6 is not written on the sheet, so write 6.\n\n2 is not written on the sheet, so write 2.\n\n6 is written on the sheet, so erase 6.\n\nThus, the sheet contains only 2 in the end. The answer is 1.\n\nSample Input 2\n\n4\n2\n5\n5\n2\n\nSample Output 2\n\n0\n\nIt is possible that no number is written on the sheet in the end.\n\nSample Input 3\n\n6\n12\n22\n16\n22\n18\n12\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 407, "cpu_time_ms": 34, "memory_kb": 4608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s339210100", "group_id": "codeNet:p03608", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nvar mod = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n, m, R int\n\tfmt.Fscan(r, &n)\n\tfmt.Fscan(r, &m)\n\tfmt.Fscan(r, &R)\n\n\trs := make([]int, R)\n\tfor i := 0; i < R; i++ {\n\t\tfmt.Fscan(r, &rs[i])\n\t\trs[i]--\n\t}\n\n\tcosts := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tcosts[i] = make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tcosts[i][j] = math.MaxInt64\n\t\t}\n\t\tcosts[i][i] = 0\n\t}\n\tvar a, b, c int\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tfmt.Fscan(r, &b)\n\t\tfmt.Fscan(r, &c)\n\t\ta--\n\t\tb--\n\t\tcosts[a][b] = c\n\t\tcosts[b][a] = c\n\t}\n\n\t// ワーシャルフロイド法で最短経路を算出\n\tfor k := 0; k < n; k++ {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tcosts[i][j] = min(costs[i][j], costs[i][k]+costs[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\t// 順列で訪問先の順序をすべて試す\n\t// これでは重複して訪問する町がでてしまうか。。\n\tperms := permutations(rs)\n\tans := math.MaxInt64\n\tfor _, perm := range perms {\n\t\ttmp := 0\n\t\tfor j := 1; j < len(perm); j++ {\n\t\t\tfrom := perm[j-1]\n\t\t\tto := perm[j]\n\t\t\ttmp += costs[from][to]\n\t\t}\n\t\tans = min(ans, tmp)\n\t}\n\tfmt.Println(ans)\n}\n\n// permutations\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "language": "Go", "metadata": {"date": 1593482320, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03608.html", "problem_id": "p03608", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03608/input.txt", "sample_output_relpath": "derived/input_output/data/p03608/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03608/Go/s339210100.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s339210100", "user_id": "u433254839"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nvar mod = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n, m, R int\n\tfmt.Fscan(r, &n)\n\tfmt.Fscan(r, &m)\n\tfmt.Fscan(r, &R)\n\n\trs := make([]int, R)\n\tfor i := 0; i < R; i++ {\n\t\tfmt.Fscan(r, &rs[i])\n\t\trs[i]--\n\t}\n\n\tcosts := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tcosts[i] = make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tcosts[i][j] = math.MaxInt64\n\t\t}\n\t\tcosts[i][i] = 0\n\t}\n\tvar a, b, c int\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tfmt.Fscan(r, &b)\n\t\tfmt.Fscan(r, &c)\n\t\ta--\n\t\tb--\n\t\tcosts[a][b] = c\n\t\tcosts[b][a] = c\n\t}\n\n\t// ワーシャルフロイド法で最短経路を算出\n\tfor k := 0; k < n; k++ {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tcosts[i][j] = min(costs[i][j], costs[i][k]+costs[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\t// 順列で訪問先の順序をすべて試す\n\t// これでは重複して訪問する町がでてしまうか。。\n\tperms := permutations(rs)\n\tans := math.MaxInt64\n\tfor _, perm := range perms {\n\t\ttmp := 0\n\t\tfor j := 1; j < len(perm); j++ {\n\t\t\tfrom := perm[j-1]\n\t\t\tto := perm[j]\n\t\t\ttmp += costs[from][to]\n\t\t}\n\t\tans = min(ans, tmp)\n\t}\n\tfmt.Println(ans)\n}\n\n// permutations\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N towns in the State of Atcoder, connected by M bidirectional roads.\n\nThe i-th road connects Town A_i and B_i and has a length of C_i.\n\nJoisino is visiting R towns in the state, r_1,r_2,..,r_R (not necessarily in this order).\n\nShe will fly to the first town she visits, and fly back from the last town she visits, but for the rest of the trip she will have to travel by road.\n\nIf she visits the towns in the order that minimizes the distance traveled by road, what will that distance be?\n\nConstraints\n\n2≤N≤200\n\n1≤M≤N×(N-1)/2\n\n2≤R≤min(8,N) (min(8,N) is the smaller of 8 and N.)\n\nr_i≠r_j (i≠j)\n\n1≤A_i,B_i≤N, A_i≠B_i\n\n(A_i,B_i)≠(A_j,B_j),(A_i,B_i)≠(B_j,A_j) (i≠j)\n\n1≤C_i≤100000\n\nEvery town can be reached from every town by road.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M R\nr_1 ... r_R\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nPrint the distance traveled by road if Joisino visits the towns in the order that minimizes it.\n\nSample Input 1\n\n3 3 3\n1 2 3\n1 2 1\n2 3 1\n3 1 4\n\nSample Output 1\n\n2\n\nFor example, if she visits the towns in the order of 1, 2, 3, the distance traveled will be 2, which is the minimum possible.\n\nSample Input 2\n\n3 3 2\n1 3\n2 3 2\n1 3 6\n1 2 2\n\nSample Output 2\n\n4\n\nThe shortest distance between Towns 1 and 3 is 4. Thus, whether she visits Town 1 or 3 first, the distance traveled will be 4.\n\nSample Input 3\n\n4 6 3\n2 3 4\n1 2 4\n2 3 3\n4 3 1\n1 4 1\n4 2 2\n3 1 6\n\nSample Output 3\n\n3", "sample_input": "3 3 3\n1 2 3\n1 2 1\n2 3 1\n3 1 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03608", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N towns in the State of Atcoder, connected by M bidirectional roads.\n\nThe i-th road connects Town A_i and B_i and has a length of C_i.\n\nJoisino is visiting R towns in the state, r_1,r_2,..,r_R (not necessarily in this order).\n\nShe will fly to the first town she visits, and fly back from the last town she visits, but for the rest of the trip she will have to travel by road.\n\nIf she visits the towns in the order that minimizes the distance traveled by road, what will that distance be?\n\nConstraints\n\n2≤N≤200\n\n1≤M≤N×(N-1)/2\n\n2≤R≤min(8,N) (min(8,N) is the smaller of 8 and N.)\n\nr_i≠r_j (i≠j)\n\n1≤A_i,B_i≤N, A_i≠B_i\n\n(A_i,B_i)≠(A_j,B_j),(A_i,B_i)≠(B_j,A_j) (i≠j)\n\n1≤C_i≤100000\n\nEvery town can be reached from every town by road.\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M R\nr_1 ... r_R\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nPrint the distance traveled by road if Joisino visits the towns in the order that minimizes it.\n\nSample Input 1\n\n3 3 3\n1 2 3\n1 2 1\n2 3 1\n3 1 4\n\nSample Output 1\n\n2\n\nFor example, if she visits the towns in the order of 1, 2, 3, the distance traveled will be 2, which is the minimum possible.\n\nSample Input 2\n\n3 3 2\n1 3\n2 3 2\n1 3 6\n1 2 2\n\nSample Output 2\n\n4\n\nThe shortest distance between Towns 1 and 3 is 4. Thus, whether she visits Town 1 or 3 first, the distance traveled will be 4.\n\nSample Input 3\n\n4 6 3\n2 3 4\n1 2 4\n2 3 3\n4 3 1\n1 4 1\n4 2 2\n3 1 6\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5902, "cpu_time_ms": 70, "memory_kb": 10100}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s884565033", "group_id": "codeNet:p03609", "input_text": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar x, t int\n\tfmt.Scan(&x, &t)\n\tans := max(0, x-t)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1558961839, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03609.html", "problem_id": "p03609", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03609/input.txt", "sample_output_relpath": "derived/input_output/data/p03609/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03609/Go/s884565033.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s884565033", "user_id": "u150861392"}, "prompt_components": {"gold_output": "83\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar x, t int\n\tfmt.Scan(&x, &t)\n\tans := max(0, x-t)\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.\n\nHow many grams of sand will the upper bulb contains after t seconds?\n\nConstraints\n\n1≤X≤10^9\n\n1≤t≤10^9\n\nX and t are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX t\n\nOutput\n\nPrint the number of sand in the upper bulb after t second.\n\nSample Input 1\n\n100 17\n\nSample Output 1\n\n83\n\n17 out of the initial 100 grams of sand will be consumed, resulting in 83 grams.\n\nSample Input 2\n\n48 58\n\nSample Output 2\n\n0\n\nAll 48 grams of sand will be gone, resulting in 0 grams.\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n0", "sample_input": "100 17\n"}, "reference_outputs": ["83\n"], "source_document_id": "p03609", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.\n\nHow many grams of sand will the upper bulb contains after t seconds?\n\nConstraints\n\n1≤X≤10^9\n\n1≤t≤10^9\n\nX and t are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX t\n\nOutput\n\nPrint the number of sand in the upper bulb after t second.\n\nSample Input 1\n\n100 17\n\nSample Output 1\n\n83\n\n17 out of the initial 100 grams of sand will be consumed, resulting in 83 grams.\n\nSample Input 2\n\n48 58\n\nSample Output 2\n\n0\n\nAll 48 grams of sand will be gone, resulting in 0 grams.\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 178, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s861975103", "group_id": "codeNet:p03610", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar nextString func() string\n\nfunc init() {\n\tnextString = newReadString(os.Stdin)\n}\n\nfunc main() {\n\ts := nextString()\n\tfor i := 0; i < len(s); i += 2 {\n\t\tfmt.Print(string(s[i]))\n\t}\n\tfmt.Println()\n}\n\nfunc nextInt() (result int) {\n\tresult, _ = strconv.Atoi(nextString())\n\treturn\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1541274771, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03610.html", "problem_id": "p03610", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03610/input.txt", "sample_output_relpath": "derived/input_output/data/p03610/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03610/Go/s861975103.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s861975103", "user_id": "u323680411"}, "prompt_components": {"gold_output": "acdr\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar nextString func() string\n\nfunc init() {\n\tnextString = newReadString(os.Stdin)\n}\n\nfunc main() {\n\ts := nextString()\n\tfor i := 0; i < len(s); i += 2 {\n\t\tfmt.Print(string(s[i]))\n\t}\n\tfmt.Println()\n}\n\nfunc nextInt() (result int) {\n\tresult, _ = strconv.Atoi(nextString())\n\treturn\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1.\n\nConstraints\n\nEach character in s is a lowercase English letter.\n\n1≤|s|≤10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string obtained by concatenating all the characters in the odd-numbered positions.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\nacdr\n\nExtract the first character a, the third character c, the fifth character d and the seventh character r to obtain acdr.\n\nSample Input 2\n\naaaa\n\nSample Output 2\n\naa\n\nSample Input 3\n\nz\n\nSample Output 3\n\nz\n\nSample Input 4\n\nfukuokayamaguchi\n\nSample Output 4\n\nfkoaaauh", "sample_input": "atcoder\n"}, "reference_outputs": ["acdr\n"], "source_document_id": "p03610", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1.\n\nConstraints\n\nEach character in s is a lowercase English letter.\n\n1≤|s|≤10^5\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string obtained by concatenating all the characters in the odd-numbered positions.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\nacdr\n\nExtract the first character a, the third character c, the fifth character d and the seventh character r to obtain acdr.\n\nSample Input 2\n\naaaa\n\nSample Output 2\n\naa\n\nSample Input 3\n\nz\n\nSample Output 3\n\nz\n\nSample Input 4\n\nfukuokayamaguchi\n\nSample Output 4\n\nfkoaaauh", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 560, "cpu_time_ms": 110, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s928872382", "group_id": "codeNet:p03612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar n int\nvar P []int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn = tmp[0]\n\tP = NextIntsLine()\n\tfor i := 0; i < n; i++ {\n\t\tP[i]--\n\t}\n\n\tcheck := [100001]bool{}\n\tfor i := 0; i < n; i++ {\n\t\tif i == P[i] {\n\t\t\tcheck[i] = true\n\t\t} else {\n\t\t\tcheck[i] = false\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < n-1; i++ {\n\t\tif check[i] {\n\t\t\tans++\n\t\t\tif check[i+1] {\n\t\t\t\tcheck[i+1] = false\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1543634681, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03612.html", "problem_id": "p03612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03612/input.txt", "sample_output_relpath": "derived/input_output/data/p03612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03612/Go/s928872382.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s928872382", "user_id": "u103600314"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar n int\nvar P []int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn = tmp[0]\n\tP = NextIntsLine()\n\tfor i := 0; i < n; i++ {\n\t\tP[i]--\n\t}\n\n\tcheck := [100001]bool{}\n\tfor i := 0; i < n; i++ {\n\t\tif i == P[i] {\n\t\t\tcheck[i] = true\n\t\t} else {\n\t\t\tcheck[i] = false\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < n-1; i++ {\n\t\tif check[i] {\n\t\t\tans++\n\t\t\tif check[i+1] {\n\t\t\t\tcheck[i+1] = false\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given a permutation p_1,p_2,...,p_N consisting of 1,2,..,N.\nYou can perform the following operation any number of times (possibly zero):\n\nOperation: Swap two adjacent elements in the permutation.\n\nYou want to have p_i ≠ i for all 1≤i≤N.\nFind the minimum required number of operations to achieve this.\n\nConstraints\n\n2≤N≤10^5\n\np_1,p_2,..,p_N is a permutation of 1,2,..,N.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\np_1 p_2 .. p_N\n\nOutput\n\nPrint the minimum required number of operations\n\nSample Input 1\n\n5\n1 4 3 5 2\n\nSample Output 1\n\n2\n\nSwap 1 and 4, then swap 1 and 3. p is now 4,3,1,5,2 and satisfies the condition.\nThis is the minimum possible number, so the answer is 2.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n\nSwapping 1 and 2 satisfies the condition.\n\nSample Input 3\n\n2\n2 1\n\nSample Output 3\n\n0\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n9\n1 2 4 9 5 8 7 3 6\n\nSample Output 4\n\n3", "sample_input": "5\n1 4 3 5 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03612", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given a permutation p_1,p_2,...,p_N consisting of 1,2,..,N.\nYou can perform the following operation any number of times (possibly zero):\n\nOperation: Swap two adjacent elements in the permutation.\n\nYou want to have p_i ≠ i for all 1≤i≤N.\nFind the minimum required number of operations to achieve this.\n\nConstraints\n\n2≤N≤10^5\n\np_1,p_2,..,p_N is a permutation of 1,2,..,N.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\np_1 p_2 .. p_N\n\nOutput\n\nPrint the minimum required number of operations\n\nSample Input 1\n\n5\n1 4 3 5 2\n\nSample Output 1\n\n2\n\nSwap 1 and 4, then swap 1 and 3. p is now 4,3,1,5,2 and satisfies the condition.\nThis is the minimum possible number, so the answer is 2.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n1\n\nSwapping 1 and 2 satisfies the condition.\n\nSample Input 3\n\n2\n2 1\n\nSample Output 3\n\n0\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n9\n1 2 4 9 5 8 7 3 6\n\nSample Output 4\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4918, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s517206724", "group_id": "codeNet:p03618", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tS := []byte(getString())\n\tn := len(S)\n\n\tN := n*(n-1)/2 + 1\n\ta := make(map[byte]int)\n\tfor _, v := range S {\n\t\ta[v]++\n\t}\n\tfor _, v := range a {\n\t\tN -= v * (v - 1) / 2\n\t}\n\tout(N)\n}\n", "language": "Go", "metadata": {"date": 1585971467, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03618.html", "problem_id": "p03618", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03618/input.txt", "sample_output_relpath": "derived/input_output/data/p03618/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03618/Go/s517206724.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s517206724", "user_id": "u814575783"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tS := []byte(getString())\n\tn := len(S)\n\n\tN := n*(n-1)/2 + 1\n\ta := make(map[byte]int)\n\tfor _, v := range S {\n\t\ta[v]++\n\t}\n\tfor _, v := range a {\n\t\tN -= v * (v - 1) / 2\n\t}\n\tout(N)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou have a string A = A_1 A_2 ... A_n consisting of lowercase English letters.\n\nYou can choose any two indices i and j such that 1 \\leq i \\leq j \\leq n and reverse substring A_i A_{i+1} ... A_j.\n\nYou can perform this operation at most once.\n\nHow many different strings can you obtain?\n\nConstraints\n\n1 \\leq |A| \\leq 200,000\n\nA consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\n\nOutput\n\nPrint the number of different strings you can obtain by reversing any substring in A at most once.\n\nSample Input 1\n\naatt\n\nSample Output 1\n\n5\n\nYou can obtain aatt (don't do anything), atat (reverse A[2..3]), atta (reverse A[2..4]), ttaa (reverse A[1..4]) and taat (reverse A[1..3]).\n\nSample Input 2\n\nxxxxxxxxxx\n\nSample Output 2\n\n1\n\nWhatever substring you reverse, you'll always get xxxxxxxxxx.\n\nSample Input 3\n\nabracadabra\n\nSample Output 3\n\n44", "sample_input": "aatt\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03618", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou have a string A = A_1 A_2 ... A_n consisting of lowercase English letters.\n\nYou can choose any two indices i and j such that 1 \\leq i \\leq j \\leq n and reverse substring A_i A_{i+1} ... A_j.\n\nYou can perform this operation at most once.\n\nHow many different strings can you obtain?\n\nConstraints\n\n1 \\leq |A| \\leq 200,000\n\nA consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\n\nOutput\n\nPrint the number of different strings you can obtain by reversing any substring in A at most once.\n\nSample Input 1\n\naatt\n\nSample Output 1\n\n5\n\nYou can obtain aatt (don't do anything), atat (reverse A[2..3]), atta (reverse A[2..4]), ttaa (reverse A[1..4]) and taat (reverse A[1..3]).\n\nSample Input 2\n\nxxxxxxxxxx\n\nSample Output 2\n\n1\n\nWhatever substring you reverse, you'll always get xxxxxxxxxx.\n\nSample Input 3\n\nabracadabra\n\nSample Output 3\n\n44", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 562, "cpu_time_ms": 26, "memory_kb": 1536}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s275114076", "group_id": "codeNet:p03623", "input_text": "package main\n\nimport \"fmt\"\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn (-1) * a\n}\n\nfunc main() {\n\tvar x, a, b int\n\tfmt.Scan(&x, &a, &b)\n\n\tif abs(x-a) < abs(x-b) {\n\t\tfmt.Println(\"A\")\n\t} else {\n\t\tfmt.Println(\"B\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1597201345, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03623.html", "problem_id": "p03623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03623/input.txt", "sample_output_relpath": "derived/input_output/data/p03623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03623/Go/s275114076.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s275114076", "user_id": "u061804469"}, "prompt_components": {"gold_output": "B\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn (-1) * a\n}\n\nfunc main() {\n\tvar x, a, b int\n\tfmt.Scan(&x, &a, &b)\n\n\tif abs(x-a) < abs(x-b) {\n\t\tfmt.Println(\"A\")\n\t} else {\n\t\tfmt.Println(\"B\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "sample_input": "5 2 7\n"}, "reference_outputs": ["B\n"], "source_document_id": "p03623", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 229, "cpu_time_ms": 3, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s373794128", "group_id": "codeNet:p03623", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for A - Meal Delivery\n\tvar x, a, b int\n\tfmt.Scanf(\"%d %d %d\", &x, &a, &b)\n\n\tif math.Abs(float64(x-a)) > math.Abs(float64(x-b)) {\n\t\tfmt.Printf(\"B\")\n\t} else {\n\t\tfmt.Printf(\"A\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1597163549, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03623.html", "problem_id": "p03623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03623/input.txt", "sample_output_relpath": "derived/input_output/data/p03623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03623/Go/s373794128.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s373794128", "user_id": "u128015095"}, "prompt_components": {"gold_output": "B\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for A - Meal Delivery\n\tvar x, a, b int\n\tfmt.Scanf(\"%d %d %d\", &x, &a, &b)\n\n\tif math.Abs(float64(x-a)) > math.Abs(float64(x-b)) {\n\t\tfmt.Printf(\"B\")\n\t} else {\n\t\tfmt.Printf(\"A\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "sample_input": "5 2 7\n"}, "reference_outputs": ["B\n"], "source_document_id": "p03623", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 244, "cpu_time_ms": 8, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s432635917", "group_id": "codeNet:p03623", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x, a, b float64\n\tfmt.Scan(&x, &a, &b)\n\n\tif math.Abs(x-a) < math.Abs(x-b) {\n\t\tfmt.Println(\"A\")\n\t} else {\n\t\tfmt.Println(\"B\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1516352734, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03623.html", "problem_id": "p03623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03623/input.txt", "sample_output_relpath": "derived/input_output/data/p03623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03623/Go/s432635917.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s432635917", "user_id": "u159043787"}, "prompt_components": {"gold_output": "B\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x, a, b float64\n\tfmt.Scan(&x, &a, &b)\n\n\tif math.Abs(x-a) < math.Abs(x-b) {\n\t\tfmt.Println(\"A\")\n\t} else {\n\t\tfmt.Println(\"B\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "sample_input": "5 2 7\n"}, "reference_outputs": ["B\n"], "source_document_id": "p03623", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and B.\nFind out which store is closer to Snuke's residence.\n\nHere, the distance between two points s and t on a number line is represented by |s-t|.\n\nConstraints\n\n1 \\leq x \\leq 1000\n\n1 \\leq a \\leq 1000\n\n1 \\leq b \\leq 1000\n\nx, a and b are pairwise distinct.\n\nThe distances between Snuke's residence and stores A and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx a b\n\nOutput\n\nIf store A is closer, print A; if store B is closer, print B.\n\nSample Input 1\n\n5 2 7\n\nSample Output 1\n\nB\n\nThe distances between Snuke's residence and stores A and B are 3 and 2, respectively.\nSince store B is closer, print B.\n\nSample Input 2\n\n1 999 1000\n\nSample Output 2\n\nA", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 188, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s461703662", "group_id": "codeNet:p03625", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := readInt()\n\tm := make(map[int]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta := readInt()\n\t\tm[a]++\n\t}\n\n\ttype stick struct{ a, c int }\n\tsts := make([]stick, 0, len(m))\n\tfor a, c := range m {\n\t\tsts = append(sts, stick{a, c})\n\t}\n\tsort.Slice(sts, func(i, j int) bool { return sts[i].a > sts[j].a })\n\tt := 0\n\tfor _, st := range sts {\n\t\tif t == 0 {\n\t\t\tif st.c >= 4 {\n\t\t\t\tfmt.Println(st.a * st.a)\n\t\t\t\treturn\n\t\t\t} else if st.c >= 2 {\n\t\t\t\tt = st.a\n\t\t\t}\n\t\t} else {\n\t\t\tif st.c >= 2 {\n\t\t\t\tfmt.Println(t * st.a)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(0)\n}\n", "language": "Go", "metadata": {"date": 1589444225, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03625.html", "problem_id": "p03625", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03625/input.txt", "sample_output_relpath": "derived/input_output/data/p03625/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03625/Go/s461703662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s461703662", "user_id": "u461993794"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := readInt()\n\tm := make(map[int]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta := readInt()\n\t\tm[a]++\n\t}\n\n\ttype stick struct{ a, c int }\n\tsts := make([]stick, 0, len(m))\n\tfor a, c := range m {\n\t\tsts = append(sts, stick{a, c})\n\t}\n\tsort.Slice(sts, func(i, j int) bool { return sts[i].a > sts[j].a })\n\tt := 0\n\tfor _, st := range sts {\n\t\tif t == 0 {\n\t\t\tif st.c >= 4 {\n\t\t\t\tfmt.Println(st.a * st.a)\n\t\t\t\treturn\n\t\t\t} else if st.c >= 2 {\n\t\t\t\tt = st.a\n\t\t\t}\n\t\t} else {\n\t\t\tif st.c >= 2 {\n\t\t\t\tfmt.Println(t * st.a)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(0)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N sticks with negligible thickness.\nThe length of the i-th stick is A_i.\n\nSnuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides.\nFind the maximum possible area of the rectangle.\n\nConstraints\n\n4 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible area of the rectangle.\nIf no rectangle can be formed, print 0.\n\nSample Input 1\n\n6\n3 1 2 4 2 1\n\nSample Output 1\n\n2\n\n1 \\times 2 rectangle can be formed.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n\nNo rectangle can be formed.\n\nSample Input 3\n\n10\n3 3 3 3 4 4 4 5 5 5\n\nSample Output 3\n\n20", "sample_input": "6\n3 1 2 4 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03625", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N sticks with negligible thickness.\nThe length of the i-th stick is A_i.\n\nSnuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides.\nFind the maximum possible area of the rectangle.\n\nConstraints\n\n4 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible area of the rectangle.\nIf no rectangle can be formed, print 0.\n\nSample Input 1\n\n6\n3 1 2 4 2 1\n\nSample Output 1\n\n2\n\n1 \\times 2 rectangle can be formed.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n\nNo rectangle can be formed.\n\nSample Input 3\n\n10\n3 3 3 3 4 4 4 5 5 5\n\nSample Output 3\n\n20", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 778, "cpu_time_ms": 56, "memory_kb": 7656}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s963809621", "group_id": "codeNet:p03625", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N, w int\n\tfmt.Scan(&N)\n\tm := map[int]int{}\n\tvar a []int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&w)\n\t\tm[w]++\n\t}\n\tfor k, v := range m {\n\t\tif v >= 2 {\n\t\t\ta = append(a, k)\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tif len(a) > 1 {\n\t\tfmt.Println(a[0] * a[1])\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}", "language": "Go", "metadata": {"date": 1563536850, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03625.html", "problem_id": "p03625", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03625/input.txt", "sample_output_relpath": "derived/input_output/data/p03625/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03625/Go/s963809621.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s963809621", "user_id": "u298152049"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N, w int\n\tfmt.Scan(&N)\n\tm := map[int]int{}\n\tvar a []int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&w)\n\t\tm[w]++\n\t}\n\tfor k, v := range m {\n\t\tif v >= 2 {\n\t\t\ta = append(a, k)\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tif len(a) > 1 {\n\t\tfmt.Println(a[0] * a[1])\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N sticks with negligible thickness.\nThe length of the i-th stick is A_i.\n\nSnuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides.\nFind the maximum possible area of the rectangle.\n\nConstraints\n\n4 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible area of the rectangle.\nIf no rectangle can be formed, print 0.\n\nSample Input 1\n\n6\n3 1 2 4 2 1\n\nSample Output 1\n\n2\n\n1 \\times 2 rectangle can be formed.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n\nNo rectangle can be formed.\n\nSample Input 3\n\n10\n3 3 3 3 4 4 4 5 5 5\n\nSample Output 3\n\n20", "sample_input": "6\n3 1 2 4 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03625", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N sticks with negligible thickness.\nThe length of the i-th stick is A_i.\n\nSnuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides.\nFind the maximum possible area of the rectangle.\n\nConstraints\n\n4 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible area of the rectangle.\nIf no rectangle can be formed, print 0.\n\nSample Input 1\n\n6\n3 1 2 4 2 1\n\nSample Output 1\n\n2\n\n1 \\times 2 rectangle can be formed.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n\nNo rectangle can be formed.\n\nSample Input 3\n\n10\n3 3 3 3 4 4 4 5 5 5\n\nSample Output 3\n\n20", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 351, "cpu_time_ms": 702, "memory_kb": 7936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s910833427", "group_id": "codeNet:p03629", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt() int {\n n, _ := strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Solve(S *[][]int, N int) string {\n LC := \"abcdefghijklmnopqrstuvwxyz\"\n W := make([][]int, 6)\n W[0] = []int{0}\n for i, w := range W {\n W[i + 1] = make([]int, len(w) * 26)\n for j, v := range w {\n for k, s := range LC {\n value := (*S)[int(s) - int('a')][v]\n if value < 0 {\n key := make([]rune, i + 1)\n key[i] = s\n for l := i; 0 < l; l-- {\n key[l - 1] = rune(int('a') + j % 26)\n j /= 26\n }\n return string(key)\n }\n W[i + 1][j * 26 + k] = value\n }\n }\n }\n return \"\"\n}\n\nfunc main() {\n A := NextLine()\n S := make([][]int, 26)\n N := len(A)\n for i := range S {\n S[i] = make([]int, N + 1)\n S[i][N] = -1\n }\n for i, a := range A {\n s := int(a) - int('a')\n S[s][i] = i + 1\n }\n for i := range S {\n for j := range S[i][1:] {\n if S[i][N - 1 - j] == 0 { S[i][N - 1 - j] = S[i][N - j] }\n }\n }\n Write(Solve(&S, N))\n Output()\n}", "language": "Go", "metadata": {"date": 1579072610, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03629.html", "problem_id": "p03629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03629/input.txt", "sample_output_relpath": "derived/input_output/data/p03629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03629/Go/s910833427.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s910833427", "user_id": "u415905784"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt() int {\n n, _ := strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Solve(S *[][]int, N int) string {\n LC := \"abcdefghijklmnopqrstuvwxyz\"\n W := make([][]int, 6)\n W[0] = []int{0}\n for i, w := range W {\n W[i + 1] = make([]int, len(w) * 26)\n for j, v := range w {\n for k, s := range LC {\n value := (*S)[int(s) - int('a')][v]\n if value < 0 {\n key := make([]rune, i + 1)\n key[i] = s\n for l := i; 0 < l; l-- {\n key[l - 1] = rune(int('a') + j % 26)\n j /= 26\n }\n return string(key)\n }\n W[i + 1][j * 26 + k] = value\n }\n }\n }\n return \"\"\n}\n\nfunc main() {\n A := NextLine()\n S := make([][]int, 26)\n N := len(A)\n for i := range S {\n S[i] = make([]int, N + 1)\n S[i][N] = -1\n }\n for i, a := range A {\n s := int(a) - int('a')\n S[s][i] = i + 1\n }\n for i := range S {\n for j := range S[i][1:] {\n if S[i][N - 1 - j] == 0 { S[i][N - 1 - j] = S[i][N - j] }\n }\n }\n Write(Solve(&S, N))\n Output()\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nA subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters.\nFor example, arc, artistic and (an empty string) are all subsequences of artistic; abc and ci are not.\n\nYou are given a string A consisting of lowercase English letters.\nFind the shortest string among the strings consisting of lowercase English letters that are not subsequences of A.\nIf there are more than one such string, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq |A| \\leq 2 \\times 10^5\n\nA consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\n\nOutput\n\nPrint the lexicographically smallest string among the shortest strings consisting of lowercase English letters that are not subsequences of A.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a as a subsequence, but not b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\naa\n\nSample Input 3\n\nfrqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn\n\nSample Output 3\n\naca", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03629", "source_text": "Score : 600 points\n\nProblem Statement\n\nA subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters.\nFor example, arc, artistic and (an empty string) are all subsequences of artistic; abc and ci are not.\n\nYou are given a string A consisting of lowercase English letters.\nFind the shortest string among the strings consisting of lowercase English letters that are not subsequences of A.\nIf there are more than one such string, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq |A| \\leq 2 \\times 10^5\n\nA consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\n\nOutput\n\nPrint the lexicographically smallest string among the shortest strings consisting of lowercase English letters that are not subsequences of A.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a as a subsequence, but not b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\naa\n\nSample Input 3\n\nfrqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn\n\nSample Output 3\n\naca", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1841, "cpu_time_ms": 234, "memory_kb": 220800}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s573220243", "group_id": "codeNet:p03632", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\td := nextInt()\n\tstate := make([]int, 101)\n\tfor i := 0; i <= 100; i++ {\n\t\tif a <= i && i <= b {\n\t\t\tstate[i]++\n\t\t}\n\t\tif c <= i && i <= d {\n\t\t\tstate[i]++\n\t\t}\n\t}\n\n\tcnt := 0\n\tfor _, v := range state {\n\t\tif v == 2 {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif cnt > 0 {\n\t\tfmt.Println(cnt - 1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1598058383, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03632.html", "problem_id": "p03632", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03632/input.txt", "sample_output_relpath": "derived/input_output/data/p03632/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03632/Go/s573220243.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s573220243", "user_id": "u756000295"}, "prompt_components": {"gold_output": "50\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\td := nextInt()\n\tstate := make([]int, 101)\n\tfor i := 0; i <= 100; i++ {\n\t\tif a <= i && i <= b {\n\t\t\tstate[i]++\n\t\t}\n\t\tif c <= i && i <= d {\n\t\t\tstate[i]++\n\t\t}\n\t}\n\n\tcnt := 0\n\tfor _, v := range state {\n\t\tif v == 2 {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif cnt > 0 {\n\t\tfmt.Println(cnt - 1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAlice and Bob are controlling a robot. They each have one switch that controls the robot.\n\nAlice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.\n\nBob started holding down his button C second after the start-up, and released his button D second after the start-up.\n\nFor how many seconds both Alice and Bob were holding down their buttons?\n\nConstraints\n\n0≤A= 0 {\n\t\tfmt.Println(to - from)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}", "language": "Go", "metadata": {"date": 1555987776, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03632.html", "problem_id": "p03632", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03632/input.txt", "sample_output_relpath": "derived/input_output/data/p03632/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03632/Go/s477874249.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s477874249", "user_id": "u857510905"}, "prompt_components": {"gold_output": "50\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\tvar from, to int\n\tif a < c {\n\t\tfrom = c\n\t} else {\n\t\tfrom = a\n\t}\n\tif b < d {\n\t\tto = b\n\t} else {\n\t\tto = d\n\t}\n\tif to - from >= 0 {\n\t\tfmt.Println(to - from)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAlice and Bob are controlling a robot. They each have one switch that controls the robot.\n\nAlice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.\n\nBob started holding down his button C second after the start-up, and released his button D second after the start-up.\n\nFor how many seconds both Alice and Bob were holding down their buttons?\n\nConstraints\n\n0≤A dist[v] + c {\n dist[b] = dist[v] + c\n }\n }\n l = l[1:]\n if len(l) == 0 {\n break\n }\n }\n for i := 0; i < q; i++ {\n fmt.Scan(&x,&y)\n fmt.Println(dist[x]+dist[y])\n }\n}", "language": "Go", "metadata": {"date": 1502591924, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03634.html", "problem_id": "p03634", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03634/input.txt", "sample_output_relpath": "derived/input_output/data/p03634/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03634/Go/s625801448.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s625801448", "user_id": "u823542847"}, "prompt_components": {"gold_output": "3\n2\n4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,a,b,c,q,k,x,y,v,max int\n fmt.Scan(&n)\n mp := make(map[int][]int)\n md := make(map[int][]int)\n for i := 1; i < n; i++ {\n fmt.Scan(&a,&b,&c)\n mp[a] = append(mp[a],b)\n md[a] = append(md[a],c)\n mp[b] = append(mp[b],a)\n md[b] = append(md[b],c)\n }\n fmt.Scan(&q,&k)\n dist := make([]int,n+1)\n max = n*1000000000\n for i := 0; i < n+1; i++ {\n dist[i] = max\n }\n dist[k] = 0\n l := []int{k}\n for {\n v = l[0]\n for i := 0; i < len(mp[v]); i++ {\n b = mp[v][i]\n c = md[v][i]\n if dist[b] == max {\n l = append(l,b)\n }\n if dist[b] > dist[v] + c {\n dist[b] = dist[v] + c\n }\n }\n l = l[1:]\n if len(l) == 0 {\n break\n }\n }\n for i := 0; i < q; i++ {\n fmt.Scan(&x,&y)\n fmt.Println(dist[x]+dist[y])\n }\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given a tree with N vertices.\n\nHere, a tree is a kind of graph, and more specifically, a connected undirected graph with N-1 edges, where N is the number of its vertices.\n\nThe i-th edge (1≤i≤N-1) connects Vertices a_i and b_i, and has a length of c_i.\n\nYou are also given Q queries and an integer K. In the j-th query (1≤j≤Q):\n\nfind the length of the shortest path from Vertex x_j and Vertex y_j via Vertex K.\n\nConstraints\n\n3≤N≤10^5\n\n1≤a_i,b_i≤N (1≤i≤N-1)\n\n1≤c_i≤10^9 (1≤i≤N-1)\n\nThe given graph is a tree.\n\n1≤Q≤10^5\n\n1≤K≤N\n\n1≤x_j,y_j≤N (1≤j≤Q)\n\nx_j≠y_j (1≤j≤Q)\n\nx_j≠K,y_j≠K (1≤j≤Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\n:\na_{N-1} b_{N-1} c_{N-1}\nQ K\nx_1 y_1\n:\nx_{Q} y_{Q}\n\nOutput\n\nPrint the responses to the queries in Q lines.\n\nIn the j-th line j(1≤j≤Q), print the response to the j-th query.\n\nSample Input 1\n\n5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5\n\nSample Output 1\n\n3\n2\n4\n\nThe shortest paths for the three queries are as follows:\n\nQuery 1: Vertex 2 → Vertex 1 → Vertex 2 → Vertex 4 : Length 1+1+1=3\n\nQuery 2: Vertex 2 → Vertex 1 → Vertex 3 : Length 1+1=2\n\nQuery 3: Vertex 4 → Vertex 2 → Vertex 1 → Vertex 3 → Vertex 5 : Length 1+1+1+1=4\n\nSample Input 2\n\n7\n1 2 1\n1 3 3\n1 4 5\n1 5 7\n1 6 9\n1 7 11\n3 2\n1 3\n4 5\n6 7\n\nSample Output 2\n\n5\n14\n22\n\nThe path for each query must pass Vertex K=2.\n\nSample Input 3\n\n10\n1 2 1000000000\n2 3 1000000000\n3 4 1000000000\n4 5 1000000000\n5 6 1000000000\n6 7 1000000000\n7 8 1000000000\n8 9 1000000000\n9 10 1000000000\n1 1\n9 10\n\nSample Output 3\n\n17000000000", "sample_input": "5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5\n"}, "reference_outputs": ["3\n2\n4\n"], "source_document_id": "p03634", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given a tree with N vertices.\n\nHere, a tree is a kind of graph, and more specifically, a connected undirected graph with N-1 edges, where N is the number of its vertices.\n\nThe i-th edge (1≤i≤N-1) connects Vertices a_i and b_i, and has a length of c_i.\n\nYou are also given Q queries and an integer K. In the j-th query (1≤j≤Q):\n\nfind the length of the shortest path from Vertex x_j and Vertex y_j via Vertex K.\n\nConstraints\n\n3≤N≤10^5\n\n1≤a_i,b_i≤N (1≤i≤N-1)\n\n1≤c_i≤10^9 (1≤i≤N-1)\n\nThe given graph is a tree.\n\n1≤Q≤10^5\n\n1≤K≤N\n\n1≤x_j,y_j≤N (1≤j≤Q)\n\nx_j≠y_j (1≤j≤Q)\n\nx_j≠K,y_j≠K (1≤j≤Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\n:\na_{N-1} b_{N-1} c_{N-1}\nQ K\nx_1 y_1\n:\nx_{Q} y_{Q}\n\nOutput\n\nPrint the responses to the queries in Q lines.\n\nIn the j-th line j(1≤j≤Q), print the response to the j-th query.\n\nSample Input 1\n\n5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5\n\nSample Output 1\n\n3\n2\n4\n\nThe shortest paths for the three queries are as follows:\n\nQuery 1: Vertex 2 → Vertex 1 → Vertex 2 → Vertex 4 : Length 1+1+1=3\n\nQuery 2: Vertex 2 → Vertex 1 → Vertex 3 : Length 1+1=2\n\nQuery 3: Vertex 4 → Vertex 2 → Vertex 1 → Vertex 3 → Vertex 5 : Length 1+1+1+1=4\n\nSample Input 2\n\n7\n1 2 1\n1 3 3\n1 4 5\n1 5 7\n1 6 9\n1 7 11\n3 2\n1 3\n4 5\n6 7\n\nSample Output 2\n\n5\n14\n22\n\nThe path for each query must pass Vertex K=2.\n\nSample Input 3\n\n10\n1 2 1000000000\n2 3 1000000000\n3 4 1000000000\n4 5 1000000000\n5 6 1000000000\n6 7 1000000000\n7 8 1000000000\n8 9 1000000000\n9 10 1000000000\n1 1\n9 10\n\nSample Output 3\n\n17000000000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 831, "cpu_time_ms": 2109, "memory_kb": 27008}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s060319380", "group_id": "codeNet:p03637", "input_text": "package main\n\n// Solution for https://atcoder.jp/contests/abc069/tasks/arc080_a\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar n, a0, a2, a4 int\n\tcon.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tcon.Scan(&a)\n\t\tswitch a % 4 {\n\t\tcase 0:\n\t\t\ta4++\n\t\tcase 2:\n\t\t\ta2++\n\t\tdefault:\n\t\t\ta0++\n\t\t}\n\t}\n\tpossible := true\n\tif a0 > a4+1 {\n\t\tpossible = false\n\t}\n\tif a2 > 0 {\n\t\tif a0 > a4 {\n\t\t\tpossible = false\n\t\t}\n\t}\n\tif a2 == 1 {\n\t\tif a4 == 0 {\n\t\t\tpossible = false\n\t\t}\n\t}\n\tif possible {\n\t\tcon.Println(\"Yes\")\n\t} else {\n\t\tcon.Println(\"No\")\n\t}\n\treturn nil\n}\n", "language": "Go", "metadata": {"date": 1592456356, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03637.html", "problem_id": "p03637", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03637/input.txt", "sample_output_relpath": "derived/input_output/data/p03637/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03637/Go/s060319380.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s060319380", "user_id": "u718747410"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\n// Solution for https://atcoder.jp/contests/abc069/tasks/arc080_a\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar n, a0, a2, a4 int\n\tcon.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tcon.Scan(&a)\n\t\tswitch a % 4 {\n\t\tcase 0:\n\t\t\ta4++\n\t\tcase 2:\n\t\t\ta2++\n\t\tdefault:\n\t\t\ta0++\n\t\t}\n\t}\n\tpossible := true\n\tif a0 > a4+1 {\n\t\tpossible = false\n\t}\n\tif a2 > 0 {\n\t\tif a0 > a4 {\n\t\t\tpossible = false\n\t\t}\n\t}\n\tif a2 == 1 {\n\t\tif a4 == 0 {\n\t\t\tpossible = false\n\t\t}\n\t}\n\tif possible {\n\t\tcon.Println(\"Yes\")\n\t} else {\n\t\tcon.Println(\"No\")\n\t}\n\treturn nil\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "sample_input": "3\n1 10 100\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03637", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1380, "cpu_time_ms": 143, "memory_kb": 2944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s825802164", "group_id": "codeNet:p03637", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tp := 0\n\tq := 0\n\tr := 0\n\tfor _,x := range a {\n\t\tif x%4 == 0 {\n\t\t\tp++\n\t\t} else if x%2 == 0 {\n\t\t\tq = 1\n\t\t} else {\n\t\t\tr++\n\t\t}\n\t}\n\tif q+r-p <= 1 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1580264869, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03637.html", "problem_id": "p03637", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03637/input.txt", "sample_output_relpath": "derived/input_output/data/p03637/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03637/Go/s825802164.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s825802164", "user_id": "u843722521"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tp := 0\n\tq := 0\n\tr := 0\n\tfor _,x := range a {\n\t\tif x%4 == 0 {\n\t\t\tp++\n\t\t} else if x%2 == 0 {\n\t\t\tq = 1\n\t\t} else {\n\t\t\tr++\n\t\t}\n\t}\n\tif q+r-p <= 1 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "sample_input": "3\n1 10 100\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03637", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 339, "cpu_time_ms": 675, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s660744537", "group_id": "codeNet:p03637", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\todd, four, two int\n)\n\nfunc main() {\n\tcount()\n\n\tif (four+1 >= odd) || (odd == 2 && four >= 1) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\nfunc count() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\n\ttmp := 0\n\tfor sc.Scan() {\n\t\ttmp, _ = strconv.Atoi(sc.Text())\n\n\t\tif tmp == 2 {\n\t\t\ttwo++\n\t\t} else if tmp%2 == 1 {\n\t\t\todd++\n\t\t} else if tmp%4 == 0 {\n\t\t\tfour++\n\t\t}\n\t}\n\n\tif two > 0 {\n\t\todd++\n\t}\n}", "language": "Go", "metadata": {"date": 1521583307, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03637.html", "problem_id": "p03637", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03637/input.txt", "sample_output_relpath": "derived/input_output/data/p03637/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03637/Go/s660744537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s660744537", "user_id": "u987869509"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\todd, four, two int\n)\n\nfunc main() {\n\tcount()\n\n\tif (four+1 >= odd) || (odd == 2 && four >= 1) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\nfunc count() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\n\ttmp := 0\n\tfor sc.Scan() {\n\t\ttmp, _ = strconv.Atoi(sc.Text())\n\n\t\tif tmp == 2 {\n\t\t\ttwo++\n\t\t} else if tmp%2 == 1 {\n\t\t\todd++\n\t\t} else if tmp%4 == 0 {\n\t\t\tfour++\n\t\t}\n\t}\n\n\tif two > 0 {\n\t\todd++\n\t}\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "sample_input": "3\n1 10 100\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03637", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 498, "cpu_time_ms": 26, "memory_kb": 2176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s079719075", "group_id": "codeNet:p03638", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\th, w := scanInt(), scanInt()\n\tn := scanInt()\n\ta := scanInts(n)\n\tc := make([]int, h*w)\n\tp := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < a[i]; j++ {\n\t\t\tc[p] = i + 1\n\t\t\tp++\n\t\t}\n\t}\n\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif i&1 == 1 {\n\t\t\t\tfmt.Fprint(wr, c[i*w+w-1-j], \" \")\n\t\t\t} else {\n\t\t\t\tfmt.Fprint(wr, c[i*w+j], \" \")\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintln(wr)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593656237, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03638.html", "problem_id": "p03638", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03638/input.txt", "sample_output_relpath": "derived/input_output/data/p03638/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03638/Go/s079719075.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s079719075", "user_id": "u548992197"}, "prompt_components": {"gold_output": "1 1\n2 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\th, w := scanInt(), scanInt()\n\tn := scanInt()\n\ta := scanInts(n)\n\tc := make([]int, h*w)\n\tp := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < a[i]; j++ {\n\t\t\tc[p] = i + 1\n\t\t\tp++\n\t\t}\n\t}\n\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif i&1 == 1 {\n\t\t\t\tfmt.Fprint(wr, c[i*w+w-1-j], \" \")\n\t\t\t} else {\n\t\t\t\tfmt.Fprint(wr, c[i*w+j], \" \")\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintln(wr)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nSnuke is painting these squares in colors 1, 2, ..., N.\nHere, the following conditions should be satisfied:\n\nFor each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.\n\nFor each i (1 ≤ i ≤ N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.\n\nFind a way to paint the squares so that the conditions are satisfied.\nIt can be shown that a solution always exists.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\n1 ≤ N ≤ H W\n\na_i ≥ 1\n\na_1 + a_2 + ... + a_N = H W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint one way to paint the squares that satisfies the conditions.\nOutput in the following format:\n\nc_{1 1} ... c_{1 W}\n:\nc_{H 1} ... c_{H W}\n\nHere, c_{i j} is the color of the square at the i-th row from the top and j-th column from the left.\n\nSample Input 1\n\n2 2\n3\n2 1 1\n\nSample Output 1\n\n1 1\n2 3\n\nBelow is an example of an invalid solution:\n\n1 2\n3 1\n\nThis is because the squares painted in Color 1 are not 4-connected.\n\nSample Input 2\n\n3 5\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 4 4 4 3\n2 5 4 5 3\n2 5 5 5 3\n\nSample Input 3\n\n1 1\n1\n1\n\nSample Output 3\n\n1", "sample_input": "2 2\n3\n2 1 1\n"}, "reference_outputs": ["1 1\n2 3\n"], "source_document_id": "p03638", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns of squares.\nSnuke is painting these squares in colors 1, 2, ..., N.\nHere, the following conditions should be satisfied:\n\nFor each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.\n\nFor each i (1 ≤ i ≤ N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.\n\nFind a way to paint the squares so that the conditions are satisfied.\nIt can be shown that a solution always exists.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\n1 ≤ N ≤ H W\n\na_i ≥ 1\n\na_1 + a_2 + ... + a_N = H W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint one way to paint the squares that satisfies the conditions.\nOutput in the following format:\n\nc_{1 1} ... c_{1 W}\n:\nc_{H 1} ... c_{H W}\n\nHere, c_{i j} is the color of the square at the i-th row from the top and j-th column from the left.\n\nSample Input 1\n\n2 2\n3\n2 1 1\n\nSample Output 1\n\n1 1\n2 3\n\nBelow is an example of an invalid solution:\n\n1 2\n3 1\n\nThis is because the squares painted in Color 1 are not 4-connected.\n\nSample Input 2\n\n3 5\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 4 4 4 3\n2 5 4 5 3\n2 5 5 5 3\n\nSample Input 3\n\n1 1\n1\n1\n\nSample Output 3\n\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1407, "cpu_time_ms": 7, "memory_kb": 2032}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s300056904", "group_id": "codeNet:p03643", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\n// Sort\ntype Val struct {\n\tid, num int\n}\ntype ByNum []Val\n\nfunc (a ByNum) Len() int { return len(a) }\nfunc (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }\nfunc (a ByNum) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextStr()\n\n\tfmt.Fprintln(wtr, \"ABC\"+N)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1577078669, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03643.html", "problem_id": "p03643", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03643/input.txt", "sample_output_relpath": "derived/input_output/data/p03643/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03643/Go/s300056904.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s300056904", "user_id": "u924691798"}, "prompt_components": {"gold_output": "ABC100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\n// Sort\ntype Val struct {\n\tid, num int\n}\ntype ByNum []Val\n\nfunc (a ByNum) Len() int { return len(a) }\nfunc (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }\nfunc (a ByNum) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextStr()\n\n\tfmt.Fprintln(wtr, \"ABC\"+N)\n\twtr.Flush()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThis contest, AtCoder Beginner Contest, is abbreviated as ABC.\n\nWhen we refer to a specific round of ABC, a three-digit number is appended after ABC. For example, ABC680 is the 680th round of ABC.\n\nWhat is the abbreviation for the N-th round of ABC? Write a program to output the answer.\n\nConstraints\n\n100 ≤ N ≤ 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the abbreviation for the N-th round of ABC.\n\nSample Input 1\n\n100\n\nSample Output 1\n\nABC100\n\nThe 100th round of ABC is ABC100.\n\nSample Input 2\n\n425\n\nSample Output 2\n\nABC425\n\nSample Input 3\n\n999\n\nSample Output 3\n\nABC999", "sample_input": "100\n"}, "reference_outputs": ["ABC100\n"], "source_document_id": "p03643", "source_text": "Score : 100 points\n\nProblem Statement\n\nThis contest, AtCoder Beginner Contest, is abbreviated as ABC.\n\nWhen we refer to a specific round of ABC, a three-digit number is appended after ABC. For example, ABC680 is the 680th round of ABC.\n\nWhat is the abbreviation for the N-th round of ABC? Write a program to output the answer.\n\nConstraints\n\n100 ≤ N ≤ 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the abbreviation for the N-th round of ABC.\n\nSample Input 1\n\n100\n\nSample Output 1\n\nABC100\n\nThe 100th round of ABC is ABC100.\n\nSample Input 2\n\n425\n\nSample Output 2\n\nABC425\n\nSample Input 3\n\n999\n\nSample Output 3\n\nABC999", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1695, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s199909733", "group_id": "codeNet:p03644", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmax_n, max_cnt := 1, 0\n\tfor i := n; i > 0; i-- {\n\t\tnum := i\n\t\tcnt := 0\n\t\tfor num % 2 == 0 {\n\t\t\tcnt++\n\t\t\tnum /= 2\n\t\t}\n\t\tif cnt > max_cnt {\n\t\t\tmax_cnt = cnt\n\t\t\tmax_n = i\n\t\t}\n\t}\n\n\tfmt.Println(max_n)\n}", "language": "Go", "metadata": {"date": 1567027410, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03644.html", "problem_id": "p03644", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03644/input.txt", "sample_output_relpath": "derived/input_output/data/p03644/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03644/Go/s199909733.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s199909733", "user_id": "u536614266"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmax_n, max_cnt := 1, 0\n\tfor i := n; i > 0; i-- {\n\t\tnum := i\n\t\tcnt := 0\n\t\tfor num % 2 == 0 {\n\t\t\tcnt++\n\t\t\tnum /= 2\n\t\t}\n\t\tif cnt > max_cnt {\n\t\t\tmax_cnt = cnt\n\t\t\tmax_n = i\n\t\t}\n\t}\n\n\tfmt.Println(max_n)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves numbers divisible by 2.\n\nYou are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.\n\nHere, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.\n\nFor example,\n\n6 can be divided by 2 once: 6 -> 3.\n\n8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.\n\n3 can be divided by 2 zero times.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n4\n\n4 can be divided by 2 twice, which is the most number of times among 1, 2, ..., 7.\n\nSample Input 2\n\n32\n\nSample Output 2\n\n32\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nSample Input 4\n\n100\n\nSample Output 4\n\n64", "sample_input": "7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03644", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves numbers divisible by 2.\n\nYou are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.\n\nHere, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.\n\nFor example,\n\n6 can be divided by 2 once: 6 -> 3.\n\n8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.\n\n3 can be divided by 2 zero times.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n4\n\n4 can be divided by 2 twice, which is the most number of times among 1, 2, ..., 7.\n\nSample Input 2\n\n32\n\nSample Output 2\n\n32\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nSample Input 4\n\n100\n\nSample Output 4\n\n64", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 271, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s080065641", "group_id": "codeNet:p03644", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmax_n, max_cnt := 1, 0\n\tfor i := n; i > 0; i-- {\n\t\tnum := i\n\t\tcnt := 0\n\t\tfor {\n\t\t\tif num % 2 == 0 {\n\t\t\t\tcnt++\n\t\t\t\tnum /= 2\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif cnt > max_cnt {\n\t\t\tmax_cnt = cnt\n\t\t\tmax_n = i\n\t\t}\n\t}\n\n\tfmt.Println(max_n)\n}", "language": "Go", "metadata": {"date": 1567027267, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03644.html", "problem_id": "p03644", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03644/input.txt", "sample_output_relpath": "derived/input_output/data/p03644/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03644/Go/s080065641.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s080065641", "user_id": "u536614266"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmax_n, max_cnt := 1, 0\n\tfor i := n; i > 0; i-- {\n\t\tnum := i\n\t\tcnt := 0\n\t\tfor {\n\t\t\tif num % 2 == 0 {\n\t\t\t\tcnt++\n\t\t\t\tnum /= 2\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif cnt > max_cnt {\n\t\t\tmax_cnt = cnt\n\t\t\tmax_n = i\n\t\t}\n\t}\n\n\tfmt.Println(max_n)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves numbers divisible by 2.\n\nYou are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.\n\nHere, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.\n\nFor example,\n\n6 can be divided by 2 once: 6 -> 3.\n\n8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.\n\n3 can be divided by 2 zero times.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n4\n\n4 can be divided by 2 twice, which is the most number of times among 1, 2, ..., 7.\n\nSample Input 2\n\n32\n\nSample Output 2\n\n32\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nSample Input 4\n\n100\n\nSample Output 4\n\n64", "sample_input": "7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03644", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves numbers divisible by 2.\n\nYou are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.\n\nHere, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.\n\nFor example,\n\n6 can be divided by 2 once: 6 -> 3.\n\n8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.\n\n3 can be divided by 2 zero times.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n4\n\n4 can be divided by 2 twice, which is the most number of times among 1, 2, ..., 7.\n\nSample Input 2\n\n32\n\nSample Output 2\n\n32\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nSample Input 4\n\n100\n\nSample Output 4\n\n64", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 308, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s108420622", "group_id": "codeNet:p03645", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\tn := nextInt()\n\tm := nextInt()\n\tvar edge [200001][200001]bool\n\tfor i := 0; i < m; i++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\t\tedge[a][b] = true\n\t\tedge[b][a] = true\n\t}\n\tfor i := 0; i <= n; i++ {\n\t\tif edge[1][i] {\n\t\t\tif edge[i][n] {\n\t\t\t\tfmt.Println(\"POSSIBLE\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"IMPOSSIBLE\")\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1581600879, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03645.html", "problem_id": "p03645", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03645/input.txt", "sample_output_relpath": "derived/input_output/data/p03645/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03645/Go/s108420622.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s108420622", "user_id": "u696272993"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\tn := nextInt()\n\tm := nextInt()\n\tvar edge [200001][200001]bool\n\tfor i := 0; i < m; i++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\t\tedge[a][b] = true\n\t\tedge[b][a] = true\n\t}\n\tfor i := 0; i <= n; i++ {\n\t\tif edge[1][i] {\n\t\t\tif edge[i][n] {\n\t\t\t\tfmt.Println(\"POSSIBLE\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"IMPOSSIBLE\")\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands.\nFor convenience, we will call them Island 1, Island 2, ..., Island N.\n\nThere are M kinds of regular boat services between these islands.\nEach service connects two islands. The i-th service connects Island a_i and Island b_i.\n\nCat Snuke is on Island 1 now, and wants to go to Island N.\nHowever, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.\n\nHelp him.\n\nConstraints\n\n3 ≤ N ≤ 200 000\n\n1 ≤ M ≤ 200 000\n\n1 ≤ a_i < b_i ≤ N\n\n(a_i, b_i) \\neq (1, N)\n\nIf i \\neq j, (a_i, b_i) \\neq (a_j, b_j).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nIf it is possible to go to Island N by using two boat services, print POSSIBLE; otherwise, print IMPOSSIBLE.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\nPOSSIBLE\n\nSample Input 2\n\n4 3\n1 2\n2 3\n3 4\n\nSample Output 2\n\nIMPOSSIBLE\n\nYou have to use three boat services to get to Island 4.\n\nSample Input 3\n\n100000 1\n1 99999\n\nSample Output 3\n\nIMPOSSIBLE\n\nSample Input 4\n\n5 5\n1 3\n4 5\n2 3\n2 4\n1 4\n\nSample Output 4\n\nPOSSIBLE\n\nYou can get to Island 5 by using two boat services: Island 1 -> Island 4 -> Island 5.", "sample_input": "3 2\n1 2\n2 3\n"}, "reference_outputs": ["POSSIBLE\n"], "source_document_id": "p03645", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands.\nFor convenience, we will call them Island 1, Island 2, ..., Island N.\n\nThere are M kinds of regular boat services between these islands.\nEach service connects two islands. The i-th service connects Island a_i and Island b_i.\n\nCat Snuke is on Island 1 now, and wants to go to Island N.\nHowever, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.\n\nHelp him.\n\nConstraints\n\n3 ≤ N ≤ 200 000\n\n1 ≤ M ≤ 200 000\n\n1 ≤ a_i < b_i ≤ N\n\n(a_i, b_i) \\neq (1, N)\n\nIf i \\neq j, (a_i, b_i) \\neq (a_j, b_j).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nIf it is possible to go to Island N by using two boat services, print POSSIBLE; otherwise, print IMPOSSIBLE.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\nPOSSIBLE\n\nSample Input 2\n\n4 3\n1 2\n2 3\n3 4\n\nSample Output 2\n\nIMPOSSIBLE\n\nYou have to use three boat services to get to Island 4.\n\nSample Input 3\n\n100000 1\n1 99999\n\nSample Output 3\n\nIMPOSSIBLE\n\nSample Input 4\n\n5 5\n1 3\n4 5\n2 3\n2 4\n1 4\n\nSample Output 4\n\nPOSSIBLE\n\nYou can get to Island 5 by using two boat services: Island 1 -> Island 4 -> Island 5.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1606, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s424377437", "group_id": "codeNet:p03649", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := NewScanner()\n\tN := next.Int()\n\ta := make([]int64, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = next.Int64()\n\t}\n\n\tans := int64(0)\n\tfor true {\n\t\ttmp := int64(0)\n\t\tfor i := 0; i < N; i++ {\n\t\t\ttmp += a[i] / int64(N)\n\t\t}\n\t\t\n\t\tif tmp == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor i := 0; i < N; i++ {\n\t\t\tA := a[i]\n\t\t\ta[i] %= int64(N)\n\t\t\ta[i] += tmp - A / int64(N)\n\t\t}\n\n\t\tans += tmp\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Scanner\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc NewScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\nfunc (s *scanner) Byte() []byte {\n\treturn []byte(s.String())\n}\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Functions\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(e, ret) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(ret, a) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b > 0 {\n\t\treturn gcd(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\nfunc gcdInt64(a, b int64) int64 {\n\tif b > 0 {\n\t\treturn gcdInt64(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcmInt64(a, b int64) int64 {\n\treturn a / gcdInt64(a, b) * b\n}\n\nfunc ModPow(x, n, mod int) int {\n\tret := 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc ModPowInt64(x, n, mod int64) int64 {\n\tvar ret int64 = 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc IntComp(a, b interface{}) bool {\n\tna := a.(int)\n\tnb := b.(int)\n\n\treturn na < nb\n}\n\nfunc Int64Comp(a, b interface{}) bool {\n\tna := a.(int64)\n\tnb := b.(int64)\n\n\treturn na < nb\n}\n\nfunc FloatComp(a, b interface{}) bool {\n\tna := a.(float32)\n\tnb := b.(float32)\n\n\treturn na < nb\n}\n\nfunc Float64Comp(a, b interface{}) bool {\n\tna := a.(float64)\n\tnb := b.(float64)\n\n\treturn na < nb\n}\n\n// Structs\ntype Merger func(a, b interface{}) interface{}\ntype Comparator func(a, b interface{}) bool\n\n// Pair\ntype Pair struct {\n\tfirst, second int64\n}\n\nfunc Newpair() *Pair {\n\treturn &Pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p Pair) Less(q Pair) bool {\n\tif p.first < q.first {\n\t\treturn true\n\t} else if p.first == q.first {\n\t\treturn p.second < q.second\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc (p Pair) String() string {\n\treturn fmt.Sprint(\"(\", p.first, \", \", p.second, \")\")\n}\n\nfunc PairComp(p, q interface{}) bool {\n\tnp := p.(Pair)\n\tnq := q.(Pair)\n\n\treturn np.Less(nq)\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].Less(p[j])\n}\n\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\n// Priority Queue\n// push : Push the value to the priority queue.\n// top : Return the (Min / Max) value in the priority queue.\n// pop : Delete the (Min / Max) value in the priority queue.\n// size : Return the number of values in the priority queue.\n// empty : Return Is priority queue has the values.\ntype PriorityQueue struct {\n\tdata\t[]interface{}\n\tcomp\tComparator\n}\n\nfunc NewPriorityQueue(comp Comparator) *PriorityQueue {\n\treturn &PriorityQueue{make([]interface{}, 0), comp}\n}\n\nfunc (qu *PriorityQueue) push(x interface{}) {\n\tn := len(qu.data)\n\tqu.data = append(qu.data, x)\n\n\tfor n != 0 {\n\t\tpar := (n - 1) / 2\n\t\t\n\t\tif qu.comp(qu.data[par], qu.data[n]) {\n\t\t\tqu.data[par], qu.data[n] = qu.data[n], qu.data[par]\n\t\t}\n\n\t\tn = par\n\t}\n}\n\nfunc (qu *PriorityQueue) pop() {\n\tn := len(qu.data) - 1\n\tqu.data[0] = qu.data[n]\n\tqu.data = qu.data[:n]\n\n\tfor i, j := 0, 1; j < n; {\n\t\tj = 2 * i + 1\n\n\t\tif (j != n - 1) && qu.comp(qu.data[j], qu.data[j + 1]) {\n\t\t\tj++\n\t\t}\n\n\t\tif qu.comp(qu.data[i], qu.data[j]) {\n\t\t\tqu.data[i], qu.data[j] = qu.data[j], qu.data[i]\n\t\t}\n\n\t\ti = j\n\t}\n}\n\nfunc (qu *PriorityQueue) top() interface{} {\n\treturn qu.data[0]\n}\n\nfunc (qu *PriorityQueue) size() int {\n\treturn len(qu.data)\n}\n\nfunc (qu *PriorityQueue) empty() bool {\n\treturn len(qu.data) == 0\n}\n\n// Segment Tree\n// update : Update k-th value of SegmentTree.data to x\n// get\t : Get the merged value in range [a, b)\ntype SegmentTree struct {\n\tdata\t[]interface{}\n\tid\t\tinterface{}\n\tsize\tint\n\tmerge\tMerger\n}\n\nfunc NewSegmentTree(n int, id interface{}, merge Merger) *SegmentTree {\n\tsz := 1\n\tfor sz < n {\n\t\tsz *= 2\n\t}\n\n\tdata := make([]interface{}, sz * 2 - 1)\n\tfor i := 0; i < sz * 2 - 1; i++ {\n\t\tdata[i] = id\n\t}\n\n\treturn &SegmentTree{data, id, sz, merge}\n}\n\nfunc (seg *SegmentTree) update(k int, x interface{}) {\n\tk += seg.size - 1;\n\tseg.data[k] = x\n\n\tfor k > 0 {\n\t\tk = (k - 1) / 2\n\n\t\tseg.data[k] = seg.merge(seg.data[2 * k + 1], seg.data[2 * k + 2])\n\t}\n}\n\nfunc (seg *SegmentTree) get(a, b int) interface{} {\n\treturn seg._get(a, b, 0, 0, seg.size)\n}\n\nfunc (seg *SegmentTree) _get(a, b, k, l, r int) interface{} {\n\tif b <= l || r <= a {\n\t\treturn seg.id\n\t}\n\n\tif a <= l && r <= b {\n\t\treturn seg.data[k]\n\t}\n\n\tL := seg._get(a, b, 2 * k + 1, l, (l + r) / 2)\n\tR := seg._get(a, b, 2 * k + 2, (l + r) / 2, r)\n\treturn seg.merge(L, R)\n}\n\nfunc (seg *SegmentTree) String() string {\n\treturn fmt.Sprint(seg.data[seg.size - 1:])\n}\n\n// Trie Node\n// Node for Trie Tree\nconst (\n\tchar_size = 26\n\tmargin = 'a'\n)\n\ntype TrieNode struct {\n\tnxt \t[char_size]int\n\taccept\t[]int\n\texist\tint\n}\n\nfunc NewTrieNode() *TrieNode {\n\tvar nxt [char_size]int\n\tfor i := 0; i < char_size; i++ {\n\t\tnxt[i] = -1\n\t}\n\n\treturn &TrieNode{nxt, make([]int, 0), 0}\n}\n\n// Trie Tree\ntype TrieTree struct {\n\tnodes\t[]TrieNode\n\troot\tint\n}\n\nfunc NewTrieTree() *TrieTree {\n\treturn &TrieTree{[]TrieNode{*NewTrieNode()}, 0}\n}\n\nfunc direct_action(node, id int) {\n\t//virtual function\n}\n\nfunc child_action(node, child, id int) {\n\t//virtual function\n}\n\nfunc (tree *TrieTree) update_direct(node, id int) {\n\ttree.nodes[node].accept = append(tree.nodes[node].accept, id)\n\tdirect_action(node, id)\n}\n\nfunc (tree *TrieTree) update_child(node, child, id int) {\n\ttree.nodes[node].exist += 1\n\tchild_action(node, child, id)\n}\n\nfunc (tree *TrieTree) add(str []byte, str_index, node_index, id int) {\n\tif str_index == len(str) {\n\t\ttree.update_direct(node_index, id)\n\t} else {\n\t\tc := int(str[str_index]) - int(margin)\n\n\t\tif tree.nodes[node_index].nxt[c] == -1 {\n\t\t\ttree.nodes[node_index].nxt[c] = len(tree.nodes)\n\t\t\ttree.nodes = append(tree.nodes, *NewTrieNode())\n\t\t}\n\n\t\ttree.add(str, str_index + 1, tree.nodes[node_index].nxt[c], id)\n\t\ttree.update_child(node_index, tree.nodes[node_index].nxt[c], id)\n\t}\n}\n\nfunc (tree *TrieTree) InsertWithId(str []byte, id int) {\n\ttree.add(str, 0, 0, id)\n}\n\nfunc (tree *TrieTree) Insert(str []byte) {\n\ttree.InsertWithId(str, tree.nodes[0].exist)\n}\n\nfunc (tree *TrieTree) size() int {\n\treturn tree.nodes[0].exist\n}\n\nfunc (tree *TrieTree) nodesize() int {\n\treturn len(tree.nodes)\n}", "language": "Go", "metadata": {"date": 1532926297, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03649.html", "problem_id": "p03649", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03649/input.txt", "sample_output_relpath": "derived/input_output/data/p03649/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03649/Go/s424377437.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s424377437", "user_id": "u424655672"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := NewScanner()\n\tN := next.Int()\n\ta := make([]int64, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = next.Int64()\n\t}\n\n\tans := int64(0)\n\tfor true {\n\t\ttmp := int64(0)\n\t\tfor i := 0; i < N; i++ {\n\t\t\ttmp += a[i] / int64(N)\n\t\t}\n\t\t\n\t\tif tmp == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor i := 0; i < N; i++ {\n\t\t\tA := a[i]\n\t\t\ta[i] %= int64(N)\n\t\t\ta[i] += tmp - A / int64(N)\n\t\t}\n\n\t\tans += tmp\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Scanner\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc NewScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\nfunc (s *scanner) Byte() []byte {\n\treturn []byte(s.String())\n}\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Functions\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(e, ret) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(ret, a) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b > 0 {\n\t\treturn gcd(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\nfunc gcdInt64(a, b int64) int64 {\n\tif b > 0 {\n\t\treturn gcdInt64(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcmInt64(a, b int64) int64 {\n\treturn a / gcdInt64(a, b) * b\n}\n\nfunc ModPow(x, n, mod int) int {\n\tret := 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc ModPowInt64(x, n, mod int64) int64 {\n\tvar ret int64 = 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc IntComp(a, b interface{}) bool {\n\tna := a.(int)\n\tnb := b.(int)\n\n\treturn na < nb\n}\n\nfunc Int64Comp(a, b interface{}) bool {\n\tna := a.(int64)\n\tnb := b.(int64)\n\n\treturn na < nb\n}\n\nfunc FloatComp(a, b interface{}) bool {\n\tna := a.(float32)\n\tnb := b.(float32)\n\n\treturn na < nb\n}\n\nfunc Float64Comp(a, b interface{}) bool {\n\tna := a.(float64)\n\tnb := b.(float64)\n\n\treturn na < nb\n}\n\n// Structs\ntype Merger func(a, b interface{}) interface{}\ntype Comparator func(a, b interface{}) bool\n\n// Pair\ntype Pair struct {\n\tfirst, second int64\n}\n\nfunc Newpair() *Pair {\n\treturn &Pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p Pair) Less(q Pair) bool {\n\tif p.first < q.first {\n\t\treturn true\n\t} else if p.first == q.first {\n\t\treturn p.second < q.second\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc (p Pair) String() string {\n\treturn fmt.Sprint(\"(\", p.first, \", \", p.second, \")\")\n}\n\nfunc PairComp(p, q interface{}) bool {\n\tnp := p.(Pair)\n\tnq := q.(Pair)\n\n\treturn np.Less(nq)\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].Less(p[j])\n}\n\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\n// Priority Queue\n// push : Push the value to the priority queue.\n// top : Return the (Min / Max) value in the priority queue.\n// pop : Delete the (Min / Max) value in the priority queue.\n// size : Return the number of values in the priority queue.\n// empty : Return Is priority queue has the values.\ntype PriorityQueue struct {\n\tdata\t[]interface{}\n\tcomp\tComparator\n}\n\nfunc NewPriorityQueue(comp Comparator) *PriorityQueue {\n\treturn &PriorityQueue{make([]interface{}, 0), comp}\n}\n\nfunc (qu *PriorityQueue) push(x interface{}) {\n\tn := len(qu.data)\n\tqu.data = append(qu.data, x)\n\n\tfor n != 0 {\n\t\tpar := (n - 1) / 2\n\t\t\n\t\tif qu.comp(qu.data[par], qu.data[n]) {\n\t\t\tqu.data[par], qu.data[n] = qu.data[n], qu.data[par]\n\t\t}\n\n\t\tn = par\n\t}\n}\n\nfunc (qu *PriorityQueue) pop() {\n\tn := len(qu.data) - 1\n\tqu.data[0] = qu.data[n]\n\tqu.data = qu.data[:n]\n\n\tfor i, j := 0, 1; j < n; {\n\t\tj = 2 * i + 1\n\n\t\tif (j != n - 1) && qu.comp(qu.data[j], qu.data[j + 1]) {\n\t\t\tj++\n\t\t}\n\n\t\tif qu.comp(qu.data[i], qu.data[j]) {\n\t\t\tqu.data[i], qu.data[j] = qu.data[j], qu.data[i]\n\t\t}\n\n\t\ti = j\n\t}\n}\n\nfunc (qu *PriorityQueue) top() interface{} {\n\treturn qu.data[0]\n}\n\nfunc (qu *PriorityQueue) size() int {\n\treturn len(qu.data)\n}\n\nfunc (qu *PriorityQueue) empty() bool {\n\treturn len(qu.data) == 0\n}\n\n// Segment Tree\n// update : Update k-th value of SegmentTree.data to x\n// get\t : Get the merged value in range [a, b)\ntype SegmentTree struct {\n\tdata\t[]interface{}\n\tid\t\tinterface{}\n\tsize\tint\n\tmerge\tMerger\n}\n\nfunc NewSegmentTree(n int, id interface{}, merge Merger) *SegmentTree {\n\tsz := 1\n\tfor sz < n {\n\t\tsz *= 2\n\t}\n\n\tdata := make([]interface{}, sz * 2 - 1)\n\tfor i := 0; i < sz * 2 - 1; i++ {\n\t\tdata[i] = id\n\t}\n\n\treturn &SegmentTree{data, id, sz, merge}\n}\n\nfunc (seg *SegmentTree) update(k int, x interface{}) {\n\tk += seg.size - 1;\n\tseg.data[k] = x\n\n\tfor k > 0 {\n\t\tk = (k - 1) / 2\n\n\t\tseg.data[k] = seg.merge(seg.data[2 * k + 1], seg.data[2 * k + 2])\n\t}\n}\n\nfunc (seg *SegmentTree) get(a, b int) interface{} {\n\treturn seg._get(a, b, 0, 0, seg.size)\n}\n\nfunc (seg *SegmentTree) _get(a, b, k, l, r int) interface{} {\n\tif b <= l || r <= a {\n\t\treturn seg.id\n\t}\n\n\tif a <= l && r <= b {\n\t\treturn seg.data[k]\n\t}\n\n\tL := seg._get(a, b, 2 * k + 1, l, (l + r) / 2)\n\tR := seg._get(a, b, 2 * k + 2, (l + r) / 2, r)\n\treturn seg.merge(L, R)\n}\n\nfunc (seg *SegmentTree) String() string {\n\treturn fmt.Sprint(seg.data[seg.size - 1:])\n}\n\n// Trie Node\n// Node for Trie Tree\nconst (\n\tchar_size = 26\n\tmargin = 'a'\n)\n\ntype TrieNode struct {\n\tnxt \t[char_size]int\n\taccept\t[]int\n\texist\tint\n}\n\nfunc NewTrieNode() *TrieNode {\n\tvar nxt [char_size]int\n\tfor i := 0; i < char_size; i++ {\n\t\tnxt[i] = -1\n\t}\n\n\treturn &TrieNode{nxt, make([]int, 0), 0}\n}\n\n// Trie Tree\ntype TrieTree struct {\n\tnodes\t[]TrieNode\n\troot\tint\n}\n\nfunc NewTrieTree() *TrieTree {\n\treturn &TrieTree{[]TrieNode{*NewTrieNode()}, 0}\n}\n\nfunc direct_action(node, id int) {\n\t//virtual function\n}\n\nfunc child_action(node, child, id int) {\n\t//virtual function\n}\n\nfunc (tree *TrieTree) update_direct(node, id int) {\n\ttree.nodes[node].accept = append(tree.nodes[node].accept, id)\n\tdirect_action(node, id)\n}\n\nfunc (tree *TrieTree) update_child(node, child, id int) {\n\ttree.nodes[node].exist += 1\n\tchild_action(node, child, id)\n}\n\nfunc (tree *TrieTree) add(str []byte, str_index, node_index, id int) {\n\tif str_index == len(str) {\n\t\ttree.update_direct(node_index, id)\n\t} else {\n\t\tc := int(str[str_index]) - int(margin)\n\n\t\tif tree.nodes[node_index].nxt[c] == -1 {\n\t\t\ttree.nodes[node_index].nxt[c] = len(tree.nodes)\n\t\t\ttree.nodes = append(tree.nodes, *NewTrieNode())\n\t\t}\n\n\t\ttree.add(str, str_index + 1, tree.nodes[node_index].nxt[c], id)\n\t\ttree.update_child(node_index, tree.nodes[node_index].nxt[c], id)\n\t}\n}\n\nfunc (tree *TrieTree) InsertWithId(str []byte, id int) {\n\ttree.add(str, 0, 0, id)\n}\n\nfunc (tree *TrieTree) Insert(str []byte) {\n\ttree.InsertWithId(str, tree.nodes[0].exist)\n}\n\nfunc (tree *TrieTree) size() int {\n\treturn tree.nodes[0].exist\n}\n\nfunc (tree *TrieTree) nodesize() int {\n\treturn len(tree.nodes)\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes N-1 or smaller. (The operation is the same as the one in Problem D.)\n\nDetermine the largest element in the sequence (if there is more than one, choose one). Decrease the value of this element by N, and increase each of the other elements by 1.\n\nIt can be proved that the largest element in the sequence becomes N-1 or smaller after a finite number of operations.\n\nYou are given the sequence a_i. Find the number of times we will perform the above operation.\n\nConstraints\n\n2 ≤ N ≤ 50\n\n0 ≤ a_i ≤ 10^{16} + 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of times the operation will be performed.\n\nSample Input 1\n\n4\n3 3 3 3\n\nSample Output 1\n\n0\n\nSample Input 2\n\n3\n1 0 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2\n2 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n7\n27 0 0 0 0 0 0\n\nSample Output 4\n\n3\n\nSample Input 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425\n\nSample Output 5\n\n1234567894848", "sample_input": "4\n3 3 3 3\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03649", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes N-1 or smaller. (The operation is the same as the one in Problem D.)\n\nDetermine the largest element in the sequence (if there is more than one, choose one). Decrease the value of this element by N, and increase each of the other elements by 1.\n\nIt can be proved that the largest element in the sequence becomes N-1 or smaller after a finite number of operations.\n\nYou are given the sequence a_i. Find the number of times we will perform the above operation.\n\nConstraints\n\n2 ≤ N ≤ 50\n\n0 ≤ a_i ≤ 10^{16} + 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of times the operation will be performed.\n\nSample Input 1\n\n4\n3 3 3 3\n\nSample Output 1\n\n0\n\nSample Input 2\n\n3\n1 0 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n2\n2 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n7\n27 0 0 0 0 0 0\n\nSample Output 4\n\n3\n\nSample Input 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425\n\nSample Output 5\n\n1234567894848", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9344, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s794967002", "group_id": "codeNet:p03651", "input_text": "package main\n \nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc GCD(a, b int) int {\n if a < b { a, b = b, a}\n if b == 0 { return a }\n return GCD(b, a % b)\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n A := NextIntVec()\n sort.Ints(A)\n D := A[0]\n if 1 < N {\n D = A[1] - A[0]\n for i := 1; i < N; i++ {\n D = GCD(D, A[i] - A[i - 1])\n }\n }\n ans := \"IMPOSSIBLE\"\n for _, a := range A {\n if a <= K { continue }\n if (a - K) % D == 0 {\n ans = \"POSSIBLE\"\n break\n }\n }\n Write(ans)\n Output()\n}", "language": "Go", "metadata": {"date": 1572128050, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03651.html", "problem_id": "p03651", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03651/input.txt", "sample_output_relpath": "derived/input_output/data/p03651/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03651/Go/s794967002.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s794967002", "user_id": "u415905784"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "package main\n \nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc GCD(a, b int) int {\n if a < b { a, b = b, a}\n if b == 0 { return a }\n return GCD(b, a % b)\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n A := NextIntVec()\n sort.Ints(A)\n D := A[0]\n if 1 < N {\n D = A[1] - A[0]\n for i := 1; i < N; i++ {\n D = GCD(D, A[i] - A[i - 1])\n }\n }\n ans := \"IMPOSSIBLE\"\n for _, a := range A {\n if a <= K { continue }\n if (a - K) % D == 0 {\n ans = \"POSSIBLE\"\n break\n }\n }\n Write(ans)\n Output()\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a box containing N balls. The i-th ball has the integer A_i written on it.\nSnuke can perform the following operation any number of times:\n\nTake out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.\n\nDetermine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nIf it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written, print POSSIBLE; if it is not possible, print IMPOSSIBLE.\n\nSample Input 1\n\n3 7\n9 3 4\n\nSample Output 1\n\nPOSSIBLE\n\nFirst, take out the two balls 9 and 4, and return them back along with a new ball, abs(9-4)=5.\nNext, take out 3 and 5, and return them back along with abs(3-5)=2.\nFinally, take out 9 and 2, and return them back along with abs(9-2)=7.\nNow we have 7 in the box, and the answer is therefore POSSIBLE.\n\nSample Input 2\n\n3 5\n6 9 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo matter what we do, it is not possible to have 5 in the box. The answer is therefore IMPOSSIBLE.\n\nSample Input 3\n\n4 11\n11 3 7 15\n\nSample Output 3\n\nPOSSIBLE\n\nThe box already contains 11 before we do anything. The answer is therefore POSSIBLE.\n\nSample Input 4\n\n5 12\n10 2 8 6 4\n\nSample Output 4\n\nIMPOSSIBLE", "sample_input": "3 7\n9 3 4\n"}, "reference_outputs": ["POSSIBLE\n"], "source_document_id": "p03651", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a box containing N balls. The i-th ball has the integer A_i written on it.\nSnuke can perform the following operation any number of times:\n\nTake out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.\n\nDetermine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nIf it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written, print POSSIBLE; if it is not possible, print IMPOSSIBLE.\n\nSample Input 1\n\n3 7\n9 3 4\n\nSample Output 1\n\nPOSSIBLE\n\nFirst, take out the two balls 9 and 4, and return them back along with a new ball, abs(9-4)=5.\nNext, take out 3 and 5, and return them back along with abs(3-5)=2.\nFinally, take out 9 and 2, and return them back along with abs(9-2)=7.\nNow we have 7 in the box, and the answer is therefore POSSIBLE.\n\nSample Input 2\n\n3 5\n6 9 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo matter what we do, it is not possible to have 5 in the box. The answer is therefore IMPOSSIBLE.\n\nSample Input 3\n\n4 11\n11 3 7 15\n\nSample Output 3\n\nPOSSIBLE\n\nThe box already contains 11 before we do anything. The answer is therefore POSSIBLE.\n\nSample Input 4\n\n5 12\n10 2 8 6 4\n\nSample Output 4\n\nIMPOSSIBLE", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1253, "cpu_time_ms": 48, "memory_kb": 6016}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s513927063", "group_id": "codeNet:p03651", "input_text": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Thu Apr 26 11:01:25 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar N, K int\nvar A []int\n\nfunc gcd(a, b int) int {\n\tif b > a {\n\t\treturn gcd(b, a)\n\t}\n\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tfmt.Scan(&N, &K)\n\n\tA = make([]int, N)\n\tfor i := range A {\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tmax := A[len(A)-1]\n\tif max < K {\n\t\tfmt.Println(\"POSSIBLE\")\n\t\treturn\n\t}\n\tif N == 1 {\n\t\tif A[0] == K {\n\t\t\tfmt.Println(\"POSSIBLE\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t\treturn\n\t}\n\n\tg := gcd(A[0], A[1])\n\tfor i := 2; i < len(A)-1; i++ {\n\t\tg = gcd(g, A[i])\n\t}\n\tif K%g == 0 {\n\t\tfmt.Println(\"POSSIBLE\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1524759172, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03651.html", "problem_id": "p03651", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03651/input.txt", "sample_output_relpath": "derived/input_output/data/p03651/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03651/Go/s513927063.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s513927063", "user_id": "u802614675"}, "prompt_components": {"gold_output": "POSSIBLE\n", "input_to_evaluate": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Thu Apr 26 11:01:25 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar N, K int\nvar A []int\n\nfunc gcd(a, b int) int {\n\tif b > a {\n\t\treturn gcd(b, a)\n\t}\n\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tfmt.Scan(&N, &K)\n\n\tA = make([]int, N)\n\tfor i := range A {\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tmax := A[len(A)-1]\n\tif max < K {\n\t\tfmt.Println(\"POSSIBLE\")\n\t\treturn\n\t}\n\tif N == 1 {\n\t\tif A[0] == K {\n\t\t\tfmt.Println(\"POSSIBLE\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t\treturn\n\t}\n\n\tg := gcd(A[0], A[1])\n\tfor i := 2; i < len(A)-1; i++ {\n\t\tg = gcd(g, A[i])\n\t}\n\tif K%g == 0 {\n\t\tfmt.Println(\"POSSIBLE\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a box containing N balls. The i-th ball has the integer A_i written on it.\nSnuke can perform the following operation any number of times:\n\nTake out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.\n\nDetermine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nIf it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written, print POSSIBLE; if it is not possible, print IMPOSSIBLE.\n\nSample Input 1\n\n3 7\n9 3 4\n\nSample Output 1\n\nPOSSIBLE\n\nFirst, take out the two balls 9 and 4, and return them back along with a new ball, abs(9-4)=5.\nNext, take out 3 and 5, and return them back along with abs(3-5)=2.\nFinally, take out 9 and 2, and return them back along with abs(9-2)=7.\nNow we have 7 in the box, and the answer is therefore POSSIBLE.\n\nSample Input 2\n\n3 5\n6 9 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo matter what we do, it is not possible to have 5 in the box. The answer is therefore IMPOSSIBLE.\n\nSample Input 3\n\n4 11\n11 3 7 15\n\nSample Output 3\n\nPOSSIBLE\n\nThe box already contains 11 before we do anything. The answer is therefore POSSIBLE.\n\nSample Input 4\n\n5 12\n10 2 8 6 4\n\nSample Output 4\n\nIMPOSSIBLE", "sample_input": "3 7\n9 3 4\n"}, "reference_outputs": ["POSSIBLE\n"], "source_document_id": "p03651", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a box containing N balls. The i-th ball has the integer A_i written on it.\nSnuke can perform the following operation any number of times:\n\nTake out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.\n\nDetermine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 ... A_N\n\nOutput\n\nIf it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written, print POSSIBLE; if it is not possible, print IMPOSSIBLE.\n\nSample Input 1\n\n3 7\n9 3 4\n\nSample Output 1\n\nPOSSIBLE\n\nFirst, take out the two balls 9 and 4, and return them back along with a new ball, abs(9-4)=5.\nNext, take out 3 and 5, and return them back along with abs(3-5)=2.\nFinally, take out 9 and 2, and return them back along with abs(9-2)=7.\nNow we have 7 in the box, and the answer is therefore POSSIBLE.\n\nSample Input 2\n\n3 5\n6 9 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo matter what we do, it is not possible to have 5 in the box. The answer is therefore IMPOSSIBLE.\n\nSample Input 3\n\n4 11\n11 3 7 15\n\nSample Output 3\n\nPOSSIBLE\n\nThe box already contains 11 before we do anything. The answer is therefore POSSIBLE.\n\nSample Input 4\n\n5 12\n10 2 8 6 4\n\nSample Output 4\n\nIMPOSSIBLE", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 715, "cpu_time_ms": 715, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s090206237", "group_id": "codeNet:p03652", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, m := scanInt(), scanInt()\n\n\ta := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = make([]int, m)\n\t\tfor j := 0; j < m; j++ {\n\t\t\ta[i][j] = scanInt()-1\n\t\t}\n\t}\n\n\tisAborted := make([]bool, m)\n\tnext := make([]int, n)\n\tans := n\n\n\tfor k := 0; k < m; k++ {\n\t\tcount := make([]int, m)\n\t\tarr := make([][]int, m)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tcount[a[i][next[i]]]++\n\t\t\tarr[a[i][next[i]]] = append(arr[a[i][next[i]]], i)\n\t\t}\n\t\n\t\tma := 0\n\t\tabort := 0\n\t\n\t\tfor i := 0; i < m; i++ {\n\t\t\tif count[i] > ma {\n\t\t\t\tma = count[i]\n\t\t\t\tabort = i\n\t\t\t}\n\t\t}\n\n\t\t// fmt.Println(ans, count, abort, arr)\n\n\t\tif ans > ma {\n\t\t\tans = ma\n\t\t}\n\t\n\t\tisAborted[abort] = true\n\t\n\t\tfor _, e := range arr[abort] {\n\t\t\tfor isAborted[a[e][next[e]]] {\n\t\t\t\tnext[e]++\n\t\t\t\tif next[e] == m {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1577164514, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03652.html", "problem_id": "p03652", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03652/input.txt", "sample_output_relpath": "derived/input_output/data/p03652/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03652/Go/s090206237.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s090206237", "user_id": "u548992197"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, m := scanInt(), scanInt()\n\n\ta := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = make([]int, m)\n\t\tfor j := 0; j < m; j++ {\n\t\t\ta[i][j] = scanInt()-1\n\t\t}\n\t}\n\n\tisAborted := make([]bool, m)\n\tnext := make([]int, n)\n\tans := n\n\n\tfor k := 0; k < m; k++ {\n\t\tcount := make([]int, m)\n\t\tarr := make([][]int, m)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tcount[a[i][next[i]]]++\n\t\t\tarr[a[i][next[i]]] = append(arr[a[i][next[i]]], i)\n\t\t}\n\t\n\t\tma := 0\n\t\tabort := 0\n\t\n\t\tfor i := 0; i < m; i++ {\n\t\t\tif count[i] > ma {\n\t\t\t\tma = count[i]\n\t\t\t\tabort = i\n\t\t\t}\n\t\t}\n\n\t\t// fmt.Println(ans, count, abort, arr)\n\n\t\tif ans > ma {\n\t\t\tans = ma\n\t\t}\n\t\n\t\tisAborted[abort] = true\n\t\n\t\tfor _, e := range arr[abort] {\n\t\t\tfor isAborted[a[e][next[e]]] {\n\t\t\t\tnext[e]++\n\t\t\t\tif next[e] == m {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nTakahashi is hosting an sports meet.\nThere are N people who will participate. These people are conveniently numbered 1 through N.\nAlso, there are M options of sports for this event. These sports are numbered 1 through M.\nAmong these options, Takahashi will select one or more sports (possibly all) to be played in the event.\n\nTakahashi knows that Person i's j-th favorite sport is Sport A_{ij}.\nEach person will only participate in his/her most favorite sport among the ones that are actually played in the event, and will not participate in the other sports.\n\nTakahashi is worried that one of the sports will attract too many people.\nTherefore, he would like to carefully select sports to be played so that the number of the participants in the sport with the largest number of participants is minimized.\nFind the minimum possible number of the participants in the sport with the largest number of participants.\n\nConstraints\n\n1 \\leq N \\leq 300\n\n1 \\leq M \\leq 300\n\nA_{i1} , A_{i2} , ... , A_{iM} is a permutation of the integers from 1 to M.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_{11} A_{12} ... A_{1M}\nA_{21} A_{22} ... A_{2M}\n:\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint the minimum possible number of the participants in the sport with the largest number of participants.\n\nSample Input 1\n\n4 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 4 5\n2 5 4 3 1\n\nSample Output 1\n\n2\n\nAssume that Sports 1, 3 and 4 are selected to be played. In this case, Person 1 will participate in Sport 1, Person 2 in Sport 3, Person 3 in Sport 3 and Person 4 in Sport 4.\nHere, the sport with the largest number of participants is Sport 3, with two participants.\nThere is no way to reduce the number of participants in the sport with the largest number of participants to 1. Therefore, the answer is 2.\n\nSample Input 2\n\n3 3\n2 1 3\n2 1 3\n2 1 3\n\nSample Output 2\n\n3\n\nSince all the people have the same taste in sports, there will be a sport with three participants, no matter what sports are selected.\nTherefore, the answer is 3.", "sample_input": "4 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 4 5\n2 5 4 3 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03652", "source_text": "Score : 700 points\n\nProblem Statement\n\nTakahashi is hosting an sports meet.\nThere are N people who will participate. These people are conveniently numbered 1 through N.\nAlso, there are M options of sports for this event. These sports are numbered 1 through M.\nAmong these options, Takahashi will select one or more sports (possibly all) to be played in the event.\n\nTakahashi knows that Person i's j-th favorite sport is Sport A_{ij}.\nEach person will only participate in his/her most favorite sport among the ones that are actually played in the event, and will not participate in the other sports.\n\nTakahashi is worried that one of the sports will attract too many people.\nTherefore, he would like to carefully select sports to be played so that the number of the participants in the sport with the largest number of participants is minimized.\nFind the minimum possible number of the participants in the sport with the largest number of participants.\n\nConstraints\n\n1 \\leq N \\leq 300\n\n1 \\leq M \\leq 300\n\nA_{i1} , A_{i2} , ... , A_{iM} is a permutation of the integers from 1 to M.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_{11} A_{12} ... A_{1M}\nA_{21} A_{22} ... A_{2M}\n:\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint the minimum possible number of the participants in the sport with the largest number of participants.\n\nSample Input 1\n\n4 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 4 5\n2 5 4 3 1\n\nSample Output 1\n\n2\n\nAssume that Sports 1, 3 and 4 are selected to be played. In this case, Person 1 will participate in Sport 1, Person 2 in Sport 3, Person 3 in Sport 3 and Person 4 in Sport 4.\nHere, the sport with the largest number of participants is Sport 3, with two participants.\nThere is no way to reduce the number of participants in the sport with the largest number of participants to 1. Therefore, the answer is 2.\n\nSample Input 2\n\n3 3\n2 1 3\n2 1 3\n2 1 3\n\nSample Output 2\n\n3\n\nSince all the people have the same taste in sports, there will be a sport with three participants, no matter what sports are selected.\nTherefore, the answer is 3.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1402, "cpu_time_ms": 25, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s018635937", "group_id": "codeNet:p03657", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 {\n\t\tfmt.Println(\"Possible\")\n\t} else {\n\t\tfmt.Println(\"Impossible\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588205440, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03657.html", "problem_id": "p03657", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03657/input.txt", "sample_output_relpath": "derived/input_output/data/p03657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03657/Go/s018635937.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s018635937", "user_id": "u214033538"}, "prompt_components": {"gold_output": "Possible\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 {\n\t\tfmt.Println(\"Possible\")\n\t} else {\n\t\tfmt.Println(\"Impossible\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is giving cookies to his three goats.\n\nHe has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).\n\nYour task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.\n\nConstraints\n\n1 \\leq A,B \\leq 100\n\nBoth A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nPossible\n\nIf Snuke gives nine cookies, each of the three goats can have three cookies.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nImpossible\n\nSince there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.", "sample_input": "4 5\n"}, "reference_outputs": ["Possible\n"], "source_document_id": "p03657", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is giving cookies to his three goats.\n\nHe has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).\n\nYour task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.\n\nConstraints\n\n1 \\leq A,B \\leq 100\n\nBoth A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nPossible\n\nIf Snuke gives nine cookies, each of the three goats can have three cookies.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nImpossible\n\nSince there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 192, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s269084590", "group_id": "codeNet:p03657", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 {\n\t\tfmt.Println(\"Possible\")\n\t\treturn\n\t}\n\tfmt.Println(\"Impossible\")\n}\n", "language": "Go", "metadata": {"date": 1558746783, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03657.html", "problem_id": "p03657", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03657/input.txt", "sample_output_relpath": "derived/input_output/data/p03657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03657/Go/s269084590.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s269084590", "user_id": "u375977529"}, "prompt_components": {"gold_output": "Possible\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 {\n\t\tfmt.Println(\"Possible\")\n\t\treturn\n\t}\n\tfmt.Println(\"Impossible\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is giving cookies to his three goats.\n\nHe has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).\n\nYour task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.\n\nConstraints\n\n1 \\leq A,B \\leq 100\n\nBoth A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nPossible\n\nIf Snuke gives nine cookies, each of the three goats can have three cookies.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nImpossible\n\nSince there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.", "sample_input": "4 5\n"}, "reference_outputs": ["Possible\n"], "source_document_id": "p03657", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is giving cookies to his three goats.\n\nHe has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).\n\nYour task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.\n\nConstraints\n\n1 \\leq A,B \\leq 100\n\nBoth A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nPossible\n\nIf Snuke gives nine cookies, each of the three goats can have three cookies.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nImpossible\n\nSince there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 189, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s204817432", "group_id": "codeNet:p03660", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tlist := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tlist[i] = make([]int, 0)\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta := getNextInt(scanner) - 1\n\t\tb := getNextInt(scanner) - 1\n\t\tlist[a] = append(list[a], b)\n\t\tlist[b] = append(list[b], a)\n\t}\n\n\tcolor := make([]int, n)\n\n\tq := make([][2]int, 1)\n\tdistance1 := make([]int, n)\n\tdistance2 := make([]int, n)\n\tq[0][0] = 0\n\tq[0][1] = 0\n\tcolor[0] = 1\n\tcolor[n-1] = 2\n\n\tfor len(q) > 0 {\n\t\tp := q[0]\n\t\tq = q[1:]\n\t\tl := len(list[p[0]])\n\t\tfor i := 0; i < l; i++ {\n\t\t\tif color[list[p[0]][i]] != 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcolor[list[p[0]][i]] = 1\n\t\t\tdistance1[list[p[0]][i]] = p[1] + 1\n\t\t\tq = append(q, [2]int{\n\t\t\t\tlist[p[0]][i],\n\t\t\t\tp[1] + 1,\n\t\t\t})\n\t\t}\n\t}\n\tq = append(q, [2]int{\n\t\tn - 1,\n\t\t0,\n\t})\n\tfor len(q) > 0 {\n\t\tp := q[0]\n\t\tq = q[1:]\n\t\tl := len(list[p[0]])\n\t\tfor i := 0; i < l; i++ {\n\t\t\tif list[p[0]][i] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif color[list[p[0]][i]] >= 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcolor[list[p[0]][i]] += 2\n\t\t\tdistance2[list[p[0]][i]] = p[1] + 1\n\t\t\tq = append(q, [2]int{\n\t\t\t\tlist[p[0]][i],\n\t\t\t\tp[1] + 1,\n\t\t\t})\n\t\t}\n\t}\n\n\tans := [3]int{0, 0, 0}\n\tfor i := 0; i < n; i++ {\n\t\tif color[i] == 3 {\n\t\t\tif distance1[i] <= distance2[i] {\n\t\t\t\tans[1]++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tans[2]++\n\t\t\tcontinue\n\t\t}\n\t\tans[color[i]]++\n\t}\n\n\tout := \"Snuke\"\n\tif ans[1] > ans[2] {\n\t\tout = \"Fennec\"\n\t}\n\tfmt.Fprintln(writer, out)\n\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1564362414, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03660.html", "problem_id": "p03660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03660/input.txt", "sample_output_relpath": "derived/input_output/data/p03660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03660/Go/s204817432.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s204817432", "user_id": "u150542210"}, "prompt_components": {"gold_output": "Fennec\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tlist := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tlist[i] = make([]int, 0)\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta := getNextInt(scanner) - 1\n\t\tb := getNextInt(scanner) - 1\n\t\tlist[a] = append(list[a], b)\n\t\tlist[b] = append(list[b], a)\n\t}\n\n\tcolor := make([]int, n)\n\n\tq := make([][2]int, 1)\n\tdistance1 := make([]int, n)\n\tdistance2 := make([]int, n)\n\tq[0][0] = 0\n\tq[0][1] = 0\n\tcolor[0] = 1\n\tcolor[n-1] = 2\n\n\tfor len(q) > 0 {\n\t\tp := q[0]\n\t\tq = q[1:]\n\t\tl := len(list[p[0]])\n\t\tfor i := 0; i < l; i++ {\n\t\t\tif color[list[p[0]][i]] != 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcolor[list[p[0]][i]] = 1\n\t\t\tdistance1[list[p[0]][i]] = p[1] + 1\n\t\t\tq = append(q, [2]int{\n\t\t\t\tlist[p[0]][i],\n\t\t\t\tp[1] + 1,\n\t\t\t})\n\t\t}\n\t}\n\tq = append(q, [2]int{\n\t\tn - 1,\n\t\t0,\n\t})\n\tfor len(q) > 0 {\n\t\tp := q[0]\n\t\tq = q[1:]\n\t\tl := len(list[p[0]])\n\t\tfor i := 0; i < l; i++ {\n\t\t\tif list[p[0]][i] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif color[list[p[0]][i]] >= 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcolor[list[p[0]][i]] += 2\n\t\t\tdistance2[list[p[0]][i]] = p[1] + 1\n\t\t\tq = append(q, [2]int{\n\t\t\t\tlist[p[0]][i],\n\t\t\t\tp[1] + 1,\n\t\t\t})\n\t\t}\n\t}\n\n\tans := [3]int{0, 0, 0}\n\tfor i := 0; i < n; i++ {\n\t\tif color[i] == 3 {\n\t\t\tif distance1[i] <= distance2[i] {\n\t\t\t\tans[1]++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tans[2]++\n\t\t\tcontinue\n\t\t}\n\t\tans[color[i]]++\n\t}\n\n\tout := \"Snuke\"\n\tif ans[1] > ans[2] {\n\t\tout = \"Fennec\"\n\t}\n\tfmt.Fprintln(writer, out)\n\n\twriter.Flush()\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFennec and Snuke are playing a board game.\n\nOn the board, there are N cells numbered 1 through N, and N-1 roads, each connecting two cells. Cell a_i is adjacent to Cell b_i through the i-th road. Every cell can be reached from every other cell by repeatedly traveling to an adjacent cell. In terms of graph theory, the graph formed by the cells and the roads is a tree.\n\nInitially, Cell 1 is painted black, and Cell N is painted white. The other cells are not yet colored.\nFennec (who goes first) and Snuke (who goes second) alternately paint an uncolored cell.\nMore specifically, each player performs the following action in her/his turn:\n\nFennec: selects an uncolored cell that is adjacent to a black cell, and paints it black.\n\nSnuke: selects an uncolored cell that is adjacent to a white cell, and paints it white.\n\nA player loses when she/he cannot paint a cell. Determine the winner of the game when Fennec and Snuke play optimally.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf Fennec wins, print Fennec; if Snuke wins, print Snuke.\n\nSample Input 1\n\n7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n\nSample Output 1\n\nFennec\n\nFor example, if Fennec first paints Cell 2 black, she will win regardless of Snuke's moves.\n\nSample Input 2\n\n4\n1 4\n4 2\n2 3\n\nSample Output 2\n\nSnuke", "sample_input": "7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n"}, "reference_outputs": ["Fennec\n"], "source_document_id": "p03660", "source_text": "Score : 400 points\n\nProblem Statement\n\nFennec and Snuke are playing a board game.\n\nOn the board, there are N cells numbered 1 through N, and N-1 roads, each connecting two cells. Cell a_i is adjacent to Cell b_i through the i-th road. Every cell can be reached from every other cell by repeatedly traveling to an adjacent cell. In terms of graph theory, the graph formed by the cells and the roads is a tree.\n\nInitially, Cell 1 is painted black, and Cell N is painted white. The other cells are not yet colored.\nFennec (who goes first) and Snuke (who goes second) alternately paint an uncolored cell.\nMore specifically, each player performs the following action in her/his turn:\n\nFennec: selects an uncolored cell that is adjacent to a black cell, and paints it black.\n\nSnuke: selects an uncolored cell that is adjacent to a white cell, and paints it white.\n\nA player loses when she/he cannot paint a cell. Determine the winner of the game when Fennec and Snuke play optimally.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf Fennec wins, print Fennec; if Snuke wins, print Snuke.\n\nSample Input 1\n\n7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n\nSample Output 1\n\nFennec\n\nFor example, if Fennec first paints Cell 2 black, she will win regardless of Snuke's moves.\n\nSample Input 2\n\n4\n1 4\n4 2\n2 3\n\nSample Output 2\n\nSnuke", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2083, "cpu_time_ms": 95, "memory_kb": 17408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s392726066", "group_id": "codeNet:p03660", "input_text": "// AtCoder My Practice\n// author: Leonardone @ NEETSDKASU\npackage main\n\nimport (\n\t\"bufio\"; \"fmt\"; \"os\"; \"strconv\"; \"strings\"\n)\n\nfunc atoi(s string) int { v, _ := strconv.Atoi(s); return v }\nfunc atou(s string) uint64 { v, _ := strconv.ParseUint(s, 10, 64); return v }\nfunc atof(s string) float64 { v, _ := strconv.ParseFloat(s, 64); return v }\nfunc max(a, b int) int { if a > b { return a }; return b }\nfunc min(a, b int) int { if a < b { return a }; return b }\n\nvar (_ = fmt.Println; _red = bufio.NewScanner(os.Stdin); _tok []string)\nfunc init() { _red.Buffer(make([]byte, 1e7), 1e7) }\nfunc gettok() (t string, e bool) {\n\tif len(_tok) == 0 { if !_red.Scan() { return }; _tok = strings.Split(_red.Text(), \" \") }\n\tt = _tok[0]; _tok = _tok[1:]; e = len(_tok) == 0; return\n}\nfunc read(vs ...interface{}) {\n\tfor _, v := range vs {\n\t\tswitch v := v.(type) {\n\t\tcase *int: t, _ := gettok(); *v = atoi(t)\n\t\tcase *uint64: t, _ := gettok(); *v = atou(t)\n\t\tcase *float64: t, _ := gettok(); *v = atof(t)\n\t\tcase *string: *v, _ = gettok()\n\t\tcase *[]int:\n\t\t\tif len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atoi(t)); if e { break } }\n\t\t\t} else { for j := range *v { t, _ := gettok(); (*v)[j] = atoi(t) } }\n\t\tcase *[]uint64:\n\t\t\tif len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atou(t)); if e { break } }\n\t\t\t} else { for j := range *v { t, _ := gettok(); (*v)[j] = atou(t) } }\n\t\tcase *[]float64:\n\t\t\tif len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atof(t)); if e { break } }\n\t\t\t} else { for j := range *v { t, _ := gettok(); (*v)[j] = atof(t) } }\n\t\tcase *[]string:\n\t\t\tif len(*v) == 0 { *v = append(*v, _tok...); _tok = _tok[:0]\n\t\t\t} else { for j := range *v { (*v)[j], _ = gettok() } }\n\t\t}\n\t}\n}\n\nfunc main() {\n var n int\n read(&n)\n tr := make([][]int, n + 1)\n for i := 1; i < n; i++ {\n var a, b int\n read(&a, &b)\n if tr[a] == nil { tr[a] = []int{} }\n if tr[b] == nil { tr[b] = []int{} }\n tr[a] = append(tr[a], b)\n tr[b] = append(tr[b], a)\n }\n \n // 解説読後\n // https://atcoder.jp/img/arc078/editorial.pdf\n \n fenneclen := make([]int, n + 1)\n fenneclen[1] = 1\n tmp1 := []int{1}\n for len(tmp1) > 0 {\n sz := len(tmp1) - 1\n x := tmp1[sz]\n tmp1 = tmp1[:sz]\n for _, v := range tr[x] {\n if fenneclen[v] > 0 { continue }\n fenneclen[v] = fenneclen[x] + 1\n tmp1 = append(tmp1, v)\n }\n }\n snukelen := make([]int, n + 1)\n snukelen[n] = 1\n tmp1 = []int{n}\n for len(tmp1) > 0 {\n sz := len(tmp1) - 1\n x := tmp1[sz]\n tmp1 = tmp1[:sz]\n for _, v := range tr[x] {\n if snukelen[v] > 0 { continue }\n snukelen[v] = snukelen[x] + 1\n tmp1 = append(tmp1, v)\n }\n }\n fennec := 0\n snuke := 0\n for i:=1;i<=n;i++ {\n if fenneclen[i] <= snukelen[i] {\n fennec++\n } else {\n snuke++\n }\n }\n if fennec > snuke {\n fmt.Println(\"Fennec\")\n } else {\n fmt.Println(\"Snuke\")\n }\n}\n", "language": "Go", "metadata": {"date": 1500174437, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03660.html", "problem_id": "p03660", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03660/input.txt", "sample_output_relpath": "derived/input_output/data/p03660/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03660/Go/s392726066.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s392726066", "user_id": "u714587753"}, "prompt_components": {"gold_output": "Fennec\n", "input_to_evaluate": "// AtCoder My Practice\n// author: Leonardone @ NEETSDKASU\npackage main\n\nimport (\n\t\"bufio\"; \"fmt\"; \"os\"; \"strconv\"; \"strings\"\n)\n\nfunc atoi(s string) int { v, _ := strconv.Atoi(s); return v }\nfunc atou(s string) uint64 { v, _ := strconv.ParseUint(s, 10, 64); return v }\nfunc atof(s string) float64 { v, _ := strconv.ParseFloat(s, 64); return v }\nfunc max(a, b int) int { if a > b { return a }; return b }\nfunc min(a, b int) int { if a < b { return a }; return b }\n\nvar (_ = fmt.Println; _red = bufio.NewScanner(os.Stdin); _tok []string)\nfunc init() { _red.Buffer(make([]byte, 1e7), 1e7) }\nfunc gettok() (t string, e bool) {\n\tif len(_tok) == 0 { if !_red.Scan() { return }; _tok = strings.Split(_red.Text(), \" \") }\n\tt = _tok[0]; _tok = _tok[1:]; e = len(_tok) == 0; return\n}\nfunc read(vs ...interface{}) {\n\tfor _, v := range vs {\n\t\tswitch v := v.(type) {\n\t\tcase *int: t, _ := gettok(); *v = atoi(t)\n\t\tcase *uint64: t, _ := gettok(); *v = atou(t)\n\t\tcase *float64: t, _ := gettok(); *v = atof(t)\n\t\tcase *string: *v, _ = gettok()\n\t\tcase *[]int:\n\t\t\tif len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atoi(t)); if e { break } }\n\t\t\t} else { for j := range *v { t, _ := gettok(); (*v)[j] = atoi(t) } }\n\t\tcase *[]uint64:\n\t\t\tif len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atou(t)); if e { break } }\n\t\t\t} else { for j := range *v { t, _ := gettok(); (*v)[j] = atou(t) } }\n\t\tcase *[]float64:\n\t\t\tif len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atof(t)); if e { break } }\n\t\t\t} else { for j := range *v { t, _ := gettok(); (*v)[j] = atof(t) } }\n\t\tcase *[]string:\n\t\t\tif len(*v) == 0 { *v = append(*v, _tok...); _tok = _tok[:0]\n\t\t\t} else { for j := range *v { (*v)[j], _ = gettok() } }\n\t\t}\n\t}\n}\n\nfunc main() {\n var n int\n read(&n)\n tr := make([][]int, n + 1)\n for i := 1; i < n; i++ {\n var a, b int\n read(&a, &b)\n if tr[a] == nil { tr[a] = []int{} }\n if tr[b] == nil { tr[b] = []int{} }\n tr[a] = append(tr[a], b)\n tr[b] = append(tr[b], a)\n }\n \n // 解説読後\n // https://atcoder.jp/img/arc078/editorial.pdf\n \n fenneclen := make([]int, n + 1)\n fenneclen[1] = 1\n tmp1 := []int{1}\n for len(tmp1) > 0 {\n sz := len(tmp1) - 1\n x := tmp1[sz]\n tmp1 = tmp1[:sz]\n for _, v := range tr[x] {\n if fenneclen[v] > 0 { continue }\n fenneclen[v] = fenneclen[x] + 1\n tmp1 = append(tmp1, v)\n }\n }\n snukelen := make([]int, n + 1)\n snukelen[n] = 1\n tmp1 = []int{n}\n for len(tmp1) > 0 {\n sz := len(tmp1) - 1\n x := tmp1[sz]\n tmp1 = tmp1[:sz]\n for _, v := range tr[x] {\n if snukelen[v] > 0 { continue }\n snukelen[v] = snukelen[x] + 1\n tmp1 = append(tmp1, v)\n }\n }\n fennec := 0\n snuke := 0\n for i:=1;i<=n;i++ {\n if fenneclen[i] <= snukelen[i] {\n fennec++\n } else {\n snuke++\n }\n }\n if fennec > snuke {\n fmt.Println(\"Fennec\")\n } else {\n fmt.Println(\"Snuke\")\n }\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFennec and Snuke are playing a board game.\n\nOn the board, there are N cells numbered 1 through N, and N-1 roads, each connecting two cells. Cell a_i is adjacent to Cell b_i through the i-th road. Every cell can be reached from every other cell by repeatedly traveling to an adjacent cell. In terms of graph theory, the graph formed by the cells and the roads is a tree.\n\nInitially, Cell 1 is painted black, and Cell N is painted white. The other cells are not yet colored.\nFennec (who goes first) and Snuke (who goes second) alternately paint an uncolored cell.\nMore specifically, each player performs the following action in her/his turn:\n\nFennec: selects an uncolored cell that is adjacent to a black cell, and paints it black.\n\nSnuke: selects an uncolored cell that is adjacent to a white cell, and paints it white.\n\nA player loses when she/he cannot paint a cell. Determine the winner of the game when Fennec and Snuke play optimally.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf Fennec wins, print Fennec; if Snuke wins, print Snuke.\n\nSample Input 1\n\n7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n\nSample Output 1\n\nFennec\n\nFor example, if Fennec first paints Cell 2 black, she will win regardless of Snuke's moves.\n\nSample Input 2\n\n4\n1 4\n4 2\n2 3\n\nSample Output 2\n\nSnuke", "sample_input": "7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n"}, "reference_outputs": ["Fennec\n"], "source_document_id": "p03660", "source_text": "Score : 400 points\n\nProblem Statement\n\nFennec and Snuke are playing a board game.\n\nOn the board, there are N cells numbered 1 through N, and N-1 roads, each connecting two cells. Cell a_i is adjacent to Cell b_i through the i-th road. Every cell can be reached from every other cell by repeatedly traveling to an adjacent cell. In terms of graph theory, the graph formed by the cells and the roads is a tree.\n\nInitially, Cell 1 is painted black, and Cell N is painted white. The other cells are not yet colored.\nFennec (who goes first) and Snuke (who goes second) alternately paint an uncolored cell.\nMore specifically, each player performs the following action in her/his turn:\n\nFennec: selects an uncolored cell that is adjacent to a black cell, and paints it black.\n\nSnuke: selects an uncolored cell that is adjacent to a white cell, and paints it white.\n\nA player loses when she/he cannot paint a cell. Determine the winner of the game when Fennec and Snuke play optimally.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf Fennec wins, print Fennec; if Snuke wins, print Snuke.\n\nSample Input 1\n\n7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n\nSample Output 1\n\nFennec\n\nFor example, if Fennec first paints Cell 2 black, she will win regardless of Snuke's moves.\n\nSample Input 2\n\n4\n1 4\n4 2\n2 3\n\nSample Output 2\n\nSnuke", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3061, "cpu_time_ms": 84, "memory_kb": 13440}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s593444261", "group_id": "codeNet:p03665", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanInit()\n\tcombinitMODD()\n\n\tn := nextInt()\n\tp := nextInt() // 0=even, 1=odd\n\ta := make([]int, n)\n\n\toddnum := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\tif a[i]%2 == 1 {\n\t\t\toddnum++\n\t\t}\n\t}\n\tevennum := n - oddnum\n\tcnt := 0\n\n\teway := 1 << evennum\n\tosum := 0\n\tfor i := 0; i <= oddnum; i += 2 {\n\t\tcoi := combinationMODD(oddnum, i)\n\t\tosum += coi\n\t}\n\tcnt = eway * osum\n\n\tif p == 1 {\n\t\tcnt = 1< 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret *= a\n\t\t}\n\t\ta *= a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n\n// ---- readfunc\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1598735569, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03665.html", "problem_id": "p03665", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03665/input.txt", "sample_output_relpath": "derived/input_output/data/p03665/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03665/Go/s593444261.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s593444261", "user_id": "u756000295"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanInit()\n\tcombinitMODD()\n\n\tn := nextInt()\n\tp := nextInt() // 0=even, 1=odd\n\ta := make([]int, n)\n\n\toddnum := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\tif a[i]%2 == 1 {\n\t\t\toddnum++\n\t\t}\n\t}\n\tevennum := n - oddnum\n\tcnt := 0\n\n\teway := 1 << evennum\n\tosum := 0\n\tfor i := 0; i <= oddnum; i += 2 {\n\t\tcoi := combinationMODD(oddnum, i)\n\t\tosum += coi\n\t}\n\tcnt = eway * osum\n\n\tif p == 1 {\n\t\tcnt = 1< 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret *= a\n\t\t}\n\t\ta *= a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n\n// ---- readfunc\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N bags of biscuits. The i-th bag contains A_i biscuits.\n\nTakaki will select some of these bags and eat all of the biscuits inside.\nHere, it is also possible to select all or none of the bags.\n\nHe would like to select bags so that the total number of biscuits inside is congruent to P modulo 2.\nHow many such ways to select bags there are?\n\nConstraints\n\n1 \\leq N \\leq 50\n\nP = 0 or 1\n\n1 \\leq A_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of ways to select bags so that the total number of biscuits inside is congruent to P modulo 2.\n\nSample Input 1\n\n2 0\n1 3\n\nSample Output 1\n\n2\n\nThere are two ways to select bags so that the total number of biscuits inside is congruent to 0 modulo 2:\n\nSelect neither bag. The total number of biscuits is 0.\n\nSelect both bags. The total number of biscuits is 4.\n\nSample Input 2\n\n1 1\n50\n\nSample Output 2\n\n0\n\nSample Input 3\n\n3 0\n1 1 1\n\nSample Output 3\n\n4\n\nTwo bags are distinguished even if they contain the same number of biscuits.\n\nSample Input 4\n\n45 1\n17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 66 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 25 26\n\nSample Output 4\n\n17592186044416", "sample_input": "2 0\n1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03665", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N bags of biscuits. The i-th bag contains A_i biscuits.\n\nTakaki will select some of these bags and eat all of the biscuits inside.\nHere, it is also possible to select all or none of the bags.\n\nHe would like to select bags so that the total number of biscuits inside is congruent to P modulo 2.\nHow many such ways to select bags there are?\n\nConstraints\n\n1 \\leq N \\leq 50\n\nP = 0 or 1\n\n1 \\leq A_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of ways to select bags so that the total number of biscuits inside is congruent to P modulo 2.\n\nSample Input 1\n\n2 0\n1 3\n\nSample Output 1\n\n2\n\nThere are two ways to select bags so that the total number of biscuits inside is congruent to 0 modulo 2:\n\nSelect neither bag. The total number of biscuits is 0.\n\nSelect both bags. The total number of biscuits is 4.\n\nSample Input 2\n\n1 1\n50\n\nSample Output 2\n\n0\n\nSample Input 3\n\n3 0\n1 1 1\n\nSample Output 3\n\n4\n\nTwo bags are distinguished even if they contain the same number of biscuits.\n\nSample Input 4\n\n45 1\n17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 66 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 25 26\n\nSample Output 4\n\n17592186044416", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1629, "cpu_time_ms": 40, "memory_kb": 13756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s248649350", "group_id": "codeNet:p03671", "input_text": "package main\n\nimport(\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tprices := strings.Split(sc.Text(), \" \")\n \tfor i := 0;i < len(prices) - 1;i++ {\n\t\tfor j := len(prices) - 1; j > 0; j-- {\n\t\t\tfastPrice,_ := strconv.Atoi(prices[i])\n\t\t\tlastPrice,_ := strconv.Atoi(prices[j])\n\t\t\tif fastPrice > lastPrice{\n\t\t\t\tt := prices[i]\n\t\t\t\tprices[i] = prices[j]\n\t\t\t\tprices[j] = t\n\t\t\t}\n\t\t}\n\t}\n\tfastPrice,_ := strconv.Atoi(prices[0])\n\tlastPrice,_ := strconv.Atoi(prices[1])\n\tprintln(fastPrice + lastPrice)\n}", "language": "Go", "metadata": {"date": 1546113195, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03671.html", "problem_id": "p03671", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03671/input.txt", "sample_output_relpath": "derived/input_output/data/p03671/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03671/Go/s248649350.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s248649350", "user_id": "u407791143"}, "prompt_components": {"gold_output": "1300\n", "input_to_evaluate": "package main\n\nimport(\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tprices := strings.Split(sc.Text(), \" \")\n \tfor i := 0;i < len(prices) - 1;i++ {\n\t\tfor j := len(prices) - 1; j > 0; j-- {\n\t\t\tfastPrice,_ := strconv.Atoi(prices[i])\n\t\t\tlastPrice,_ := strconv.Atoi(prices[j])\n\t\t\tif fastPrice > lastPrice{\n\t\t\t\tt := prices[i]\n\t\t\t\tprices[i] = prices[j]\n\t\t\t\tprices[j] = t\n\t\t\t}\n\t\t}\n\t}\n\tfastPrice,_ := strconv.Atoi(prices[0])\n\tlastPrice,_ := strconv.Atoi(prices[1])\n\tprintln(fastPrice + lastPrice)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the minimum total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "sample_input": "700 600 780\n"}, "reference_outputs": ["1300\n"], "source_document_id": "p03671", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the minimum total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 543, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s724783722", "group_id": "codeNet:p03671", "input_text": "package main\n\nimport(\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tprices := strings.Split(sc.Text(), \" \")\n \tfor i := 0;i < len(prices);i++ {\n\t\tfor j := len(prices) - 1; j > 0; j-- {\n\t\t\tfastPrice,_ := strconv.Atoi(prices[i])\n\t\t\tlastPrice,_ := strconv.Atoi(prices[j])\n\t\t\tif fastPrice < lastPrice{\n\t\t\t\tt := prices[i]\n\t\t\t\tprices[i] = prices[j]\n\t\t\t\tprices[j] = t\n\t\t\t}\n\t\t}\n\t}\n\tfastPrice,_ := strconv.Atoi(prices[0])\n\tlastPrice,_ := strconv.Atoi(prices[1])\n\tprintln(fastPrice + lastPrice)\n}", "language": "Go", "metadata": {"date": 1546112625, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03671.html", "problem_id": "p03671", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03671/input.txt", "sample_output_relpath": "derived/input_output/data/p03671/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03671/Go/s724783722.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s724783722", "user_id": "u407791143"}, "prompt_components": {"gold_output": "1300\n", "input_to_evaluate": "package main\n\nimport(\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tprices := strings.Split(sc.Text(), \" \")\n \tfor i := 0;i < len(prices);i++ {\n\t\tfor j := len(prices) - 1; j > 0; j-- {\n\t\t\tfastPrice,_ := strconv.Atoi(prices[i])\n\t\t\tlastPrice,_ := strconv.Atoi(prices[j])\n\t\t\tif fastPrice < lastPrice{\n\t\t\t\tt := prices[i]\n\t\t\t\tprices[i] = prices[j]\n\t\t\t\tprices[j] = t\n\t\t\t}\n\t\t}\n\t}\n\tfastPrice,_ := strconv.Atoi(prices[0])\n\tlastPrice,_ := strconv.Atoi(prices[1])\n\tprintln(fastPrice + lastPrice)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the minimum total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "sample_input": "700 600 780\n"}, "reference_outputs": ["1300\n"], "source_document_id": "p03671", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\n\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\n\nThe store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.\nFind the minimum total price of two different bells.\n\nConstraints\n\n1 \\leq a,b,c \\leq 10000\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the minimum total price of two different bells.\n\nSample Input 1\n\n700 600 780\n\nSample Output 1\n\n1300\n\nBuying a 700-yen bell and a 600-yen bell costs 1300 yen.\n\nBuying a 700-yen bell and a 780-yen bell costs 1480 yen.\n\nBuying a 600-yen bell and a 780-yen bell costs 1380 yen.\n\nThe minimum among these is 1300 yen.\n\nSample Input 2\n\n10000 10000 10000\n\nSample Output 2\n\n20000\n\nBuying any two bells costs 20000 yen.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 539, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s540041099", "group_id": "codeNet:p03672", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b, c := getInt(), getInt(), getInt()\n\n\tout(min(a+b, min(a+c, b+c)))\n}\n", "language": "Go", "metadata": {"date": 1589504477, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03672.html", "problem_id": "p03672", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03672/input.txt", "sample_output_relpath": "derived/input_output/data/p03672/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03672/Go/s540041099.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s540041099", "user_id": "u814575783"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b, c := getInt(), getInt(), getInt()\n\n\tout(min(a+b, min(a+c, b+c)))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "sample_input": "abaababaab\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03672", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe will call a string that can be obtained by concatenating two equal strings an even string.\nFor example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.\n\nYou are given an even string S consisting of lowercase English letters.\nFind the length of the longest even string that can be obtained by deleting one or more characters from the end of S.\nIt is guaranteed that such a non-empty string exists for a given input.\n\nConstraints\n\n2 \\leq |S| \\leq 200\n\nS is an even string consisting of lowercase English letters.\n\nThere exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest even string that can be obtained.\n\nSample Input 1\n\nabaababaab\n\nSample Output 1\n\n6\n\nabaababaab itself is even, but we need to delete at least one character.\n\nabaababaa is not even.\n\nabaababa is not even.\n\nabaabab is not even.\n\nabaaba is even. Thus, we should print its length, 6.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\n2\n\nxxx is not even.\n\nxx is even.\n\nSample Input 3\n\nabcabcabcabc\n\nSample Output 3\n\n6\n\nThe longest even string that can be obtained is abcabc, whose length is 6.\n\nSample Input 4\n\nakasakaakasakasakaakas\n\nSample Output 4\n\n14\n\nThe longest even string that can be obtained is akasakaakasaka, whose length is 14.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 491, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s910593950", "group_id": "codeNet:p03673", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, a int\n\tfmt.Scan(&n)\n\tvar b []int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tb = append(b, a)\n\t\tb = reverse(b)\n\t}\n\tfmt.Println(b)\n}\nfunc reverse(t []int) []int {\n\tw := make([]int, len(t))\n\tfor i := 0; i < len(t); i++ {\n\t\tw[i] = t[len(t)-1-i]\n\t}\n\treturn w\n}", "language": "Go", "metadata": {"date": 1563719701, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03673.html", "problem_id": "p03673", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03673/input.txt", "sample_output_relpath": "derived/input_output/data/p03673/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03673/Go/s910593950.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s910593950", "user_id": "u298152049"}, "prompt_components": {"gold_output": "4 2 1 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, a int\n\tfmt.Scan(&n)\n\tvar b []int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tb = append(b, a)\n\t\tb = reverse(b)\n\t}\n\tfmt.Println(b)\n}\nfunc reverse(t []int) []int {\n\tw := make([]int, len(t))\n\tfor i := 0; i < len(t); i++ {\n\t\tw[i] = t[len(t)-1-i]\n\t}\n\treturn w\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length n, a_1, ..., a_n.\nLet us consider performing the following n operations on an empty sequence b.\n\nThe i-th operation is as follows:\n\nAppend a_i to the end of b.\n\nReverse the order of the elements in b.\n\nFind the sequence b obtained after these n operations.\n\nConstraints\n\n1 \\leq n \\leq 2\\times 10^5\n\n0 \\leq a_i \\leq 10^9\n\nn and a_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint n integers in a line with spaces in between.\nThe i-th integer should be b_i.\n\nSample Input 1\n\n4\n1 2 3 4\n\nSample Output 1\n\n4 2 1 3\n\nAfter step 1 of the first operation, b becomes: 1.\n\nAfter step 2 of the first operation, b becomes: 1.\n\nAfter step 1 of the second operation, b becomes: 1, 2.\n\nAfter step 2 of the second operation, b becomes: 2, 1.\n\nAfter step 1 of the third operation, b becomes: 2, 1, 3.\n\nAfter step 2 of the third operation, b becomes: 3, 1, 2.\n\nAfter step 1 of the fourth operation, b becomes: 3, 1, 2, 4.\n\nAfter step 2 of the fourth operation, b becomes: 4, 2, 1, 3.\n\nThus, the answer is 4 2 1 3.\n\nSample Input 2\n\n3\n1 2 3\n\nSample Output 2\n\n3 1 2\n\nAs shown above in Sample Output 1, b becomes 3, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2.\n\nSample Input 3\n\n1\n1000000000\n\nSample Output 3\n\n1000000000\n\nSample Input 4\n\n6\n0 6 7 6 7 0\n\nSample Output 4\n\n0 6 6 0 7 7", "sample_input": "4\n1 2 3 4\n"}, "reference_outputs": ["4 2 1 3\n"], "source_document_id": "p03673", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length n, a_1, ..., a_n.\nLet us consider performing the following n operations on an empty sequence b.\n\nThe i-th operation is as follows:\n\nAppend a_i to the end of b.\n\nReverse the order of the elements in b.\n\nFind the sequence b obtained after these n operations.\n\nConstraints\n\n1 \\leq n \\leq 2\\times 10^5\n\n0 \\leq a_i \\leq 10^9\n\nn and a_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint n integers in a line with spaces in between.\nThe i-th integer should be b_i.\n\nSample Input 1\n\n4\n1 2 3 4\n\nSample Output 1\n\n4 2 1 3\n\nAfter step 1 of the first operation, b becomes: 1.\n\nAfter step 2 of the first operation, b becomes: 1.\n\nAfter step 1 of the second operation, b becomes: 1, 2.\n\nAfter step 2 of the second operation, b becomes: 2, 1.\n\nAfter step 1 of the third operation, b becomes: 2, 1, 3.\n\nAfter step 2 of the third operation, b becomes: 3, 1, 2.\n\nAfter step 1 of the fourth operation, b becomes: 3, 1, 2, 4.\n\nAfter step 2 of the fourth operation, b becomes: 4, 2, 1, 3.\n\nThus, the answer is 4 2 1 3.\n\nSample Input 2\n\n3\n1 2 3\n\nSample Output 2\n\n3 1 2\n\nAs shown above in Sample Output 1, b becomes 3, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2.\n\nSample Input 3\n\n1\n1000000000\n\nSample Output 3\n\n1000000000\n\nSample Input 4\n\n6\n0 6 7 6 7 0\n\nSample Output 4\n\n0 6 6 0 7 7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 310, "cpu_time_ms": 2114, "memory_kb": 12160}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s151196193", "group_id": "codeNet:p03673", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc rev(a []int) []int {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn a\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\ta := make([][]int, 2)\n\ta[0] = make([]int, 0, n)\n\ta[1] = make([]int, 0, n)\n\tfor i, j := 0, 0; i < n; i, j = i+1, 1-j {\n\t\ta[j] = append(a[j], readInt())\n\t}\n\tans := append(rev(a[1]), a[0]...)\n\tif n%2 != 0 {\n\t\trev(ans)\n\t}\n\tsp := \"\"\n\tfor _, v := range ans {\n\t\tprintf(\"%s%d\", sp, v)\n\t\tsp = \" \"\n\t}\n\tprintln()\n}\n", "language": "Go", "metadata": {"date": 1534375552, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03673.html", "problem_id": "p03673", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03673/input.txt", "sample_output_relpath": "derived/input_output/data/p03673/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03673/Go/s151196193.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s151196193", "user_id": "u705974985"}, "prompt_components": {"gold_output": "4 2 1 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc rev(a []int) []int {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn a\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\ta := make([][]int, 2)\n\ta[0] = make([]int, 0, n)\n\ta[1] = make([]int, 0, n)\n\tfor i, j := 0, 0; i < n; i, j = i+1, 1-j {\n\t\ta[j] = append(a[j], readInt())\n\t}\n\tans := append(rev(a[1]), a[0]...)\n\tif n%2 != 0 {\n\t\trev(ans)\n\t}\n\tsp := \"\"\n\tfor _, v := range ans {\n\t\tprintf(\"%s%d\", sp, v)\n\t\tsp = \" \"\n\t}\n\tprintln()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length n, a_1, ..., a_n.\nLet us consider performing the following n operations on an empty sequence b.\n\nThe i-th operation is as follows:\n\nAppend a_i to the end of b.\n\nReverse the order of the elements in b.\n\nFind the sequence b obtained after these n operations.\n\nConstraints\n\n1 \\leq n \\leq 2\\times 10^5\n\n0 \\leq a_i \\leq 10^9\n\nn and a_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint n integers in a line with spaces in between.\nThe i-th integer should be b_i.\n\nSample Input 1\n\n4\n1 2 3 4\n\nSample Output 1\n\n4 2 1 3\n\nAfter step 1 of the first operation, b becomes: 1.\n\nAfter step 2 of the first operation, b becomes: 1.\n\nAfter step 1 of the second operation, b becomes: 1, 2.\n\nAfter step 2 of the second operation, b becomes: 2, 1.\n\nAfter step 1 of the third operation, b becomes: 2, 1, 3.\n\nAfter step 2 of the third operation, b becomes: 3, 1, 2.\n\nAfter step 1 of the fourth operation, b becomes: 3, 1, 2, 4.\n\nAfter step 2 of the fourth operation, b becomes: 4, 2, 1, 3.\n\nThus, the answer is 4 2 1 3.\n\nSample Input 2\n\n3\n1 2 3\n\nSample Output 2\n\n3 1 2\n\nAs shown above in Sample Output 1, b becomes 3, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2.\n\nSample Input 3\n\n1\n1000000000\n\nSample Output 3\n\n1000000000\n\nSample Input 4\n\n6\n0 6 7 6 7 0\n\nSample Output 4\n\n0 6 6 0 7 7", "sample_input": "4\n1 2 3 4\n"}, "reference_outputs": ["4 2 1 3\n"], "source_document_id": "p03673", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length n, a_1, ..., a_n.\nLet us consider performing the following n operations on an empty sequence b.\n\nThe i-th operation is as follows:\n\nAppend a_i to the end of b.\n\nReverse the order of the elements in b.\n\nFind the sequence b obtained after these n operations.\n\nConstraints\n\n1 \\leq n \\leq 2\\times 10^5\n\n0 \\leq a_i \\leq 10^9\n\nn and a_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint n integers in a line with spaces in between.\nThe i-th integer should be b_i.\n\nSample Input 1\n\n4\n1 2 3 4\n\nSample Output 1\n\n4 2 1 3\n\nAfter step 1 of the first operation, b becomes: 1.\n\nAfter step 2 of the first operation, b becomes: 1.\n\nAfter step 1 of the second operation, b becomes: 1, 2.\n\nAfter step 2 of the second operation, b becomes: 2, 1.\n\nAfter step 1 of the third operation, b becomes: 2, 1, 3.\n\nAfter step 2 of the third operation, b becomes: 3, 1, 2.\n\nAfter step 1 of the fourth operation, b becomes: 3, 1, 2, 4.\n\nAfter step 2 of the fourth operation, b becomes: 4, 2, 1, 3.\n\nThus, the answer is 4 2 1 3.\n\nSample Input 2\n\n3\n1 2 3\n\nSample Output 2\n\n3 1 2\n\nAs shown above in Sample Output 1, b becomes 3, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2.\n\nSample Input 3\n\n1\n1000000000\n\nSample Output 3\n\n1000000000\n\nSample Input 4\n\n6\n0 6 7 6 7 0\n\nSample Output 4\n\n0 6 6 0 7 7", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2300, "cpu_time_ms": 131, "memory_kb": 8192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s316702074", "group_id": "codeNet:p03679", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, a, b int\n\tfmt.Scan(&x, &a, &b)\n\tif b-a <= 0 {\n\t\tfmt.Println(\"delicious\")\n\t} else if b-a <= x {\n\t\tfmt.Println(\"safe\")\n\t} else {\n\t\tfmt.Println(\"dangerous\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1505580095, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03679.html", "problem_id": "p03679", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03679/input.txt", "sample_output_relpath": "derived/input_output/data/p03679/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03679/Go/s316702074.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s316702074", "user_id": "u760868074"}, "prompt_components": {"gold_output": "safe\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, a, b int\n\tfmt.Scan(&x, &a, &b)\n\tif b-a <= 0 {\n\t\tfmt.Println(\"delicious\")\n\t} else if b-a <= x {\n\t\tfmt.Println(\"safe\")\n\t} else {\n\t\tfmt.Println(\"dangerous\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi has a strong stomach. He never gets a stomachache from eating something whose \"best-by\" date is at most X days earlier.\nHe gets a stomachache if the \"best-by\" date of the food is X+1 or more days earlier, though.\n\nOther than that, he finds the food delicious if he eats it not later than the \"best-by\" date. Otherwise, he does not find it delicious.\n\nTakahashi bought some food A days before the \"best-by\" date, and ate it B days after he bought it.\n\nWrite a program that outputs delicious if he found it delicious, safe if he did not found it delicious but did not get a stomachache either, and dangerous if he got a stomachache.\n\nConstraints\n\n1 ≤ X,A,B ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A B\n\nOutput\n\nPrint delicious if Takahashi found the food delicious; print safe if he neither found it delicious nor got a stomachache; print dangerous if he got a stomachache.\n\nSample Input 1\n\n4 3 6\n\nSample Output 1\n\nsafe\n\nHe ate the food three days after the \"best-by\" date. It was not delicious or harmful for him.\n\nSample Input 2\n\n6 5 1\n\nSample Output 2\n\ndelicious\n\nHe ate the food by the \"best-by\" date. It was delicious for him.\n\nSample Input 3\n\n3 7 12\n\nSample Output 3\n\ndangerous\n\nHe ate the food five days after the \"best-by\" date. It was harmful for him.", "sample_input": "4 3 6\n"}, "reference_outputs": ["safe\n"], "source_document_id": "p03679", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi has a strong stomach. He never gets a stomachache from eating something whose \"best-by\" date is at most X days earlier.\nHe gets a stomachache if the \"best-by\" date of the food is X+1 or more days earlier, though.\n\nOther than that, he finds the food delicious if he eats it not later than the \"best-by\" date. Otherwise, he does not find it delicious.\n\nTakahashi bought some food A days before the \"best-by\" date, and ate it B days after he bought it.\n\nWrite a program that outputs delicious if he found it delicious, safe if he did not found it delicious but did not get a stomachache either, and dangerous if he got a stomachache.\n\nConstraints\n\n1 ≤ X,A,B ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A B\n\nOutput\n\nPrint delicious if Takahashi found the food delicious; print safe if he neither found it delicious nor got a stomachache; print dangerous if he got a stomachache.\n\nSample Input 1\n\n4 3 6\n\nSample Output 1\n\nsafe\n\nHe ate the food three days after the \"best-by\" date. It was not delicious or harmful for him.\n\nSample Input 2\n\n6 5 1\n\nSample Output 2\n\ndelicious\n\nHe ate the food by the \"best-by\" date. It was delicious for him.\n\nSample Input 3\n\n3 7 12\n\nSample Output 3\n\ndangerous\n\nHe ate the food five days after the \"best-by\" date. It was harmful for him.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 214, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s552964722", "group_id": "codeNet:p03680", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc NextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc main() {\n\tn := NextInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = NextInt() - 1\n\t}\n\n\tvar now, cnt int\n\tfor {\n\t\tif now == 1 {\n\t\t\tfmt.Println(cnt)\n\t\t\tbreak\n\t\t}\n\n\t\tif cnt >= n {\n\t\t\tfmt.Println(-1)\n\t\t\tbreak\n\t\t}\n\n\t\tcnt++\n\t\tnow = a[now]\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586196104, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03680.html", "problem_id": "p03680", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03680/input.txt", "sample_output_relpath": "derived/input_output/data/p03680/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03680/Go/s552964722.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s552964722", "user_id": "u367908963"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc NextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc main() {\n\tn := NextInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = NextInt() - 1\n\t}\n\n\tvar now, cnt int\n\tfor {\n\t\tif now == 1 {\n\t\t\tfmt.Println(cnt)\n\t\t\tbreak\n\t\t}\n\n\t\tif cnt >= n {\n\t\t\tfmt.Println(-1)\n\t\t\tbreak\n\t\t}\n\n\t\tcnt++\n\t\tnow = a[now]\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "sample_input": "3\n3\n1\n2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03680", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 424, "cpu_time_ms": 16, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s769942247", "group_id": "codeNet:p03680", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := getInt()\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tas[i] = getInt()\n\t}\n\n\tflags := make([]bool, n)\n\tans := 0\n\ti := 0\n\tfor {\n\t\tif flags[i] == true {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t} else if i == 1 {\n\t\t\tbreak\n\t\t}\n\t\tflags[i] = true\n\t\ti = as[i] - 1\n\t\tans++\n\t}\n\n\tfmt.Println(ans)\n}\n\n// -----------------------------------------\n\nvar scanner = wordScanner()\n\nfunc wordScanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc getInt() int {\n\tscanner.Scan()\n\ti, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1561569379, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03680.html", "problem_id": "p03680", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03680/input.txt", "sample_output_relpath": "derived/input_output/data/p03680/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03680/Go/s769942247.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s769942247", "user_id": "u543933043"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := getInt()\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tas[i] = getInt()\n\t}\n\n\tflags := make([]bool, n)\n\tans := 0\n\ti := 0\n\tfor {\n\t\tif flags[i] == true {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t} else if i == 1 {\n\t\t\tbreak\n\t\t}\n\t\tflags[i] = true\n\t\ti = as[i] - 1\n\t\tans++\n\t}\n\n\tfmt.Println(ans)\n}\n\n// -----------------------------------------\n\nvar scanner = wordScanner()\n\nfunc wordScanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc getInt() int {\n\tscanner.Scan()\n\ti, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "sample_input": "3\n3\n1\n2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03680", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 734, "cpu_time_ms": 21, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s027571891", "group_id": "codeNet:p03680", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = readInt()\n\t}\n\tvar ans int\n\tcount := make([]int, 100001)\n\tfor i := 1; i != 2; {\n\t\tcount[i]++\n\t\tif count[i] > 1 {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t\ti = a[i]\n\t\tans++\n\t}\n\tprintln(ans)\n}\n", "language": "Go", "metadata": {"date": 1531879806, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03680.html", "problem_id": "p03680", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03680/input.txt", "sample_output_relpath": "derived/input_output/data/p03680/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03680/Go/s027571891.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s027571891", "user_id": "u705974985"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = readInt()\n\t}\n\tvar ans int\n\tcount := make([]int, 100001)\n\tfor i := 1; i != 2; {\n\t\tcount[i]++\n\t\tif count[i] > 1 {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t\ti = a[i]\n\t\tans++\n\t}\n\tprintln(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "sample_input": "3\n3\n1\n2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03680", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\n\nThe exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up.\nThese buttons are numbered 1 through N.\nWhen Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i.\nWhen Button i is not lighten up, nothing will happen by pressing it.\n\nInitially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.\n\nDetermine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nPrint -1 if it is impossible to lighten up Button 2.\nOtherwise, print the minimum number of times we need to press buttons in order to lighten up Button 2.\n\nSample Input 1\n\n3\n3\n1\n2\n\nSample Output 1\n\n2\n\nPress Button 1, then Button 3.\n\nSample Input 2\n\n4\n3\n4\n1\n2\n\nSample Output 2\n\n-1\n\nPressing Button 1 lightens up Button 3, and vice versa, so Button 2 will never be lighten up.\n\nSample Input 3\n\n5\n3\n3\n4\n2\n4\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2115, "cpu_time_ms": 22, "memory_kb": 2816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s052545368", "group_id": "codeNet:p03681", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc permutation(n int, k int) int {\n\tv := 1\n\tif 0 < k && k <= n {\n\t\tfor i := 0; i < k; i++ {\n\t\t\tv *= (n - i)\n\t\t\tv = v % int(math.Pow10(9)+7)\n\t\t}\n\t} else if k > n {\n\t\tv = 0\n\t}\n\treturn v\n}\n\nfunc factorial(n int) int {\n\treturn permutation(n, n-1)\n}\n\nfunc main() {\n\t// Code for C - Reconciled?\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\n\tvar count int\n\tvar flag int = 0\n\tif N == M {\n\t\tcount = count + 2\n\t} else if int(math.Abs(float64(N-M))) == 1 {\n\t\tcount++\n\t} else {\n\t\tflag = 1\n\t}\n\n\tif flag == 0 {\n\t\tcount *= factorial(N) % int(math.Pow10(9)+7)\n\t\tcount *= factorial(M) % int(math.Pow10(9)+7)\n\t\tcount = count % int(math.Pow10(9)+7)\n\t\tfmt.Println(count)\n\t} else {\n\t\tfmt.Println(\"0\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598600201, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03681.html", "problem_id": "p03681", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03681/input.txt", "sample_output_relpath": "derived/input_output/data/p03681/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03681/Go/s052545368.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s052545368", "user_id": "u128015095"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc permutation(n int, k int) int {\n\tv := 1\n\tif 0 < k && k <= n {\n\t\tfor i := 0; i < k; i++ {\n\t\t\tv *= (n - i)\n\t\t\tv = v % int(math.Pow10(9)+7)\n\t\t}\n\t} else if k > n {\n\t\tv = 0\n\t}\n\treturn v\n}\n\nfunc factorial(n int) int {\n\treturn permutation(n, n-1)\n}\n\nfunc main() {\n\t// Code for C - Reconciled?\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\n\tvar count int\n\tvar flag int = 0\n\tif N == M {\n\t\tcount = count + 2\n\t} else if int(math.Abs(float64(N-M))) == 1 {\n\t\tcount++\n\t} else {\n\t\tflag = 1\n\t}\n\n\tif flag == 0 {\n\t\tcount *= factorial(N) % int(math.Pow10(9)+7)\n\t\tcount *= factorial(M) % int(math.Pow10(9)+7)\n\t\tcount = count % int(math.Pow10(9)+7)\n\t\tfmt.Println(count)\n\t} else {\n\t\tfmt.Println(\"0\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N dogs and M monkeys. He wants them to line up in a row.\n\nAs a Japanese saying goes, these dogs and monkeys are on bad terms. (\"ken'en no naka\", literally \"the relationship of dogs and monkeys\", means a relationship of mutual hatred.) Snuke is trying to reconsile them, by arranging the animals so that there are neither two adjacent dogs nor two adjacent monkeys.\n\nHow many such arrangements there are? Find the count modulo 10^9+7 (since animals cannot understand numbers larger than that).\nHere, dogs and monkeys are both distinguishable. Also, two arrangements that result from reversing each other are distinguished.\n\nConstraints\n\n1 ≤ N,M ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of possible arrangements, modulo 10^9+7.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n8\n\nWe will denote the dogs by A and B, and the monkeys by C and D. There are eight possible arrangements: ACBD, ADBC, BCAD, BDAC, CADB, CBDA, DACB and DBCA.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 8\n\nSample Output 3\n\n0\n\nSample Input 4\n\n100000 100000\n\nSample Output 4\n\n530123477", "sample_input": "2 2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03681", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N dogs and M monkeys. He wants them to line up in a row.\n\nAs a Japanese saying goes, these dogs and monkeys are on bad terms. (\"ken'en no naka\", literally \"the relationship of dogs and monkeys\", means a relationship of mutual hatred.) Snuke is trying to reconsile them, by arranging the animals so that there are neither two adjacent dogs nor two adjacent monkeys.\n\nHow many such arrangements there are? Find the count modulo 10^9+7 (since animals cannot understand numbers larger than that).\nHere, dogs and monkeys are both distinguishable. Also, two arrangements that result from reversing each other are distinguished.\n\nConstraints\n\n1 ≤ N,M ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of possible arrangements, modulo 10^9+7.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n8\n\nWe will denote the dogs by A and B, and the monkeys by C and D. There are eight possible arrangements: ACBD, ADBC, BCAD, BDAC, CADB, CBDA, DACB and DBCA.\n\nSample Input 2\n\n3 2\n\nSample Output 2\n\n12\n\nSample Input 3\n\n1 8\n\nSample Output 3\n\n0\n\nSample Input 4\n\n100000 100000\n\nSample Output 4\n\n530123477", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 726, "cpu_time_ms": 6, "memory_kb": 1840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s519094697", "group_id": "codeNet:p03687", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tdic := make([]map[rune]bool, len(s))\n\tflg := false\n\n\tfor i := range s {\n\t\tdic[i] = make(map[rune]bool)\n\t\tdic[i][rune(s[i])] = true\n\t}\n\tfor {\n\t\tfor c := 'a'; c <= 'z'; c++ {\n\t\t\tfor i := 0; i < len(dic); i++ {\n\t\t\t\tif !dic[i][rune(c)] {\n\t\t\t\t\tgoto exitLoop\n\t\t\t\t}\n\t\t\t}\n\t\t\tflg = true\n\t\texitLoop:\n\t\t}\n\t\tfor i := 0; i < len(dic)-1; i++ {\n\t\t\tfor j := range dic[i+1] {\n\t\t\t\tdic[i][j] = true\n\t\t\t}\n\t\t}\n\t\tif flg {\n\t\t\tbreak\n\t\t}\n\t\tdic = dic[:len(dic)-1]\n\t}\n\tfmt.Println(len(s) - len(dic))\n}\n", "language": "Go", "metadata": {"date": 1543372396, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03687.html", "problem_id": "p03687", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03687/input.txt", "sample_output_relpath": "derived/input_output/data/p03687/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03687/Go/s519094697.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s519094697", "user_id": "u323680411"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tdic := make([]map[rune]bool, len(s))\n\tflg := false\n\n\tfor i := range s {\n\t\tdic[i] = make(map[rune]bool)\n\t\tdic[i][rune(s[i])] = true\n\t}\n\tfor {\n\t\tfor c := 'a'; c <= 'z'; c++ {\n\t\t\tfor i := 0; i < len(dic); i++ {\n\t\t\t\tif !dic[i][rune(c)] {\n\t\t\t\t\tgoto exitLoop\n\t\t\t\t}\n\t\t\t}\n\t\t\tflg = true\n\t\texitLoop:\n\t\t}\n\t\tfor i := 0; i < len(dic)-1; i++ {\n\t\t\tfor j := range dic[i+1] {\n\t\t\t\tdic[i][j] = true\n\t\t\t}\n\t\t}\n\t\tif flg {\n\t\t\tbreak\n\t\t}\n\t\tdic = dic[:len(dic)-1]\n\t}\n\tfmt.Println(len(s) - len(dic))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke can change a string t of length N into a string t' of length N - 1 under the following rule:\n\nFor each i (1 ≤ i ≤ N - 1), the i-th character of t' must be either the i-th or (i + 1)-th character of t.\n\nThere is a string s consisting of lowercase English letters.\nSnuke's objective is to apply the above operation to s repeatedly so that all the characters in s are the same.\nFind the minimum necessary number of operations.\n\nConstraints\n\n1 ≤ |s| ≤ 100\n\ns consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum necessary number of operations to achieve the objective.\n\nSample Input 1\n\nserval\n\nSample Output 1\n\n3\n\nOne solution is: serval → srvvl → svvv → vvv.\n\nSample Input 2\n\njackal\n\nSample Output 2\n\n2\n\nOne solution is: jackal → aacaa → aaaa.\n\nSample Input 3\n\nzzz\n\nSample Output 3\n\n0\n\nAll the characters in s are the same from the beginning.\n\nSample Input 4\n\nwhbrjpjyhsrywlqjxdbrbaomnw\n\nSample Output 4\n\n8\n\nIn 8 operations, he can change s to rrrrrrrrrrrrrrrrrr.", "sample_input": "serval\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03687", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke can change a string t of length N into a string t' of length N - 1 under the following rule:\n\nFor each i (1 ≤ i ≤ N - 1), the i-th character of t' must be either the i-th or (i + 1)-th character of t.\n\nThere is a string s consisting of lowercase English letters.\nSnuke's objective is to apply the above operation to s repeatedly so that all the characters in s are the same.\nFind the minimum necessary number of operations.\n\nConstraints\n\n1 ≤ |s| ≤ 100\n\ns consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum necessary number of operations to achieve the objective.\n\nSample Input 1\n\nserval\n\nSample Output 1\n\n3\n\nOne solution is: serval → srvvl → svvv → vvv.\n\nSample Input 2\n\njackal\n\nSample Output 2\n\n2\n\nOne solution is: jackal → aacaa → aaaa.\n\nSample Input 3\n\nzzz\n\nSample Output 3\n\n0\n\nAll the characters in s are the same from the beginning.\n\nSample Input 4\n\nwhbrjpjyhsrywlqjxdbrbaomnw\n\nSample Output 4\n\n8\n\nIn 8 operations, he can change s to rrrrrrrrrrrrrrrrrr.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 546, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s388791069", "group_id": "codeNet:p03694", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Println(&n)\n\ta := make([]int, n)\n\tfor i,_ := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Ints(a)\n\tfmt.Println(a[len(a) - 1] - a[0])\n}\n", "language": "Go", "metadata": {"date": 1558480112, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03694.html", "problem_id": "p03694", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03694/input.txt", "sample_output_relpath": "derived/input_output/data/p03694/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03694/Go/s388791069.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s388791069", "user_id": "u899421906"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Println(&n)\n\ta := make([]int, n)\n\tfor i,_ := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Ints(a)\n\tfmt.Println(a[len(a) - 1] - a[0])\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.\n\nThere are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.\n\nFind the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n0 ≤ a_i ≤ 1000\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum distance to be traveled.\n\nSample Input 1\n\n4\n2 3 7 9\n\nSample Output 1\n\n7\n\nThe travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.\n\nIt is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.\n\nSample Input 2\n\n8\n3 1 4 1 5 9 2 6\n\nSample Output 2\n\n8\n\nThere may be more than one house at a position.", "sample_input": "4\n2 3 7 9\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03694", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.\n\nThere are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.\n\nFind the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n0 ≤ a_i ≤ 1000\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum distance to be traveled.\n\nSample Input 1\n\n4\n2 3 7 9\n\nSample Output 1\n\n7\n\nThe travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.\n\nIt is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.\n\nSample Input 2\n\n8\n3 1 4 1 5 9 2 6\n\nSample Output 2\n\n8\n\nThere may be more than one house at a position.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 198, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s870009245", "group_id": "codeNet:p03694", "input_text": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n var N, v, d int\n var list []int\n\n fmt.Scanf(\"%d\", &N)\n\n for i := 0; i < N; i++ {\n fmt.Scanf(\"%d\", &v)\n list = append(list, v)\n }\n sort.Sort(sort.IntSlice(list))\n\n for i := 1; i < N; i++ {\n d += (list[i] - list[i-1])\n }\n fmt.Println(d)\n}", "language": "Go", "metadata": {"date": 1497544073, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03694.html", "problem_id": "p03694", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03694/input.txt", "sample_output_relpath": "derived/input_output/data/p03694/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03694/Go/s870009245.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s870009245", "user_id": "u523986442"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n var N, v, d int\n var list []int\n\n fmt.Scanf(\"%d\", &N)\n\n for i := 0; i < N; i++ {\n fmt.Scanf(\"%d\", &v)\n list = append(list, v)\n }\n sort.Sort(sort.IntSlice(list))\n\n for i := 1; i < N; i++ {\n d += (list[i] - list[i-1])\n }\n fmt.Println(d)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIt is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.\n\nThere are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.\n\nFind the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n0 ≤ a_i ≤ 1000\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum distance to be traveled.\n\nSample Input 1\n\n4\n2 3 7 9\n\nSample Output 1\n\n7\n\nThe travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.\n\nIt is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.\n\nSample Input 2\n\n8\n3 1 4 1 5 9 2 6\n\nSample Output 2\n\n8\n\nThere may be more than one house at a position.", "sample_input": "4\n2 3 7 9\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03694", "source_text": "Score : 200 points\n\nProblem Statement\n\nIt is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.\n\nThere are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.\n\nFind the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n0 ≤ a_i ≤ 1000\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum distance to be traveled.\n\nSample Input 1\n\n4\n2 3 7 9\n\nSample Output 1\n\n7\n\nThe travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2.\n\nIt is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.\n\nSample Input 2\n\n8\n3 1 4 1 5 9 2 6\n\nSample Output 2\n\n8\n\nThere may be more than one house at a position.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 341, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s764109013", "group_id": "codeNet:p03695", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for C - Colorful Leaderboard\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tcolor := make(map[int]int, 9)\n\tvar a int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tif 1 <= a && a <= 399 {\n\t\t\tcolor[0]++\n\t\t} else if 400 <= a && a <= 799 {\n\t\t\tcolor[1]++\n\t\t} else if 800 <= a && a <= 1199 {\n\t\t\tcolor[2]++\n\t\t} else if 1200 <= a && a <= 1599 {\n\t\t\tcolor[3]++\n\t\t} else if 1600 <= a && a <= 1999 {\n\t\t\tcolor[4]++\n\t\t} else if 2000 <= a && a <= 2399 {\n\t\t\tcolor[5]++\n\t\t} else if 2400 <= a && a <= 2799 {\n\t\t\tcolor[6]++\n\t\t} else if 2800 <= a && a <= 3199 {\n\t\t\tcolor[7]++\n\t\t} else {\n\t\t\tcolor[8]++\n\t\t}\n\t}\n\n\tvar count int\n\tfor i := 0; i < 8; i++ {\n\t\tif color[i] > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tmin := int(math.Max(float64(count), 1))\n\tmax := int(math.Min(float64(count+color[8]), 8))\n\n\tfmt.Println(min, max)\n}\n", "language": "Go", "metadata": {"date": 1598525399, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03695.html", "problem_id": "p03695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03695/input.txt", "sample_output_relpath": "derived/input_output/data/p03695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03695/Go/s764109013.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s764109013", "user_id": "u128015095"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for C - Colorful Leaderboard\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tcolor := make(map[int]int, 9)\n\tvar a int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tif 1 <= a && a <= 399 {\n\t\t\tcolor[0]++\n\t\t} else if 400 <= a && a <= 799 {\n\t\t\tcolor[1]++\n\t\t} else if 800 <= a && a <= 1199 {\n\t\t\tcolor[2]++\n\t\t} else if 1200 <= a && a <= 1599 {\n\t\t\tcolor[3]++\n\t\t} else if 1600 <= a && a <= 1999 {\n\t\t\tcolor[4]++\n\t\t} else if 2000 <= a && a <= 2399 {\n\t\t\tcolor[5]++\n\t\t} else if 2400 <= a && a <= 2799 {\n\t\t\tcolor[6]++\n\t\t} else if 2800 <= a && a <= 3199 {\n\t\t\tcolor[7]++\n\t\t} else {\n\t\t\tcolor[8]++\n\t\t}\n\t}\n\n\tvar count int\n\tfor i := 0; i < 8; i++ {\n\t\tif color[i] > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tmin := int(math.Max(float64(count), 1))\n\tmax := int(math.Min(float64(count+color[8]), 8))\n\n\tfmt.Println(min, max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "sample_input": "4\n2100 2500 2700 2700\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p03695", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 840, "cpu_time_ms": 8, "memory_kb": 1844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s435068754", "group_id": "codeNet:p03695", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\ta := iSScan(n)\n\tx := make([]int, 9)\n\tfor _, v := range a {\n\t\tx[smaller(v/400, 8)]++\n\t}\n\tfor i := 0; i < 8; i++ {\n\t\tx[i] = smaller(1, x[i])\n\t}\n\tfmt.Println(sum(x[:8]), sum(x[:8])+x[8])\n}\n", "language": "Go", "metadata": {"date": 1594925081, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03695.html", "problem_id": "p03695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03695/input.txt", "sample_output_relpath": "derived/input_output/data/p03695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03695/Go/s435068754.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s435068754", "user_id": "u843722521"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\ta := iSScan(n)\n\tx := make([]int, 9)\n\tfor _, v := range a {\n\t\tx[smaller(v/400, 8)]++\n\t}\n\tfor i := 0; i < 8; i++ {\n\t\tx[i] = smaller(1, x[i])\n\t}\n\tfmt.Println(sum(x[:8]), sum(x[:8])+x[8])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "sample_input": "4\n2100 2500 2700 2700\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p03695", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1402, "cpu_time_ms": 3, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s108516531", "group_id": "codeNet:p03695", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar n int\n\tcon.Scan(&n)\n\tr := make([]bool, 8)\n\ts := 0\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tcon.Scan(&a)\n\t\tif a < 3200 {\n\t\t\tr[a/400] = true\n\t\t} else {\n\t\t\ts++\n\t\t}\n\t}\n\tt := 0\n\tfor _, a := range r {\n\t\tif a {\n\t\t\tt++\n\t\t}\n\t}\n\ts += t\n\tif s > 8 {\n\t\ts = 8\n\t}\n\tcon.Println(t, s)\n\treturn nil\n}\n", "language": "Go", "metadata": {"date": 1589704219, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03695.html", "problem_id": "p03695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03695/input.txt", "sample_output_relpath": "derived/input_output/data/p03695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03695/Go/s108516531.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s108516531", "user_id": "u718747410"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar n int\n\tcon.Scan(&n)\n\tr := make([]bool, 8)\n\ts := 0\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tcon.Scan(&a)\n\t\tif a < 3200 {\n\t\t\tr[a/400] = true\n\t\t} else {\n\t\t\ts++\n\t\t}\n\t}\n\tt := 0\n\tfor _, a := range r {\n\t\tif a {\n\t\t\tt++\n\t\t}\n\t}\n\ts += t\n\tif s > 8 {\n\t\ts = 8\n\t}\n\tcon.Println(t, s)\n\treturn nil\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "sample_input": "4\n2100 2500 2700 2700\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p03695", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1180, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s112926576", "group_id": "codeNet:p03695", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\trank := make([]int, 8+1)\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\trank[checkRank(tmp)]++\n\t}\n\tsum := 0\n\tfor i := 0; i < 8; i++ {\n\t\tif rank[i] > 0 {\n\t\t\tsum++\n\t\t}\n\t}\n\tminNum := int(math.Max(float64(1), float64(sum)))\n\tmaxNum := int(math.Min(float64(8), float64(sum+rank[8])))\n\tfmt.Printf(\"%d %d\\n\", minNum, maxNum)\n\n}\n\nfunc checkRank(num int) int {\n\tif num >= 8*400 {\n\t\treturn 8\n\t}\n\treturn num / 400\n}\n", "language": "Go", "metadata": {"date": 1589071215, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03695.html", "problem_id": "p03695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03695/input.txt", "sample_output_relpath": "derived/input_output/data/p03695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03695/Go/s112926576.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s112926576", "user_id": "u290750807"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\trank := make([]int, 8+1)\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\trank[checkRank(tmp)]++\n\t}\n\tsum := 0\n\tfor i := 0; i < 8; i++ {\n\t\tif rank[i] > 0 {\n\t\t\tsum++\n\t\t}\n\t}\n\tminNum := int(math.Max(float64(1), float64(sum)))\n\tmaxNum := int(math.Min(float64(8), float64(sum+rank[8])))\n\tfmt.Printf(\"%d %d\\n\", minNum, maxNum)\n\n}\n\nfunc checkRank(num int) int {\n\tif num >= 8*400 {\n\t\treturn 8\n\t}\n\treturn num / 400\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "sample_input": "4\n2100 2500 2700 2700\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p03695", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 498, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s354282725", "group_id": "codeNet:p03695", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Scan()\n\t//n, _ := strconv.Atoi(s.Text())\n\ts.Scan()\n\n\tm := make(map[int]bool)\n\ta := strings.Split(s.Text(), \" \")\n\tc := 0\n\tfor _, v := range a {\n\t\ti, _ := strconv.Atoi(v)\n\t\tif i > 3199 {\n\t\t\tc++\n\t\t} else {\n\t\t\tm[i/400] = true\n\t\t}\n\t}\n\tr := c + len(m)\n\tif r > 8 {\n\t\tr = 8\n\t}\n\n\tif len(m) == 0 {\n\t\tfmt.Printf(\"%v %v\\n\", 1, r)\n\t\treturn\n\t}\n\tfmt.Printf(\"%v %v\\n\", len(m), r)\n}\n", "language": "Go", "metadata": {"date": 1497430881, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03695.html", "problem_id": "p03695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03695/input.txt", "sample_output_relpath": "derived/input_output/data/p03695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03695/Go/s354282725.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s354282725", "user_id": "u341914520"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Scan()\n\t//n, _ := strconv.Atoi(s.Text())\n\ts.Scan()\n\n\tm := make(map[int]bool)\n\ta := strings.Split(s.Text(), \" \")\n\tc := 0\n\tfor _, v := range a {\n\t\ti, _ := strconv.Atoi(v)\n\t\tif i > 3199 {\n\t\t\tc++\n\t\t} else {\n\t\t\tm[i/400] = true\n\t\t}\n\t}\n\tr := c + len(m)\n\tif r > 8 {\n\t\tr = 8\n\t}\n\n\tif len(m) == 0 {\n\t\tfmt.Printf(\"%v %v\\n\", 1, r)\n\t\treturn\n\t}\n\tfmt.Printf(\"%v %v\\n\", len(m), r)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "sample_input": "4\n2100 2500 2700 2700\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p03695", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 487, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s119827487", "group_id": "codeNet:p03695", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\n\tN := fsc.NextInt()\n\tvar rates []int\n\tcolors := map[int]int{}\n\tfor i := 0; i < N; i++ {\n\t\trates = append(rates, IntMin(8, fsc.NextInt()/400))\n\t\tif rates[i] <= 7 {\n\t\t\tcolors[rates[i]] = 1\n\t\t}\n\t}\n\tsort.Ints(rates)\n\tresMin := IntMax(1, len(colors))\n\tresMax := len(colors)\n\tfor i := 0; i < N; i++ {\n\t\tif rates[i] >= 8 {\n\t\t\tresMax++\n\t\t}\n\t}\n\tfmt.Println(resMin, resMax)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc Int64Abs(a int64) int64 {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1497144439, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03695.html", "problem_id": "p03695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03695/input.txt", "sample_output_relpath": "derived/input_output/data/p03695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03695/Go/s119827487.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s119827487", "user_id": "u976162616"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\n\tN := fsc.NextInt()\n\tvar rates []int\n\tcolors := map[int]int{}\n\tfor i := 0; i < N; i++ {\n\t\trates = append(rates, IntMin(8, fsc.NextInt()/400))\n\t\tif rates[i] <= 7 {\n\t\t\tcolors[rates[i]] = 1\n\t\t}\n\t}\n\tsort.Ints(rates)\n\tresMin := IntMax(1, len(colors))\n\tresMax := len(colors)\n\tfor i := 0; i < N; i++ {\n\t\tif rates[i] >= 8 {\n\t\t\tresMax++\n\t\t}\n\t}\n\tfmt.Println(resMin, resMax)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc Int64Abs(a int64) int64 {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "sample_input": "4\n2100 2500 2700 2700\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p03695", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:\n\nRating 1-399 : gray\n\nRating 400-799 : brown\n\nRating 800-1199 : green\n\nRating 1200-1599 : cyan\n\nRating 1600-1999 : blue\n\nRating 2000-2399 : yellow\n\nRating 2400-2799 : orange\n\nRating 2800-3199 : red\n\nOther than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.\n\nCurrently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.\n\nFind the minimum and maximum possible numbers of different colors of the users.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ a_i ≤ 4800\n\na_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.\n\nSample Input 1\n\n4\n2100 2500 2700 2700\n\nSample Output 1\n\n2 2\n\nThe user with rating 2100 is \"yellow\", and the others are \"orange\". There are two different colors.\n\nSample Input 2\n\n5\n1100 1900 2800 3200 3200\n\nSample Output 2\n\n3 5\n\nThe user with rating 1100 is \"green\", the user with rating 1900 is blue and the user with rating 2800 is \"red\".\n\nIf the fourth user picks \"red\", and the fifth user picks \"blue\", there are three different colors. This is one possible scenario for the minimum number of colors.\n\nIf the fourth user picks \"purple\", and the fifth user picks \"black\", there are five different colors. This is one possible scenario for the maximum number of colors.\n\nSample Input 3\n\n20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990\n\nSample Output 3\n\n1 1\n\nAll the users are \"green\", and thus there is one color.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2237, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s685693303", "group_id": "codeNet:p03697", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []byte {\n\treturn []byte(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif x%y != 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn y\n}\n\nfunc run(input io.Reader, output io.Writer) int {\n\tsc := NewScanner()\n\tA := sc.nextInt()\n\tB := sc.nextInt()\n\n\tif A+B < 10 {\n\t\tfmt.Println(A + B)\n\t} else {\n\t\tfmt.Println(\"error\")\n\t}\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run(os.Stdin, os.Stdout))\n}\n", "language": "Go", "metadata": {"date": 1588393898, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03697.html", "problem_id": "p03697", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03697/input.txt", "sample_output_relpath": "derived/input_output/data/p03697/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03697/Go/s685693303.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s685693303", "user_id": "u737368452"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []byte {\n\treturn []byte(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif x%y != 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn y\n}\n\nfunc run(input io.Reader, output io.Writer) int {\n\tsc := NewScanner()\n\tA := sc.nextInt()\n\tB := sc.nextInt()\n\n\tif A+B < 10 {\n\t\tfmt.Println(A + B)\n\t} else {\n\t\tfmt.Println(\"error\")\n\t}\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run(os.Stdin, os.Stdout))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B as the input. Output the value of A + B.\n\nHowever, if A + B is 10 or greater, output error instead.\n\nConstraints\n\nA and B are integers.\n\n1 ≤ A, B ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A + B is 10 or greater, print the string error (case-sensitive); otherwise, print the value of A + B.\n\nSample Input 1\n\n6 3\n\nSample Output 1\n\n9\n\nSample Input 2\n\n6 4\n\nSample Output 2\n\nerror", "sample_input": "6 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03697", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers A and B as the input. Output the value of A + B.\n\nHowever, if A + B is 10 or greater, output error instead.\n\nConstraints\n\nA and B are integers.\n\n1 ≤ A, B ≤ 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf A + B is 10 or greater, print the string error (case-sensitive); otherwise, print the value of A + B.\n\nSample Input 1\n\n6 3\n\nSample Output 1\n\n9\n\nSample Input 2\n\n6 4\n\nSample Output 2\n\nerror", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1281, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s410476198", "group_id": "codeNet:p03698", "input_text": "package main\nimport(\n \"fmt\"\n)\n func main(){\n var s string\n var i, j int\n fmt.Scan(&s)\n for i=0;i 0 {\n\t\t\tt -= s[0]\n\t\t}\n\t\tif t%10 == 0 {\n\t\t\tt = 0\n\t\t}\n\t}\n\tcon.Println(t)\n\treturn nil\n}\n", "language": "Go", "metadata": {"date": 1588719219, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03699.html", "problem_id": "p03699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03699/input.txt", "sample_output_relpath": "derived/input_output/data/p03699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03699/Go/s345842369.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s345842369", "user_id": "u718747410"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar n int\n\tcon.Scan(&n)\n\ts := []int{}\n\tt := 0\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tcon.Scan(&a)\n\t\tt += a\n\t\tif a%10 != 0 {\n\t\t\ts = append(s, a)\n\t\t}\n\t}\n\tsort.Ints(s)\n\tif t%10 == 0 {\n\t\tif len(s) > 0 {\n\t\t\tt -= s[0]\n\t\t}\n\t\tif t%10 == 0 {\n\t\t\tt = 0\n\t\t}\n\t}\n\tcon.Println(t)\n\treturn nil\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "sample_input": "3\n5\n10\n15\n"}, "reference_outputs": ["25\n"], "source_document_id": "p03699", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1183, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s952735778", "group_id": "codeNet:p03699", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tss := make([]int, n)\n\tfor i := range ss {\n\t\tfmt.Scan(&ss[i])\n\t}\n\n\tsum := 0\n\tfor _, s := range ss {\n\t\tsum += s\n\t}\n\n\tmin := 101\n\tfor _, s := range ss {\n\t\tif s < min && s%10 != 0 {\n\t\t\tmin = s\n\t\t}\n\t}\n\n\tif sum%10 == 0 {\n\t\tif min == 101 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(sum - min)\n\t\t}\n\t} else {\n\t\tfmt.Println(sum)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1550767562, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03699.html", "problem_id": "p03699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03699/input.txt", "sample_output_relpath": "derived/input_output/data/p03699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03699/Go/s952735778.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s952735778", "user_id": "u113872560"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tss := make([]int, n)\n\tfor i := range ss {\n\t\tfmt.Scan(&ss[i])\n\t}\n\n\tsum := 0\n\tfor _, s := range ss {\n\t\tsum += s\n\t}\n\n\tmin := 101\n\tfor _, s := range ss {\n\t\tif s < min && s%10 != 0 {\n\t\t\tmin = s\n\t\t}\n\t}\n\n\tif sum%10 == 0 {\n\t\tif min == 101 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(sum - min)\n\t\t}\n\t} else {\n\t\tfmt.Println(sum)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "sample_input": "3\n5\n10\n15\n"}, "reference_outputs": ["25\n"], "source_document_id": "p03699", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 394, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s289137520", "group_id": "codeNet:p03699", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ts := make([]int, N)\n\tsum := 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&s[i])\n\t\tsum += s[i]\n\t}\n\tif sum%10 == 0 {\n\t\tsort.Ints(s)\n\t\tfor i, v := range s {\n\t\t\tif v%10 != 0 {\n\t\t\t\tfmt.Println(sum - v)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif i == N-1 {\n\t\t\t\tfmt.Println(0)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(sum)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1496539834, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03699.html", "problem_id": "p03699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03699/input.txt", "sample_output_relpath": "derived/input_output/data/p03699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03699/Go/s289137520.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s289137520", "user_id": "u688490278"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ts := make([]int, N)\n\tsum := 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&s[i])\n\t\tsum += s[i]\n\t}\n\tif sum%10 == 0 {\n\t\tsort.Ints(s)\n\t\tfor i, v := range s {\n\t\t\tif v%10 != 0 {\n\t\t\t\tfmt.Println(sum - v)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif i == N-1 {\n\t\t\t\tfmt.Println(0)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(sum)\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "sample_input": "3\n5\n10\n15\n"}, "reference_outputs": ["25\n"], "source_document_id": "p03699", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either \"correct\" or \"incorrect\", and your grade will be the sum of the points allocated to questions that are answered correctly. When you finish answering the questions, your answers will be immediately judged and your grade will be displayed... if everything goes well.\n\nHowever, the examination system is actually flawed, and if your grade is a multiple of 10, the system displays 0 as your grade. Otherwise, your grade is displayed correctly. In this situation, what is the maximum value that can be displayed as your grade?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 100\n\n1 ≤ s_i ≤ 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the maximum value that can be displayed as your grade.\n\nSample Input 1\n\n3\n5\n10\n15\n\nSample Output 1\n\n25\n\nYour grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.\n\nSample Input 2\n\n3\n10\n10\n15\n\nSample Output 2\n\n35\n\nYour grade will be 35 if all the questions are answered correctly, and this grade will be displayed correctly.\n\nSample Input 3\n\n3\n10\n20\n30\n\nSample Output 3\n\n0\n\nRegardless of whether each question is answered correctly or not, your grade will be a multiple of 10 and displayed as 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 367, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s176752059", "group_id": "codeNet:p03711", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []byte {\n\treturn []byte(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif x%y != 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn y\n}\n\nfunc run(input io.Reader, output io.Writer) int {\n\tsc := NewScanner()\n\tx := sc.nextInt()\n\ty := sc.nextInt()\n\n\tg := map[int]int{1: 1, 3: 1, 5: 1, 7: 1, 8: 1, 10: 1, 12: 1, 4: 2, 6: 2, 9: 2, 11: 2, 2: 3}\n\n\tif g[x] == g[y] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run(os.Stdin, os.Stdout))\n}\n", "language": "Go", "metadata": {"date": 1588393533, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03711.html", "problem_id": "p03711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03711/input.txt", "sample_output_relpath": "derived/input_output/data/p03711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03711/Go/s176752059.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s176752059", "user_id": "u737368452"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []byte {\n\treturn []byte(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif x%y != 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn y\n}\n\nfunc run(input io.Reader, output io.Writer) int {\n\tsc := NewScanner()\n\tx := sc.nextInt()\n\ty := sc.nextInt()\n\n\tg := map[int]int{1: 1, 3: 1, 5: 1, 7: 1, 8: 1, 10: 1, 12: 1, 4: 2, 6: 2, 9: 2, 11: 2, 2: 3}\n\n\tif g[x] == g[y] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run(os.Stdin, os.Stdout))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.\nGiven two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.\n\nConstraints\n\nx and y are integers.\n\n1 ≤ x < y ≤ 12\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nIf x and y belong to the same group, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\nNo", "sample_input": "1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03711", "source_text": "Score : 100 points\n\nProblem Statement\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.\nGiven two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.\n\nConstraints\n\nx and y are integers.\n\n1 ≤ x < y ≤ 12\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx y\n\nOutput\n\nIf x and y belong to the same group, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n2 4\n\nSample Output 2\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1376, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s562018084", "group_id": "codeNet:p03712", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar nextString func() string\n\nfunc init() {\n\tnextString = newReadString(os.Stdin)\n}\n\nfunc main() {\n\th := nextInt()\n\tw := nextInt()\n\ta := make([]string, h)\n\n\tfor i := 0; i < h; i++ {\n\t\ta[i] = nextString()\n\t}\n\n\tfor i := -1; i <= h; i++ {\n\t\tfmt.Print(\"#\")\n\t\tif 0 <= i && i < h {\n\t\t\tfmt.Print(a[i])\n\t\t} else {\n\t\t\tfmt.Print(strings.Repeat(\"#\", w))\n\t\t}\n\t\tfmt.Println(\"#\")\n\t}\n}\n\nfunc nextInt() (result int) {\n\tresult, _ = strconv.Atoi(nextString())\n\treturn\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1541251890, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03712.html", "problem_id": "p03712", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03712/input.txt", "sample_output_relpath": "derived/input_output/data/p03712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03712/Go/s562018084.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s562018084", "user_id": "u323680411"}, "prompt_components": {"gold_output": "#####\n#abc#\n#arc#\n#####\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar nextString func() string\n\nfunc init() {\n\tnextString = newReadString(os.Stdin)\n}\n\nfunc main() {\n\th := nextInt()\n\tw := nextInt()\n\ta := make([]string, h)\n\n\tfor i := 0; i < h; i++ {\n\t\ta[i] = nextString()\n\t}\n\n\tfor i := -1; i <= h; i++ {\n\t\tfmt.Print(\"#\")\n\t\tif 0 <= i && i < h {\n\t\t\tfmt.Print(a[i])\n\t\t} else {\n\t\t\tfmt.Print(strings.Repeat(\"#\", w))\n\t\t}\n\t\tfmt.Println(\"#\")\n\t}\n}\n\nfunc nextInt() (result int) {\n\tresult, _ = strconv.Atoi(nextString())\n\treturn\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a image with a height of H pixels and a width of W pixels.\nEach pixel is represented by a lowercase English letter.\nThe pixel at the i-th row from the top and j-th column from the left is a_{ij}.\n\nPut a box around this image and output the result. The box should consist of # and have a thickness of 1.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\na_{ij} is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nOutput\n\nPrint the image surrounded by a box that consists of # and has a thickness of 1.\n\nSample Input 1\n\n2 3\nabc\narc\n\nSample Output 1\n\n#####\n#abc#\n#arc#\n#####\n\nSample Input 2\n\n1 1\nz\n\nSample Output 2\n\n###\n#z#\n###", "sample_input": "2 3\nabc\narc\n"}, "reference_outputs": ["#####\n#abc#\n#arc#\n#####\n"], "source_document_id": "p03712", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a image with a height of H pixels and a width of W pixels.\nEach pixel is represented by a lowercase English letter.\nThe pixel at the i-th row from the top and j-th column from the left is a_{ij}.\n\nPut a box around this image and output the result. The box should consist of # and have a thickness of 1.\n\nConstraints\n\n1 ≤ H, W ≤ 100\n\na_{ij} is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11} ... a_{1W}\n:\na_{H1} ... a_{HW}\n\nOutput\n\nPrint the image surrounded by a box that consists of # and has a thickness of 1.\n\nSample Input 1\n\n2 3\nabc\narc\n\nSample Output 1\n\n#####\n#abc#\n#arc#\n#####\n\nSample Input 2\n\n1 1\nz\n\nSample Output 2\n\n###\n#z#\n###", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 744, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s064838312", "group_id": "codeNet:p03713", "input_text": "// Try AtCoder\n// author: Leonardone @ NEETSDKASU\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tif h%3 == 0 || w%3 == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\th2 := h / 2\n\tw2 := w / 2\n\ts2a := h2 * w\n\ts2b := (h - h2) * w2\n\ts2c := (h - h2) * (w - w2)\n\n\tans1 := Max(Abs(s2a-s2b), Max(Abs(s2b-s2c), Abs(s2c-s2a)))\n\n\ts3a := h * w2\n\ts3b := h2 * (w - w2)\n\ts3c := (h - h2) * (w - w2)\n\n\tans2 := Max(Abs(s3a-s3b), Max(Abs(s3b-s3c), Abs(s3c-s3a)))\n\n\tfmt.Println(Min(ans1, ans2))\n}\n", "language": "Go", "metadata": {"date": 1495331220, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03713.html", "problem_id": "p03713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03713/input.txt", "sample_output_relpath": "derived/input_output/data/p03713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03713/Go/s064838312.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s064838312", "user_id": "u714587753"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "// Try AtCoder\n// author: Leonardone @ NEETSDKASU\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tif h%3 == 0 || w%3 == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\th2 := h / 2\n\tw2 := w / 2\n\ts2a := h2 * w\n\ts2b := (h - h2) * w2\n\ts2c := (h - h2) * (w - w2)\n\n\tans1 := Max(Abs(s2a-s2b), Max(Abs(s2b-s2c), Abs(s2c-s2a)))\n\n\ts3a := h * w2\n\ts3b := h2 * (w - w2)\n\ts3c := (h - h2) * (w - w2)\n\n\tans2 := Max(Abs(s3a-s3b), Max(Abs(s3b-s3c), Abs(s3c-s3a)))\n\n\tfmt.Println(Min(ans1, ans2))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03713", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 720, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s926870763", "group_id": "codeNet:p03715", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nconst max = 10000000000\n\nvar h, w, size int64\n\nfunc abs(i int64) int64 {\n\tif i < 0 {\n\t\treturn -i\n\t}\n\treturn i\n}\n\nfunc min(i, j int64) int64 {\n\tif i < j {\n\t\treturn i\n\t}\n\treturn j\n}\n\nfunc calcLeft(x int64) int64 {\n\treturn x * h\n}\n\nfunc calcRightUp(x int64) int64 {\n\treturn (w - x) * (h/2 + h%2)\n}\n\nfunc calcRightDown(x int64) int64 {\n\treturn (w - x) * (h / 2)\n}\n\nfunc calcMin(x, min int64) int64 {\n\tleft, rightUp, rightDown := calcLeft(x), calcRightUp(x), calcRightDown(x)\n\n\tsizes := []int{int(rightUp), int(rightDown), int(left)}\n\tsort.Ints(sizes)\n\tminSize, maxSize := int64(sizes[0]), int64(sizes[2])\n\tdiff := maxSize - minSize\n\n\tif diff < min {\n\t\tmin = diff\n\t} else {\n\t\treturn min\n\t}\n\n\treturn calcMin(x+1, min)\n}\n\nfunc main() {\n\tfmt.Scan(&h, &w)\n\tsize = h * w\n\n\tif h%3 == 0 || w%3 == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tif h > w {\n\t\th, w = w, h\n\t}\n\n\tfmt.Println(min(calcMin(1, max), h))\n}", "language": "Go", "metadata": {"date": 1542765608, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03715.html", "problem_id": "p03715", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03715/input.txt", "sample_output_relpath": "derived/input_output/data/p03715/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03715/Go/s926870763.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s926870763", "user_id": "u875592584"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nconst max = 10000000000\n\nvar h, w, size int64\n\nfunc abs(i int64) int64 {\n\tif i < 0 {\n\t\treturn -i\n\t}\n\treturn i\n}\n\nfunc min(i, j int64) int64 {\n\tif i < j {\n\t\treturn i\n\t}\n\treturn j\n}\n\nfunc calcLeft(x int64) int64 {\n\treturn x * h\n}\n\nfunc calcRightUp(x int64) int64 {\n\treturn (w - x) * (h/2 + h%2)\n}\n\nfunc calcRightDown(x int64) int64 {\n\treturn (w - x) * (h / 2)\n}\n\nfunc calcMin(x, min int64) int64 {\n\tleft, rightUp, rightDown := calcLeft(x), calcRightUp(x), calcRightDown(x)\n\n\tsizes := []int{int(rightUp), int(rightDown), int(left)}\n\tsort.Ints(sizes)\n\tminSize, maxSize := int64(sizes[0]), int64(sizes[2])\n\tdiff := maxSize - minSize\n\n\tif diff < min {\n\t\tmin = diff\n\t} else {\n\t\treturn min\n\t}\n\n\treturn calcMin(x+1, min)\n}\n\nfunc main() {\n\tfmt.Scan(&h, &w)\n\tsize = h * w\n\n\tif h%3 == 0 || w%3 == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tif h > w {\n\t\th, w = w, h\n\t}\n\n\tfmt.Println(min(calcMin(1, max), h))\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03715", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a bar of chocolate with a height of H blocks and a width of W blocks.\nSnuke is dividing this bar into exactly three pieces.\nHe can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.\n\nSnuke is trying to divide the bar as evenly as possible.\nMore specifically, he is trying to minimize S_{max} - S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece.\nFind the minimum possible value of S_{max} - S_{min}.\n\nConstraints\n\n2 ≤ H, W ≤ 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\n\nOutput\n\nPrint the minimum possible value of S_{max} - S_{min}.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\nIn the division below, S_{max} - S_{min} = 5 - 5 = 0.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n2\n\nIn the division below, S_{max} - S_{min} = 8 - 6 = 2.\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\n4\n\nIn the division below, S_{max} - S_{min} = 10 - 6 = 4.\n\nSample Input 4\n\n100000 2\n\nSample Output 4\n\n1\n\nSample Input 5\n\n100000 100000\n\nSample Output 5\n\n50000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 929, "cpu_time_ms": 19, "memory_kb": 8448}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s363174057", "group_id": "codeNet:p03721", "input_text": "package main\nimport . \"fmt\"\nimport \"sort\"\nfunc main() {\n var n,a,b,i int\n var k int64\n var keys []int\n m := map[int]int64{}\n Scan(&n,&k)\n for i=0;i %d\\n\", dist[i])\n\t// }\n\n\tif dist[nNode-1] == -INF {\n\t\tfmt.Println(\"inf\")\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", -dist[nNode-1])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1505172426, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03722.html", "problem_id": "p03722", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03722/input.txt", "sample_output_relpath": "derived/input_output/data/p03722/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03722/Go/s227453712.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s227453712", "user_id": "u703511577"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n//\t\"sort\"\n)\n\ntype E struct {\n\ta, b, c int\n}\n\nconst INF = 10000000000000\n\nfunc main() {\n\tvar nNode, nEdge int\n\tfmt.Scan(&nNode, &nEdge)\n\n\tg := make([][]E, nNode, nNode)\n\tfor i := 0; i < nNode; i++ {\n\t\tg[i] = make([]E, 0, nNode)\n\t}\n\n\tfor i := 0; i < nEdge; i++ {\n\t\tvar e E\n\t\tfmt.Scan(&e.a, &e.b, &e.c)\n\t\te.a--\n\t\te.b--\n\t\te.c = -e.c\n\t\tg[e.a] = append(g[e.a], e)\n\t}\n\n\t// for i := 0; i < nNode; i++ {\n\t// \tfor j := 0; j < len(g[i]); j++ {\n\t// \t\te := g[i][j]\n\t// \t\tfmt.Printf(\"{%d,%d,%d} \", e.a, e.b, e.c)\n\t// \t}\n\t// \tfmt.Println(\"\")\n\t// }\n\n\tdist := make([]int, nNode, nNode)\n\tfor i := 0; i < nNode; i++ {\n\t\tdist[i] = INF + INF\n\t}\n\tdist[0] = 0\n\n\t// for k := 0; k < nNode; k++ {\n\t// \tfor i := 0; i < nNode; i++ {\n\t// \t\tfor j := 0; j < len(g[i]); j++ {\n\t// \t\t\te := g[i][j]\n\t// \t\t\tif dist[e.a] + e.c < dist[e.b] {\n\t// \t\t\t\tdist[e.b] = dist[e.a] + e.c\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t// }\n\t// mini := dist[nNode-1]\n\t// for k := 0; k < nNode; k++ {\n\t// \tfor i := 0; i < nNode; i++ {\n\t// \t\tfor j := 0; j < len(g[i]); j++ {\n\t// \t\t\te := g[i][j]\n\t// \t\t\tif dist[e.a] + e.c < dist[e.b] {\n\t// \t\t\t\tdist[e.b] = dist[e.a] + e.c\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t// }\n\t// if dist[nNode-1] < mini {\n\t// \tfmt.Println(\"inf\")\n\t// } else {\n\t// \tfmt.Printf(\"%d\\n\", -mini)\n\t// }\n\n\tfor k := 0; k < nNode; k++ {\n\t\tfor i := 0; i < nNode; i++ {\n\t\t\tfor j := 0; j < len(g[i]); j++ {\n\t\t\t\te := g[i][j]\n\t\t\t\tif dist[e.a] + e.c < dist[e.b] {\n\t\t\t\t\tdist[e.b] = dist[e.a] + e.c\n\t\t\t\t\t// fmt.Printf(\"%d,%d\\n\", e.b, dist[e.b])\n\t\t\t\t\tif k == nNode-1 {\n\t\t\t\t\t\tdist[e.b] = -INF\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// for i := 0; i < nNode; i++ {\n\t// \tfmt.Printf(\"> %d\\n\", dist[i])\n\t// }\n\n\tif dist[nNode-1] == -INF {\n\t\tfmt.Println(\"inf\")\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", -dist[nNode-1])\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a directed graph with N vertices and M edges.\nThe i-th edge (1≤i≤M) points from vertex a_i to vertex b_i, and has a weight c_i.\nWe will play the following single-player game using this graph and a piece.\n\nInitially, the piece is placed at vertex 1, and the score of the player is set to 0.\nThe player can move the piece as follows:\n\nWhen the piece is placed at vertex a_i, move the piece along the i-th edge to vertex b_i. After this move, the score of the player is increased by c_i.\n\nThe player can end the game only when the piece is placed at vertex N.\nThe given graph guarantees that it is possible to traverse from vertex 1 to vertex N.\n\nWhen the player acts optimally to maximize the score at the end of the game, what will the score be?\nIf it is possible to increase the score indefinitely, print inf.\n\nConstraints\n\n2≤N≤1000\n\n1≤M≤min(N(N-1),2000)\n\n1≤a_i,b_i≤N (1≤i≤M)\n\na_i≠b_i (1≤i≤M)\n\na_i≠a_j or b_i≠b_j (1≤i b {\n\t\treturn a\n\t}\n\treturn b\n}\n\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) nextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) nextInt() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1494597292, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03732.html", "problem_id": "p03732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03732/input.txt", "sample_output_relpath": "derived/input_output/data/p03732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03732/Go/s879296114.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s879296114", "user_id": "u696272993"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := newScanner()\n\tN := sc.nextInt()\n\tW := sc.nextInt()\n\tvar s [4][]int\n\tvar w1 int\n\tvar w, v int\n\tfor i := 0; i < N; i++ {\n\t\tw = sc.nextInt()\n\t\tv = sc.nextInt()\n\t\tif i == 0 {\n\t\t\tw1 = w\n\t\t}\n\t\ts[w-w1] = append(s[w-w1], v)\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tsort.Sort(sort.IntSlice(s[i]))\n\t\ts[i] = append([]int{0}, s[i]...)\n\t\tfor j := 1; j < len(s[i]); j++ {\n\t\t\ts[i][j] += s[i][j-1]\n\t\t}\n\t}\n\tvar ans int\n\tfor i := 0; i < len(s[0]); i++ {\n\t\tfor j := 0; j < len(s[1]); j++ {\n\t\t\tfor k := 0; k < len(s[2]); k++ {\n\t\t\t\tfor l := 0; l < len(s[3]); l++ {\n\t\t\t\t\tf := w1*i + (w1+1)*j + (w1+2)*k + (w1+3)*l\n\t\t\t\t\tif f <= W {\n\t\t\t\t\t\tans = max(ans, s[0][i]+s[1][j]+s[2][k]+s[3][l])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) nextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) nextInt() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "sample_input": "4 6\n2 1\n3 4\n4 10\n3 4\n"}, "reference_outputs": ["11\n"], "source_document_id": "p03732", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1658, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s215157879", "group_id": "codeNet:p03734", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype item struct {\n\tw int\n\tv int\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\tn, W := nextInt(), nextInt()\n\titems := make([]item, n)\n\tfor i := range items {\n\t\tw, v := nextInt(), nextInt()\n\t\titems[i] = item{w, v}\n\t}\n\tdp := make(map[int]int)\n\tdp[0] = 0\n\tfor _, item := range items {\n\t\tdpNext := make(map[int]int)\n\t\tfor w, v := range dp {\n\t\t\twTmp, vTmp := w, v\n\t\t\tvNext, ok := dpNext[wTmp]\n\t\t\tif !ok || vTmp > vNext {\n\t\t\t\tdpNext[wTmp] = vTmp\n\t\t\t}\n\n\t\t\twTmp, vTmp = w+item.w, v+item.v\n\t\t\tif wTmp > W {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvNext, ok = dpNext[wTmp]\n\t\t\tif !ok || vTmp > vNext {\n\t\t\t\tdpNext[wTmp] = vTmp\n\t\t\t}\n\t\t}\n\t\tdp = dpNext\n\t}\n\n\tans := 0\n\tfor _, v := range dp {\n\t\tif v > ans {\n\t\t\tans = v\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1568914711, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03734.html", "problem_id": "p03734", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03734/input.txt", "sample_output_relpath": "derived/input_output/data/p03734/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03734/Go/s215157879.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s215157879", "user_id": "u712822150"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype item struct {\n\tw int\n\tv int\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\tn, W := nextInt(), nextInt()\n\titems := make([]item, n)\n\tfor i := range items {\n\t\tw, v := nextInt(), nextInt()\n\t\titems[i] = item{w, v}\n\t}\n\tdp := make(map[int]int)\n\tdp[0] = 0\n\tfor _, item := range items {\n\t\tdpNext := make(map[int]int)\n\t\tfor w, v := range dp {\n\t\t\twTmp, vTmp := w, v\n\t\t\tvNext, ok := dpNext[wTmp]\n\t\t\tif !ok || vTmp > vNext {\n\t\t\t\tdpNext[wTmp] = vTmp\n\t\t\t}\n\n\t\t\twTmp, vTmp = w+item.w, v+item.v\n\t\t\tif wTmp > W {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvNext, ok = dpNext[wTmp]\n\t\t\tif !ok || vTmp > vNext {\n\t\t\t\tdpNext[wTmp] = vTmp\n\t\t\t}\n\t\t}\n\t\tdp = dpNext\n\t}\n\n\tans := 0\n\tfor _, v := range dp {\n\t\tif v > ans {\n\t\t\tans = v\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "sample_input": "4 6\n2 1\n3 4\n4 10\n3 4\n"}, "reference_outputs": ["11\n"], "source_document_id": "p03734", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N items and a bag of strength W.\nThe i-th item has a weight of w_i and a value of v_i.\n\nYou will select some of the items and put them in the bag.\nHere, the total weight of the selected items needs to be at most W.\n\nYour objective is to maximize the total value of the selected items.\n\nConstraints\n\n1 ≤ N ≤ 100\n\n1 ≤ W ≤ 10^9\n\n1 ≤ w_i ≤ 10^9\n\nFor each i = 2,3,...,N, w_1 ≤ w_i ≤ w_1 + 3.\n\n1 ≤ v_i ≤ 10^7\n\nW, each w_i and v_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible total value of the selected items.\n\nSample Input 1\n\n4 6\n2 1\n3 4\n4 10\n3 4\n\nSample Output 1\n\n11\n\nThe first and third items should be selected.\n\nSample Input 2\n\n4 6\n2 1\n3 7\n4 10\n3 6\n\nSample Output 2\n\n13\n\nThe second and fourth items should be selected.\n\nSample Input 3\n\n4 10\n1 100\n1 100\n1 100\n1 100\n\nSample Output 3\n\n400\n\nYou can take everything.\n\nSample Input 4\n\n4 1\n10 100\n10 100\n10 100\n10 100\n\nSample Output 4\n\n0\n\nYou can take nothing.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1029, "cpu_time_ms": 30, "memory_kb": 5376}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s847480588", "group_id": "codeNet:p03737", "input_text": "package main\n\nimport(\n \"fmt\"\n \"strings\"\n)\n\n\n\nfunc main() {\n var a,b,c string\n fmt.Scan(&a,&b,&c)\n fmt.Printf(\"%c%c%c\",strings.ToUpper(a)[0],strings.ToUpper(b)[0],strings.ToUpper(c)[0])\n}\n\n\n\n\n\nfunc abs32(a int) int {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc abs64(a int64) int64 {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc min32(a, b int) int {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n", "language": "Go", "metadata": {"date": 1562441977, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03737.html", "problem_id": "p03737", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03737/input.txt", "sample_output_relpath": "derived/input_output/data/p03737/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03737/Go/s847480588.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s847480588", "user_id": "u480831358"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n \"strings\"\n)\n\n\n\nfunc main() {\n var a,b,c string\n fmt.Scan(&a,&b,&c)\n fmt.Printf(\"%c%c%c\",strings.ToUpper(a)[0],strings.ToUpper(b)[0],strings.ToUpper(c)[0])\n}\n\n\n\n\n\nfunc abs32(a int) int {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc abs64(a int64) int64 {\n if a<0{\n return -a\n }\n return a\n}\n\nfunc min32(a, b int) int {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd(b, a%b)\n }\n}\n\nfunc lcm(a, b int64) int64 {\n return a / gcd(a, b) * b\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three words s_1, s_2 and s_3, each composed of lowercase English letters, with spaces in between.\nPrint the acronym formed from the uppercased initial letters of the words.\n\nConstraints\n\ns_1, s_2 and s_3 are composed of lowercase English letters.\n\n1 ≤ |s_i| ≤ 10 (1≤i≤3)\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_1 s_2 s_3\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\natcoder beginner contest\n\nSample Output 1\n\nABC\n\nThe initial letters of atcoder, beginner and contest are a, b and c. Uppercase and concatenate them to obtain ABC.\n\nSample Input 2\n\nresident register number\n\nSample Output 2\n\nRRN\n\nSample Input 3\n\nk nearest neighbor\n\nSample Output 3\n\nKNN\n\nSample Input 4\n\nasync layered coding\n\nSample Output 4\n\nALC", "sample_input": "atcoder beginner contest\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03737", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three words s_1, s_2 and s_3, each composed of lowercase English letters, with spaces in between.\nPrint the acronym formed from the uppercased initial letters of the words.\n\nConstraints\n\ns_1, s_2 and s_3 are composed of lowercase English letters.\n\n1 ≤ |s_i| ≤ 10 (1≤i≤3)\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_1 s_2 s_3\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\natcoder beginner contest\n\nSample Output 1\n\nABC\n\nThe initial letters of atcoder, beginner and contest are a, b and c. Uppercase and concatenate them to obtain ABC.\n\nSample Input 2\n\nresident register number\n\nSample Output 2\n\nRRN\n\nSample Input 3\n\nk nearest neighbor\n\nSample Output 3\n\nKNN\n\nSample Input 4\n\nasync layered coding\n\nSample Output 4\n\nALC", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 874, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s119759642", "group_id": "codeNet:p03739", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := getInt()\n\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tas[i] = getInt()\n\t}\n\n\tans1 := solve(as, 1)\n\tans2 := solve(as, 0)\n\n\tfmt.Println(min(ans1, ans2))\n}\n\nfunc solve(as []int, r int) int {\n\tans := 0\n\tsum := 0\n\tfor i, a := range as {\n\t\tif i%2 == r {\n\t\t\tif sum+a <= 0 {\n\t\t\t\tans += abs(sum+a) + 1\n\t\t\t\tsum = 1\n\t\t\t} else {\n\t\t\t\tsum += a\n\t\t\t}\n\t\t} else {\n\t\t\tif sum+a >= 0 {\n\t\t\t\tans += abs(sum+a) + 1\n\t\t\t\tsum = -1\n\t\t\t} else {\n\t\t\t\tsum += a\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\n// -----------------------------------------\n\nvar scanner = wordScanner()\n\nfunc wordScanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc getInt() int {\n\tscanner.Scan()\n\ti, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1562209192, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03739.html", "problem_id": "p03739", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03739/input.txt", "sample_output_relpath": "derived/input_output/data/p03739/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03739/Go/s119759642.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s119759642", "user_id": "u543933043"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := getInt()\n\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tas[i] = getInt()\n\t}\n\n\tans1 := solve(as, 1)\n\tans2 := solve(as, 0)\n\n\tfmt.Println(min(ans1, ans2))\n}\n\nfunc solve(as []int, r int) int {\n\tans := 0\n\tsum := 0\n\tfor i, a := range as {\n\t\tif i%2 == r {\n\t\t\tif sum+a <= 0 {\n\t\t\t\tans += abs(sum+a) + 1\n\t\t\t\tsum = 1\n\t\t\t} else {\n\t\t\t\tsum += a\n\t\t\t}\n\t\t} else {\n\t\t\tif sum+a >= 0 {\n\t\t\t\tans += abs(sum+a) + 1\n\t\t\t\tsum = -1\n\t\t\t} else {\n\t\t\t\tsum += a\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\n// -----------------------------------------\n\nvar scanner = wordScanner()\n\nfunc wordScanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc getInt() int {\n\tscanner.Scan()\n\ti, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint the minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "sample_input": "4\n1 -3 1 0\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03739", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint the minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1108, "cpu_time_ms": 29, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s538870868", "group_id": "codeNet:p03739", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(a []int64, ra int) int64 {\n\ts := int64(0) // S_i = \\sum_i a[i]\n\tans := int64(0)\n\tfor i, e := range a {\n\t\tif i%2 == ra {\n\t\t\tif s+e >= 0 {\n\t\t\t\tans += abs(-1 - s - e)\n\t\t\t\ts = -1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tif s+e <= 0 {\n\t\t\t\tans += abs(1 - s - e)\n\t\t\t\ts = 1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\ts += e\n\t}\n\treturn ans\n}\n\nfunc abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\ta := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\tx, _ := strconv.Atoi(sc.Text())\n\t\ta[i] = int64(x)\n\t}\n\tans := int64(0)\n\tif a[0] == 0 {\n\t\ta[0] = -1\n\t\tans = solve(a, 0)\n\t\ta[0] = 1\n\t\tans = min(ans, solve(a, 1))\n\t} else if a[0] < 0 {\n\t\tans = solve(a, 0)\n\t} else { // a[0] > 0\n\t\tans = solve(a, 1)\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1559840571, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03739.html", "problem_id": "p03739", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03739/input.txt", "sample_output_relpath": "derived/input_output/data/p03739/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03739/Go/s538870868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s538870868", "user_id": "u150861392"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(a []int64, ra int) int64 {\n\ts := int64(0) // S_i = \\sum_i a[i]\n\tans := int64(0)\n\tfor i, e := range a {\n\t\tif i%2 == ra {\n\t\t\tif s+e >= 0 {\n\t\t\t\tans += abs(-1 - s - e)\n\t\t\t\ts = -1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tif s+e <= 0 {\n\t\t\t\tans += abs(1 - s - e)\n\t\t\t\ts = 1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\ts += e\n\t}\n\treturn ans\n}\n\nfunc abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\ta := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\tx, _ := strconv.Atoi(sc.Text())\n\t\ta[i] = int64(x)\n\t}\n\tans := int64(0)\n\tif a[0] == 0 {\n\t\ta[0] = -1\n\t\tans = solve(a, 0)\n\t\ta[0] = 1\n\t\tans = min(ans, solve(a, 1))\n\t} else if a[0] < 0 {\n\t\tans = solve(a, 0)\n\t} else { // a[0] > 0\n\t\tans = solve(a, 1)\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint the minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "sample_input": "4\n1 -3 1 0\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03739", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i.\nIn one operation, you can select a term and either increment or decrement it by one.\n\nAt least how many operations are necessary to satisfy the following conditions?\n\nFor every i (1≤i≤n), the sum of the terms from the 1-st through i-th term is not zero.\n\nFor every i (1≤i≤n-1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term.\n\nConstraints\n\n2 ≤ n ≤ 10^5\n\n|a_i| ≤ 10^9\n\nEach a_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\na_1 a_2 ... a_n\n\nOutput\n\nPrint the minimum necessary count of operations.\n\nSample Input 1\n\n4\n1 -3 1 0\n\nSample Output 1\n\n4\n\nFor example, the given sequence can be transformed into 1, -2, 2, -2 by four operations. The sums of the first one, two, three and four terms are 1, -1, 1 and -1, respectively, which satisfy the conditions.\n\nSample Input 2\n\n5\n3 -6 4 -5 7\n\nSample Output 2\n\n0\n\nThe given sequence already satisfies the conditions.\n\nSample Input 3\n\n6\n-1 4 3 2 -5 4\n\nSample Output 3\n\n8", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 939, "cpu_time_ms": 28, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s837712205", "group_id": "codeNet:p03745", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tslice := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\n\tlength := 1\n\tup := 0\n\tdown := 0\n\n\tfor i := 1; i < len(slice); i++ {\n\t\tif slice[i-1] < slice[i] {\n\t\t\tup = 1\n\t\t} else if slice[i-1] > slice[i] {\n\t\t\tdown = 1\n\t\t} else {\n\t\t\t// i++\n\t\t\tcontinue\n\t\t}\n\n\t\tif up == 1 && down == 1 {\n\t\t\tup = 0\n\t\t\tdown = 0\n\n\t\t\tlength++\n\t\t}\n\n\t}\n\n\tfmt.Println(length)\n\n\t// for i := 0; i < len(slice); i++ {\n\t// \t// tmp := slice[start:len(slice)]\n\t// \t// fmt.Println(slice)\n\n\t// \tfor j := 1; j < len(slice)-1; j++ {\n\t// \t\t// fmt.Printf(\"i=%d, j=%d\\n\", i, j)\n\t// \t\tif j+1 < n && slice[i] <= slice[j] {\n\t// \t\t\tcontinue\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] >= slice[j] {\n\t// \t\t\tlength++\n\t// \t\t\ti += j\n\t// \t\t\tbreak\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] > slice[j] && slice[j] > slice[j+1] {\n\t// \t\t\tcontinue\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] < slice[j] && slice[j] > slice[j+1] {\n\t// \t\t\tlength++\n\t// \t\t\ti += j\n\t// \t\t\tbreak\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] == slice[j] && slice[j] == slice[j+1] {\n\t// \t\t\tcontinue\n\t// \t\t}\n\n\t// \t}\n\t// fmt.Println(length)\n\n\t// }\n\n\t// fmt.Println(length)\n\n}\n", "language": "Go", "metadata": {"date": 1560779178, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03745.html", "problem_id": "p03745", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03745/input.txt", "sample_output_relpath": "derived/input_output/data/p03745/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03745/Go/s837712205.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s837712205", "user_id": "u710190793"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tslice := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\n\tlength := 1\n\tup := 0\n\tdown := 0\n\n\tfor i := 1; i < len(slice); i++ {\n\t\tif slice[i-1] < slice[i] {\n\t\t\tup = 1\n\t\t} else if slice[i-1] > slice[i] {\n\t\t\tdown = 1\n\t\t} else {\n\t\t\t// i++\n\t\t\tcontinue\n\t\t}\n\n\t\tif up == 1 && down == 1 {\n\t\t\tup = 0\n\t\t\tdown = 0\n\n\t\t\tlength++\n\t\t}\n\n\t}\n\n\tfmt.Println(length)\n\n\t// for i := 0; i < len(slice); i++ {\n\t// \t// tmp := slice[start:len(slice)]\n\t// \t// fmt.Println(slice)\n\n\t// \tfor j := 1; j < len(slice)-1; j++ {\n\t// \t\t// fmt.Printf(\"i=%d, j=%d\\n\", i, j)\n\t// \t\tif j+1 < n && slice[i] <= slice[j] {\n\t// \t\t\tcontinue\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] >= slice[j] {\n\t// \t\t\tlength++\n\t// \t\t\ti += j\n\t// \t\t\tbreak\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] > slice[j] && slice[j] > slice[j+1] {\n\t// \t\t\tcontinue\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] < slice[j] && slice[j] > slice[j+1] {\n\t// \t\t\tlength++\n\t// \t\t\ti += j\n\t// \t\t\tbreak\n\t// \t\t}\n\n\t// \t\tif j+1 < n && slice[i] == slice[j] && slice[j] == slice[j+1] {\n\t// \t\t\tcontinue\n\t// \t\t}\n\n\t// \t}\n\t// fmt.Println(length)\n\n\t// }\n\n\t// fmt.Println(length)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an array A of length N.\nYour task is to divide it into several contiguous subarrays.\nHere, all subarrays obtained must be sorted in either non-decreasing or non-increasing order.\nAt least how many subarrays do you need to divide A into?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nEach A_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible number of subarrays after division of A.\n\nSample Input 1\n\n6\n1 2 3 2 2 1\n\nSample Output 1\n\n2\n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\nSample Input 2\n\n9\n1 2 1 2 1 2 1 2 1\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1 2 3 2 1 999999999 1000000000\n\nSample Output 3\n\n3", "sample_input": "6\n1 2 3 2 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03745", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an array A of length N.\nYour task is to divide it into several contiguous subarrays.\nHere, all subarrays obtained must be sorted in either non-decreasing or non-increasing order.\nAt least how many subarrays do you need to divide A into?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nEach A_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible number of subarrays after division of A.\n\nSample Input 1\n\n6\n1 2 3 2 2 1\n\nSample Output 1\n\n2\n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\nSample Input 2\n\n9\n1 2 1 2 1 2 1 2 1\n\nSample Output 2\n\n5\n\nSample Input 3\n\n7\n1 2 3 2 1 999999999 1000000000\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1349, "cpu_time_ms": 27, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s431639230", "group_id": "codeNet:p03759", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif b-a == c-b {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1574791699, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03759.html", "problem_id": "p03759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03759/input.txt", "sample_output_relpath": "derived/input_output/data/p03759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03759/Go/s431639230.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s431639230", "user_id": "u902409225"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif b-a == c-b {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.\nWe will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.\n\nDetermine whether the arrangement of the poles is beautiful.\n\nConstraints\n\n1 \\leq a,b,c \\leq 100\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint YES if the arrangement of the poles is beautiful; print NO otherwise.\n\nSample Input 1\n\n2 4 6\n\nSample Output 1\n\nYES\n\nSince 4-2 = 6-4, this arrangement of poles is beautiful.\n\nSample Input 2\n\n2 5 6\n\nSample Output 2\n\nNO\n\nSince 5-2 \\neq 6-5, this arrangement of poles is not beautiful.\n\nSample Input 3\n\n3 2 1\n\nSample Output 3\n\nYES\n\nSince 1-2 = 2-3, this arrangement of poles is beautiful.", "sample_input": "2 4 6\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03759", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.\nWe will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.\n\nDetermine whether the arrangement of the poles is beautiful.\n\nConstraints\n\n1 \\leq a,b,c \\leq 100\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint YES if the arrangement of the poles is beautiful; print NO otherwise.\n\nSample Input 1\n\n2 4 6\n\nSample Output 1\n\nYES\n\nSince 4-2 = 6-4, this arrangement of poles is beautiful.\n\nSample Input 2\n\n2 5 6\n\nSample Output 2\n\nNO\n\nSince 5-2 \\neq 6-5, this arrangement of poles is not beautiful.\n\nSample Input 3\n\n3 2 1\n\nSample Output 3\n\nYES\n\nSince 1-2 = 2-3, this arrangement of poles is beautiful.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 154, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s475252349", "group_id": "codeNet:p03759", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tif b-a == c-b {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1544669172, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03759.html", "problem_id": "p03759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03759/input.txt", "sample_output_relpath": "derived/input_output/data/p03759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03759/Go/s475252349.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s475252349", "user_id": "u757880666"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tif b-a == c-b {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.\nWe will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.\n\nDetermine whether the arrangement of the poles is beautiful.\n\nConstraints\n\n1 \\leq a,b,c \\leq 100\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint YES if the arrangement of the poles is beautiful; print NO otherwise.\n\nSample Input 1\n\n2 4 6\n\nSample Output 1\n\nYES\n\nSince 4-2 = 6-4, this arrangement of poles is beautiful.\n\nSample Input 2\n\n2 5 6\n\nSample Output 2\n\nNO\n\nSince 5-2 \\neq 6-5, this arrangement of poles is not beautiful.\n\nSample Input 3\n\n3 2 1\n\nSample Output 3\n\nYES\n\nSince 1-2 = 2-3, this arrangement of poles is beautiful.", "sample_input": "2 4 6\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03759", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.\nWe will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.\n\nDetermine whether the arrangement of the poles is beautiful.\n\nConstraints\n\n1 \\leq a,b,c \\leq 100\n\na, b and c are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint YES if the arrangement of the poles is beautiful; print NO otherwise.\n\nSample Input 1\n\n2 4 6\n\nSample Output 1\n\nYES\n\nSince 4-2 = 6-4, this arrangement of poles is beautiful.\n\nSample Input 2\n\n2 5 6\n\nSample Output 2\n\nNO\n\nSince 5-2 \\neq 6-5, this arrangement of poles is not beautiful.\n\nSample Input 3\n\n3 2 1\n\nSample Output 3\n\nYES\n\nSince 1-2 = 2-3, this arrangement of poles is beautiful.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 172, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s057059197", "group_id": "codeNet:p03760", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar o, e string\n\tfmt.Scan(&o, &e)\n\n\tfor i := 0; i < len(o); i++ {\n\t\tif (len(o)-len(e)) == 1 && i == len(o)-1 {\n\t\t\tfmt.Println(string(o[i]))\n\t\t} else {\n\t\t\tfmt.Print(string(o[i]), string(e[i]))\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1591191986, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03760.html", "problem_id": "p03760", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03760/input.txt", "sample_output_relpath": "derived/input_output/data/p03760/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03760/Go/s057059197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s057059197", "user_id": "u346986631"}, "prompt_components": {"gold_output": "xaybzc\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar o, e string\n\tfmt.Scan(&o, &e)\n\n\tfor i := 0; i < len(o); i++ {\n\t\tif (len(o)-len(e)) == 1 && i == len(o)-1 {\n\t\t\tfmt.Println(string(o[i]))\n\t\t} else {\n\t\t\tfmt.Print(string(o[i]), string(e[i]))\n\t\t}\n\t}\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke signed up for a new website which holds programming competitions.\nHe worried that he might forget his password, and he took notes of it.\nSince directly recording his password would cause him trouble if stolen,\nhe took two notes: one contains the characters at the odd-numbered positions, and the other contains the characters at the even-numbered positions.\n\nYou are given two strings O and E. O contains the characters at the odd-numbered positions retaining their relative order, and E contains the characters at the even-numbered positions retaining their relative order.\nRestore the original password.\n\nConstraints\n\nO and E consists of lowercase English letters (a - z).\n\n1 \\leq |O|,|E| \\leq 50\n\n|O| - |E| is either 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nO\nE\n\nOutput\n\nPrint the original password.\n\nSample Input 1\n\nxyz\nabc\n\nSample Output 1\n\nxaybzc\n\nThe original password is xaybzc. Extracting the characters at the odd-numbered positions results in xyz, and extracting the characters at the even-numbered positions results in abc.\n\nSample Input 2\n\natcoderbeginnercontest\natcoderregularcontest\n\nSample Output 2\n\naattccooddeerrbreeggiunlnaerrccoonntteesstt", "sample_input": "xyz\nabc\n"}, "reference_outputs": ["xaybzc\n"], "source_document_id": "p03760", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke signed up for a new website which holds programming competitions.\nHe worried that he might forget his password, and he took notes of it.\nSince directly recording his password would cause him trouble if stolen,\nhe took two notes: one contains the characters at the odd-numbered positions, and the other contains the characters at the even-numbered positions.\n\nYou are given two strings O and E. O contains the characters at the odd-numbered positions retaining their relative order, and E contains the characters at the even-numbered positions retaining their relative order.\nRestore the original password.\n\nConstraints\n\nO and E consists of lowercase English letters (a - z).\n\n1 \\leq |O|,|E| \\leq 50\n\n|O| - |E| is either 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nO\nE\n\nOutput\n\nPrint the original password.\n\nSample Input 1\n\nxyz\nabc\n\nSample Output 1\n\nxaybzc\n\nThe original password is xaybzc. Extracting the characters at the odd-numbered positions results in xyz, and extracting the characters at the even-numbered positions results in abc.\n\nSample Input 2\n\natcoderbeginnercontest\natcoderregularcontest\n\nSample Output 2\n\naattccooddeerrbreeggiunlnaerrccoonntteesstt", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 250, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s745887865", "group_id": "codeNet:p03761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := getInt()\n\tm := [26]int{}\n\tfor j := 0; j < 26; j++ {\n\t\tm[j] = 100\n\t}\n\tfor i := 0; i < n; i++ {\n\t\ts := getString()\n\t\tx := [26]int{}\n\t\tfor _, v := range s {\n\t\t\tx[int(v-'a')]++\n\t\t}\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tm[j] = min(m[j], x[j])\n\t\t}\n\t}\n\n\tfor i := 0; i < 26; i++ {\n\t\tfor j := 0; j < m[i]; j++ {\n\t\t\tfmt.Print(string(i + 'a'))\n\t\t}\n\t}\n\tout()\n}\n", "language": "Go", "metadata": {"date": 1589852186, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03761.html", "problem_id": "p03761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03761/input.txt", "sample_output_relpath": "derived/input_output/data/p03761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03761/Go/s745887865.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s745887865", "user_id": "u814575783"}, "prompt_components": {"gold_output": "aac\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := getInt()\n\tm := [26]int{}\n\tfor j := 0; j < 26; j++ {\n\t\tm[j] = 100\n\t}\n\tfor i := 0; i < n; i++ {\n\t\ts := getString()\n\t\tx := [26]int{}\n\t\tfor _, v := range s {\n\t\t\tx[int(v-'a')]++\n\t\t}\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tm[j] = min(m[j], x[j])\n\t\t}\n\t}\n\n\tfor i := 0; i < 26; i++ {\n\t\tfor j := 0; j < m[i]; j++ {\n\t\t\tfmt.Print(string(i + 'a'))\n\t\t}\n\t}\n\tout()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke loves \"paper cutting\": he cuts out characters from a newspaper headline and rearranges them to form another string.\n\nHe will receive a headline which contains one of the strings S_1,...,S_n tomorrow.\nHe is excited and already thinking of what string he will create.\nSince he does not know the string on the headline yet, he is interested in strings that can be created regardless of which string the headline contains.\n\nFind the longest string that can be created regardless of which string among S_1,...,S_n the headline contains.\nIf there are multiple such strings, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq n \\leq 50\n\n1 \\leq |S_i| \\leq 50 for every i = 1, ..., n.\n\nS_i consists of lowercase English letters (a - z) for every i = 1, ..., n.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nS_1\n...\nS_n\n\nOutput\n\nPrint the lexicographically smallest string among the longest strings that satisfy the condition.\nIf the answer is an empty string, print an empty line.\n\nSample Input 1\n\n3\ncbaa\ndaacc\nacacac\n\nSample Output 1\n\naac\n\nThe strings that can be created from each of cbaa, daacc and acacac, are aa, aac, aca, caa and so forth.\nAmong them, aac, aca and caa are the longest, and the lexicographically smallest of these three is aac.\n\nSample Input 2\n\n3\na\naa\nb\n\nSample Output 2\n\nThe answer is an empty string.", "sample_input": "3\ncbaa\ndaacc\nacacac\n"}, "reference_outputs": ["aac\n"], "source_document_id": "p03761", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke loves \"paper cutting\": he cuts out characters from a newspaper headline and rearranges them to form another string.\n\nHe will receive a headline which contains one of the strings S_1,...,S_n tomorrow.\nHe is excited and already thinking of what string he will create.\nSince he does not know the string on the headline yet, he is interested in strings that can be created regardless of which string the headline contains.\n\nFind the longest string that can be created regardless of which string among S_1,...,S_n the headline contains.\nIf there are multiple such strings, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq n \\leq 50\n\n1 \\leq |S_i| \\leq 50 for every i = 1, ..., n.\n\nS_i consists of lowercase English letters (a - z) for every i = 1, ..., n.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nS_1\n...\nS_n\n\nOutput\n\nPrint the lexicographically smallest string among the longest strings that satisfy the condition.\nIf the answer is an empty string, print an empty line.\n\nSample Input 1\n\n3\ncbaa\ndaacc\nacacac\n\nSample Output 1\n\naac\n\nThe strings that can be created from each of cbaa, daacc and acacac, are aa, aac, aca, caa and so forth.\nAmong them, aac, aca and caa are the longest, and the lexicographically smallest of these three is aac.\n\nSample Input 2\n\n3\na\naa\nb\n\nSample Output 2\n\nThe answer is an empty string.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1258, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s341839278", "group_id": "codeNet:p03761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\ntype sortString []string\n\nfunc (s sortString) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortString) Less(i, j int) bool {\n\treturn len(s[i]) < len(s[j])\n}\n\nfunc (s sortString) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\ntype sortRunes []rune\n\nfunc (s sortRunes) Less(i, j int) bool {\n\treturn s[i] < s[j]\n}\n\nfunc (s sortRunes) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s sortRunes) Len() int {\n\treturn len(s)\n}\n\nfunc SortString(s string) string {\n\tr := []rune(s)\n\tsort.Sort(sortRunes(r))\n\treturn string(r)\n}\n\nfunc main() {\n\tn := readInt()\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = readString()\n\t}\n\n\t// sort.Slice(s, func(i, j int) bool {\n\t// \treturn len(s[i]) < len(s[j])\n\t// })\n\tsort.Sort(sortString(s))\n\n\tfor i := range s {\n\t\ts[i] = SortString(s[i])\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(s[0]); i++ {\n\t\tfor ii := 1; ii < n; ii++ {\n\t\t\tif s[0][i] != s[ii][i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ii == n-1 {\n\t\t\t\tans = ans + string(s[0][i])\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1587087590, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03761.html", "problem_id": "p03761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03761/input.txt", "sample_output_relpath": "derived/input_output/data/p03761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03761/Go/s341839278.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s341839278", "user_id": "u183912232"}, "prompt_components": {"gold_output": "aac\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\ntype sortString []string\n\nfunc (s sortString) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortString) Less(i, j int) bool {\n\treturn len(s[i]) < len(s[j])\n}\n\nfunc (s sortString) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\ntype sortRunes []rune\n\nfunc (s sortRunes) Less(i, j int) bool {\n\treturn s[i] < s[j]\n}\n\nfunc (s sortRunes) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s sortRunes) Len() int {\n\treturn len(s)\n}\n\nfunc SortString(s string) string {\n\tr := []rune(s)\n\tsort.Sort(sortRunes(r))\n\treturn string(r)\n}\n\nfunc main() {\n\tn := readInt()\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = readString()\n\t}\n\n\t// sort.Slice(s, func(i, j int) bool {\n\t// \treturn len(s[i]) < len(s[j])\n\t// })\n\tsort.Sort(sortString(s))\n\n\tfor i := range s {\n\t\ts[i] = SortString(s[i])\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(s[0]); i++ {\n\t\tfor ii := 1; ii < n; ii++ {\n\t\t\tif s[0][i] != s[ii][i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ii == n-1 {\n\t\t\t\tans = ans + string(s[0][i])\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke loves \"paper cutting\": he cuts out characters from a newspaper headline and rearranges them to form another string.\n\nHe will receive a headline which contains one of the strings S_1,...,S_n tomorrow.\nHe is excited and already thinking of what string he will create.\nSince he does not know the string on the headline yet, he is interested in strings that can be created regardless of which string the headline contains.\n\nFind the longest string that can be created regardless of which string among S_1,...,S_n the headline contains.\nIf there are multiple such strings, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq n \\leq 50\n\n1 \\leq |S_i| \\leq 50 for every i = 1, ..., n.\n\nS_i consists of lowercase English letters (a - z) for every i = 1, ..., n.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nS_1\n...\nS_n\n\nOutput\n\nPrint the lexicographically smallest string among the longest strings that satisfy the condition.\nIf the answer is an empty string, print an empty line.\n\nSample Input 1\n\n3\ncbaa\ndaacc\nacacac\n\nSample Output 1\n\naac\n\nThe strings that can be created from each of cbaa, daacc and acacac, are aa, aac, aca, caa and so forth.\nAmong them, aac, aca and caa are the longest, and the lexicographically smallest of these three is aac.\n\nSample Input 2\n\n3\na\naa\nb\n\nSample Output 2\n\nThe answer is an empty string.", "sample_input": "3\ncbaa\ndaacc\nacacac\n"}, "reference_outputs": ["aac\n"], "source_document_id": "p03761", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke loves \"paper cutting\": he cuts out characters from a newspaper headline and rearranges them to form another string.\n\nHe will receive a headline which contains one of the strings S_1,...,S_n tomorrow.\nHe is excited and already thinking of what string he will create.\nSince he does not know the string on the headline yet, he is interested in strings that can be created regardless of which string the headline contains.\n\nFind the longest string that can be created regardless of which string among S_1,...,S_n the headline contains.\nIf there are multiple such strings, find the lexicographically smallest one among them.\n\nConstraints\n\n1 \\leq n \\leq 50\n\n1 \\leq |S_i| \\leq 50 for every i = 1, ..., n.\n\nS_i consists of lowercase English letters (a - z) for every i = 1, ..., n.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nS_1\n...\nS_n\n\nOutput\n\nPrint the lexicographically smallest string among the longest strings that satisfy the condition.\nIf the answer is an empty string, print an empty line.\n\nSample Input 1\n\n3\ncbaa\ndaacc\nacacac\n\nSample Output 1\n\naac\n\nThe strings that can be created from each of cbaa, daacc and acacac, are aa, aac, aca, caa and so forth.\nAmong them, aac, aca and caa are the longest, and the lexicographically smallest of these three is aac.\n\nSample Input 2\n\n3\na\naa\nb\n\nSample Output 2\n\nThe answer is an empty string.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1848, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s822243805", "group_id": "codeNet:p03762", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nconst (\n\tP = 1000000007\n)\n\nfunc calc(x []int) int {\n\tres := 0\n\tn := len(x) - 1\n\tfor i := 1; i <= n; i++ {\n\t\tl := x[i] - x[i-1]\n\t\tres = (res + l*i*(n-(i-1))) % P\n\t}\n\treturn res\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt()\n\tm := readInt()\n\tx := make([]int, n)\n\ty := make([]int, m)\n\tfor i := range x {\n\t\tx[i] = readInt()\n\t}\n\tfor i := range y {\n\t\ty[i] = readInt()\n\t}\n\n\tprintln(calc(x) * calc(y) % P)\n}\n", "language": "Go", "metadata": {"date": 1532665725, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03762.html", "problem_id": "p03762", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03762/input.txt", "sample_output_relpath": "derived/input_output/data/p03762/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03762/Go/s822243805.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s822243805", "user_id": "u705974985"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nconst (\n\tP = 1000000007\n)\n\nfunc calc(x []int) int {\n\tres := 0\n\tn := len(x) - 1\n\tfor i := 1; i <= n; i++ {\n\t\tl := x[i] - x[i-1]\n\t\tres = (res + l*i*(n-(i-1))) % P\n\t}\n\treturn res\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt()\n\tm := readInt()\n\tx := make([]int, n)\n\ty := make([]int, m)\n\tfor i := range x {\n\t\tx[i] = readInt()\n\t}\n\tfor i := range y {\n\t\ty[i] = readInt()\n\t}\n\n\tprintln(calc(x) * calc(y) % P)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nOn a two-dimensional plane, there are m lines drawn parallel to the x axis, and n lines drawn parallel to the y axis.\nAmong the lines parallel to the x axis, the i-th from the bottom is represented by y = y_i.\nSimilarly, among the lines parallel to the y axis, the i-th from the left is represented by x = x_i.\n\nFor every rectangle that is formed by these lines, find its area, and print the total area modulo 10^9+7.\n\nThat is, for every quadruple (i,j,k,l) satisfying 1\\leq i < j\\leq n and 1\\leq k < l\\leq m, find the area of the rectangle formed by the lines x=x_i, x=x_j, y=y_k and y=y_l, and print the sum of these areas modulo 10^9+7.\n\nConstraints\n\n2 \\leq n,m \\leq 10^5\n\n-10^9 \\leq x_1 < ... < x_n \\leq 10^9\n\n-10^9 \\leq y_1 < ... < y_m \\leq 10^9\n\nx_i and y_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m\nx_1 x_2 ... x_n\ny_1 y_2 ... y_m\n\nOutput\n\nPrint the total area of the rectangles, modulo 10^9+7.\n\nSample Input 1\n\n3 3\n1 3 4\n1 3 6\n\nSample Output 1\n\n60\n\nThe following figure illustrates this input:\n\nThe total area of the nine rectangles A, B, ..., I shown in the following figure, is 60.\n\nSample Input 2\n\n6 5\n-790013317 -192321079 95834122 418379342 586260100 802780784\n-253230108 193944314 363756450 712662868 735867677\n\nSample Output 2\n\n835067060", "sample_input": "3 3\n1 3 4\n1 3 6\n"}, "reference_outputs": ["60\n"], "source_document_id": "p03762", "source_text": "Score : 500 points\n\nProblem Statement\n\nOn a two-dimensional plane, there are m lines drawn parallel to the x axis, and n lines drawn parallel to the y axis.\nAmong the lines parallel to the x axis, the i-th from the bottom is represented by y = y_i.\nSimilarly, among the lines parallel to the y axis, the i-th from the left is represented by x = x_i.\n\nFor every rectangle that is formed by these lines, find its area, and print the total area modulo 10^9+7.\n\nThat is, for every quadruple (i,j,k,l) satisfying 1\\leq i < j\\leq n and 1\\leq k < l\\leq m, find the area of the rectangle formed by the lines x=x_i, x=x_j, y=y_k and y=y_l, and print the sum of these areas modulo 10^9+7.\n\nConstraints\n\n2 \\leq n,m \\leq 10^5\n\n-10^9 \\leq x_1 < ... < x_n \\leq 10^9\n\n-10^9 \\leq y_1 < ... < y_m \\leq 10^9\n\nx_i and y_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m\nx_1 x_2 ... x_n\ny_1 y_2 ... y_m\n\nOutput\n\nPrint the total area of the rectangles, modulo 10^9+7.\n\nSample Input 1\n\n3 3\n1 3 4\n1 3 6\n\nSample Output 1\n\n60\n\nThe following figure illustrates this input:\n\nThe total area of the nine rectangles A, B, ..., I shown in the following figure, is 60.\n\nSample Input 2\n\n6 5\n-790013317 -192321079 95834122 418379342 586260100 802780784\n-253230108 193944314 363756450 712662868 735867677\n\nSample Output 2\n\n835067060", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2233, "cpu_time_ms": 57, "memory_kb": 4736}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s741383801", "group_id": "codeNet:p03767", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\n\tpowers := make([]int, 3*n)\n\n\tfor i := 0; i < 3*n; i++ {\n\t\tpower, _ := strconv.Atoi(sc.Text())\n\t\tpowers[i] = power\n\t}\n\n\tsort.Ints(powers)\n\tpowers = powers[n:]\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += powers[2*i]\n\t}\n\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1589528226, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03767.html", "problem_id": "p03767", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03767/input.txt", "sample_output_relpath": "derived/input_output/data/p03767/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03767/Go/s741383801.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s741383801", "user_id": "u217826227"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\n\tpowers := make([]int, 3*n)\n\n\tfor i := 0; i < 3*n; i++ {\n\t\tpower, _ := strconv.Atoi(sc.Text())\n\t\tpowers[i] = power\n\t}\n\n\tsort.Ints(powers)\n\tpowers = powers[n:]\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += powers[2*i]\n\t}\n\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are 3N participants in AtCoder Group Contest.\nThe strength of the i-th participant is represented by an integer a_i.\nThey will form N teams, each consisting of three participants.\nNo participant may belong to multiple teams.\n\nThe strength of a team is defined as the second largest strength among its members.\nFor example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3.\n\nFind the maximum possible sum of the strengths of N teams.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ 10^{9}\n\na_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{3N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2\n5 2 8 5 1 5\n\nSample Output 1\n\n10\n\nThe following is one formation of teams that maximizes the sum of the strengths of teams:\n\nTeam 1: consists of the first, fourth and fifth participants.\n\nTeam 2: consists of the second, third and sixth participants.\n\nSample Input 2\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 2\n\n10000000000\n\nThe sum of the strengths can be quite large.", "sample_input": "2\n5 2 8 5 1 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are 3N participants in AtCoder Group Contest.\nThe strength of the i-th participant is represented by an integer a_i.\nThey will form N teams, each consisting of three participants.\nNo participant may belong to multiple teams.\n\nThe strength of a team is defined as the second largest strength among its members.\nFor example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3.\n\nFind the maximum possible sum of the strengths of N teams.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ 10^{9}\n\na_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_{3N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2\n5 2 8 5 1 5\n\nSample Output 1\n\n10\n\nThe following is one formation of teams that maximizes the sum of the strengths of teams:\n\nTeam 1: consists of the first, fourth and fifth participants.\n\nTeam 2: consists of the second, third and sixth participants.\n\nSample Input 2\n\n10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 2\n\n10000000000\n\nThe sum of the strengths can be quite large.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 383, "cpu_time_ms": 41, "memory_kb": 5376}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s948827221", "group_id": "codeNet:p03774", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextIntSlice(size int) []int {\n\tre := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tre[i] = nextInt()\n\t}\n\treturn re\n}\n\nfunc max(a []int) int {\n\tmax := a[0]\n\tfor _, v := range a {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a []int) int {\n\tmin := a[0]\n\tfor _, v := range a {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := nextInt(), nextInt()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tc := make([]int, m)\n\td := make([]int, m)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i] = nextInt(), nextInt()\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tc[i], d[i] = nextInt(), nextInt()\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tminj := 0\n\t\tmindist := abs(a[i]-c[0]) + abs(b[i]-d[0])\n\t\tfor j := 1; j < m; j++ {\n\t\t\ttempdist := abs(a[i]-c[j]) + abs(b[i]-d[j])\n\t\t\tif tempdist < mindist {\n\t\t\t\tminj = j\n\t\t\t\tmindist = tempdist\n\t\t\t}\n\t\t}\n\t\tfmt.Println(minj + 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1556297355, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03774.html", "problem_id": "p03774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03774/input.txt", "sample_output_relpath": "derived/input_output/data/p03774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03774/Go/s948827221.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s948827221", "user_id": "u102310764"}, "prompt_components": {"gold_output": "2\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextIntSlice(size int) []int {\n\tre := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tre[i] = nextInt()\n\t}\n\treturn re\n}\n\nfunc max(a []int) int {\n\tmax := a[0]\n\tfor _, v := range a {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a []int) int {\n\tmin := a[0]\n\tfor _, v := range a {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := nextInt(), nextInt()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tc := make([]int, m)\n\td := make([]int, m)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i] = nextInt(), nextInt()\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tc[i], d[i] = nextInt(), nextInt()\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tminj := 0\n\t\tmindist := abs(a[i]-c[0]) + abs(b[i]-d[0])\n\t\tfor j := 1; j < m; j++ {\n\t\t\ttempdist := abs(a[i]-c[j]) + abs(b[i]-d[j])\n\t\t\tif tempdist < mindist {\n\t\t\t\tminj = j\n\t\t\t\tmindist = tempdist\n\t\t\t}\n\t\t}\n\t\tfmt.Println(minj + 1)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N students and M checkpoints on the xy-plane.\n\nThe coordinates of the i-th student (1 \\leq i \\leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \\leq j \\leq M) is (c_j,d_j).\n\nWhen the teacher gives a signal, each student has to go to the nearest checkpoint measured in Manhattan distance.\n\nThe Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.\n\nHere, |x| denotes the absolute value of x.\n\nIf there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.\n\nWhich checkpoint will each student go to?\n\nConstraints\n\n1 \\leq N,M \\leq 50\n\n-10^8 \\leq a_i,b_i,c_j,d_j \\leq 10^8\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_N b_N\nc_1 d_1\n:\nc_M d_M\n\nOutput\n\nPrint N lines.\n\nThe i-th line (1 \\leq i \\leq N) should contain the index of the checkpoint for the i-th student to go.\n\nSample Input 1\n\n2 2\n2 0\n0 0\n-1 0\n1 0\n\nSample Output 1\n\n2\n1\n\nThe Manhattan distance between the first student and each checkpoint is:\n\nFor checkpoint 1: |2-(-1)|+|0-0|=3\n\nFor checkpoint 2: |2-1|+|0-0|=1\n\nThe nearest checkpoint is checkpoint 2. Thus, the first line in the output should contain 2.\n\nThe Manhattan distance between the second student and each checkpoint is:\n\nFor checkpoint 1: |0-(-1)|+|0-0|=1\n\nFor checkpoint 2: |0-1|+|0-0|=1\n\nWhen there are multiple nearest checkpoints, the student will go to the checkpoint with the smallest index. Thus, the second line in the output should contain 1.\n\nSample Input 2\n\n3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5\n\nSample Output 2\n\n3\n1\n2\n\nThere can be multiple checkpoints at the same coordinates.\n\nSample Input 3\n\n5 5\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100000000\n0 0\n0 0\n100000000 100000000\n100000000 -100000000\n-100000000 100000000\n-100000000 -100000000\n\nSample Output 3\n\n5\n4\n3\n2\n1", "sample_input": "2 2\n2 0\n0 0\n-1 0\n1 0\n"}, "reference_outputs": ["2\n1\n"], "source_document_id": "p03774", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N students and M checkpoints on the xy-plane.\n\nThe coordinates of the i-th student (1 \\leq i \\leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \\leq j \\leq M) is (c_j,d_j).\n\nWhen the teacher gives a signal, each student has to go to the nearest checkpoint measured in Manhattan distance.\n\nThe Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.\n\nHere, |x| denotes the absolute value of x.\n\nIf there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.\n\nWhich checkpoint will each student go to?\n\nConstraints\n\n1 \\leq N,M \\leq 50\n\n-10^8 \\leq a_i,b_i,c_j,d_j \\leq 10^8\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\na_1 b_1\n:\na_N b_N\nc_1 d_1\n:\nc_M d_M\n\nOutput\n\nPrint N lines.\n\nThe i-th line (1 \\leq i \\leq N) should contain the index of the checkpoint for the i-th student to go.\n\nSample Input 1\n\n2 2\n2 0\n0 0\n-1 0\n1 0\n\nSample Output 1\n\n2\n1\n\nThe Manhattan distance between the first student and each checkpoint is:\n\nFor checkpoint 1: |2-(-1)|+|0-0|=3\n\nFor checkpoint 2: |2-1|+|0-0|=1\n\nThe nearest checkpoint is checkpoint 2. Thus, the first line in the output should contain 2.\n\nThe Manhattan distance between the second student and each checkpoint is:\n\nFor checkpoint 1: |0-(-1)|+|0-0|=1\n\nFor checkpoint 2: |0-1|+|0-0|=1\n\nWhen there are multiple nearest checkpoints, the student will go to the checkpoint with the smallest index. Thus, the second line in the output should contain 1.\n\nSample Input 2\n\n3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5\n\nSample Output 2\n\n3\n1\n2\n\nThere can be multiple checkpoints at the same coordinates.\n\nSample Input 3\n\n5 5\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100000000\n0 0\n0 0\n100000000 100000000\n100000000 -100000000\n-100000000 100000000\n-100000000 -100000000\n\nSample Output 3\n\n5\n4\n3\n2\n1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1180, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s555294827", "group_id": "codeNet:p03775", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) Scan() (ok bool) {\n\tok = me.baseScanner.Scan()\n\treturn\n}\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan()\n\tn := r.getInt()\n\tfac := fact(n)\n\n\tfacs := func(src []*factType) (dst []int) {\n\t\tdst = make([]int, 0, len(src))\n\t\tfor _, value := range src {\n\t\t\tfor i := 0; i < value.count; i++ {\n\t\t\t\tdst = append(dst, value.prime)\n\t\t\t}\n\t\t}\n\t\treturn\n\t}(fac)\n\n\tmaxF64 := func(a float64, vs ...float64) float64 {\n\t\tfor _, v := range vs {\n\t\t\tif a < v {\n\t\t\t\ta = v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tminI := func(a int, vs ...int) int {\n\t\tfor _, v := range vs {\n\t\t\tif a > v {\n\t\t\t\ta = v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tvar f func(a int, b int, i int) int\n\tf = func(a int, b int, i int) int {\n\t\tif i < 0 {\n\t\t\treturn int(math.Floor(maxF64(math.Log10(float64(a)), math.Log10(float64(b))))) + 1\n\t\t}\n\n\t\treturn minI(f(a*facs[i], b, i-1), f(a, b*facs[i], i-1))\n\n\t}\n\n\tfmt.Fprintln(stdout, f(1, 1, len(facs)-1))\n\n}\n", "language": "Go", "metadata": {"date": 1566006496, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03775.html", "problem_id": "p03775", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03775/input.txt", "sample_output_relpath": "derived/input_output/data/p03775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03775/Go/s555294827.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s555294827", "user_id": "u463655976"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) Scan() (ok bool) {\n\tok = me.baseScanner.Scan()\n\treturn\n}\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan()\n\tn := r.getInt()\n\tfac := fact(n)\n\n\tfacs := func(src []*factType) (dst []int) {\n\t\tdst = make([]int, 0, len(src))\n\t\tfor _, value := range src {\n\t\t\tfor i := 0; i < value.count; i++ {\n\t\t\t\tdst = append(dst, value.prime)\n\t\t\t}\n\t\t}\n\t\treturn\n\t}(fac)\n\n\tmaxF64 := func(a float64, vs ...float64) float64 {\n\t\tfor _, v := range vs {\n\t\t\tif a < v {\n\t\t\t\ta = v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tminI := func(a int, vs ...int) int {\n\t\tfor _, v := range vs {\n\t\t\tif a > v {\n\t\t\t\ta = v\n\t\t\t}\n\t\t}\n\t\treturn a\n\t}\n\n\tvar f func(a int, b int, i int) int\n\tf = func(a int, b int, i int) int {\n\t\tif i < 0 {\n\t\t\treturn int(math.Floor(maxF64(math.Log10(float64(a)), math.Log10(float64(b))))) + 1\n\t\t}\n\n\t\treturn minI(f(a*facs[i], b, i-1), f(a, b*facs[i], i-1))\n\n\t}\n\n\tfmt.Fprintln(stdout, f(1, 1, len(facs)-1))\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "sample_input": "10000\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03775", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3569, "cpu_time_ms": 156, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s524137749", "group_id": "codeNet:p03775", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := getInt()\n\n\tuntil := int(math.Ceil(math.Sqrt(float64(n))))\n\tans := 10\n\tfor i := 1; i <= until; i++ {\n\t\tif n%i == 0 {\n\t\t\t// ans = min(ans, f(n/i, i))\n\t\t\tans = min(ans, len(strconv.Itoa(n/i)))\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// func f(a, b int) int {\n// \tmaxLen := max(len(strconv.Itoa(a)), len(strconv.Itoa(b)))\n// \treturn maxLen\n// }\n\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif max < ns[i] {\n\t\t\tmax = ns[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\n// -----------------------------------------\n\nvar scanner = wordScanner()\n\nfunc wordScanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc getInt() int {\n\tscanner.Scan()\n\ti, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1562450536, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03775.html", "problem_id": "p03775", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03775/input.txt", "sample_output_relpath": "derived/input_output/data/p03775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03775/Go/s524137749.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s524137749", "user_id": "u543933043"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := getInt()\n\n\tuntil := int(math.Ceil(math.Sqrt(float64(n))))\n\tans := 10\n\tfor i := 1; i <= until; i++ {\n\t\tif n%i == 0 {\n\t\t\t// ans = min(ans, f(n/i, i))\n\t\t\tans = min(ans, len(strconv.Itoa(n/i)))\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// func f(a, b int) int {\n// \tmaxLen := max(len(strconv.Itoa(a)), len(strconv.Itoa(b)))\n// \treturn maxLen\n// }\n\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif max < ns[i] {\n\t\t\tmax = ns[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\n// -----------------------------------------\n\nvar scanner = wordScanner()\n\nfunc wordScanner() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc getInt() int {\n\tscanner.Scan()\n\ti, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "sample_input": "10000\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03775", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.\n\nFor example, F(3,11) = 2 since 3 has one digit and 11 has two digits.\n\nFind the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nConstraints\n\n1 \\leq N \\leq 10^{10}\n\nN is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \\times B.\n\nSample Input 1\n\n10000\n\nSample Output 1\n\n3\n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\nSample Input 2\n\n1000003\n\nSample Output 2\n\n7\n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\nSample Input 3\n\n9876543210\n\nSample Output 3\n\n6", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1057, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s127086410", "group_id": "codeNet:p03779", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := getInt()\n\n\tans := int(math.Ceil(-1.0+math.Sqrt(1+8*float64(N))) / 2)\n\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1581206200, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03779.html", "problem_id": "p03779", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03779/input.txt", "sample_output_relpath": "derived/input_output/data/p03779/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03779/Go/s127086410.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s127086410", "user_id": "u814575783"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := getInt()\n\n\tans := int(math.Ceil(-1.0+math.Sqrt(1+8*float64(N))) / 2)\n\n\tout(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0.\nDuring the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.\nThat is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i.\nThe kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible.\nFind the earliest possible time to reach coordinate X.\n\nConstraints\n\nX is an integer.\n\n1≤X≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the earliest possible time for the kangaroo to reach coordinate X.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThe kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nHe can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.\n\nSample Input 3\n\n11\n\nSample Output 3\n\n5", "sample_input": "6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03779", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0.\nDuring the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.\nThat is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i.\nThe kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible.\nFind the earliest possible time to reach coordinate X.\n\nConstraints\n\nX is an integer.\n\n1≤X≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the earliest possible time for the kangaroo to reach coordinate X.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThe kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nHe can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.\n\nSample Input 3\n\n11\n\nSample Output 3\n\n5", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 449, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s814749344", "group_id": "codeNet:p03780", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tk := getNextInt64(scanner)\n\taa := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt64(scanner)\n\t}\n\n\tans := 0\n\timml := IntMapMap{}\n\timmr := IntMapMap{}\n\timml.increment(-1, 0)\n\timmr.increment(n, 0)\n\tfor i := 0; i < n; i++ {\n\t\tif aa[i] < k {\n\t\t\timml.increment(i, aa[i])\n\t\t}\n\t\tfor a := range imml[i-1] {\n\t\t\timml.increment(i, a)\n\t\t\tif a+aa[i] < k {\n\t\t\t\timml.increment(i, a+aa[i])\n\t\t\t}\n\t\t}\n\t\tif aa[n-i-1] < k {\n\t\t\timmr.increment(n-i-1, aa[n-i-1])\n\t\t}\n\t\tfor a := range immr[n-i] {\n\t\t\timmr.increment(n-i-1, a)\n\t\t\tif a+aa[n-i-1] < k {\n\t\t\t\timmr.increment(n-i-1, a+aa[n-i-1])\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif needed(i, n, k, aa, imml, immr) == false {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc needed(i, n int, k int64, aa []int64, imml, immr IntMapMap) bool {\n\tvar sl, sr [5001]int\n\tvar l int64\n\n\tfor a := range imml[i-1] {\n\t\tsl[a]++\n\t}\n\tfor a := range immr[i+1] {\n\t\tsr[a]++\n\t}\n\tfor ii := 1; ii < 5001; ii++ {\n\t\tsr[ii] += sr[ii-1]\n\t}\n\n\t// (l+r) < k && (l+r)+aa[i] >= k\n\n\tfor l = 0; l < k; l++ {\n\t\tif sl[l] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif l+aa[i] >= k {\n\t\t\treturn true\n\t\t}\n\t\tminr := k - l - aa[i] - 1\n\t\tmaxr := k - l - 1\n\t\tif minr < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif maxr < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif (sr[maxr] - sr[minr]) > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// IntMap ...\ntype IntMap map[int64]int\n\nfunc (m IntMap) get(key int64) int {\n\tif _, ok := m[key]; ok {\n\t\treturn m[key]\n\t}\n\treturn 0\n}\n\nfunc (m IntMap) set(key int64, n int) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key] = n\n}\n\nfunc (m IntMap) increment(key int64) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key]++\n}\n\n// IntMapMap ...\ntype IntMapMap map[int]IntMap\n\nfunc (m IntMapMap) get(key1 int, key2 int64) int {\n\tif _, ok := m[key1][key2]; ok {\n\t\treturn m[key1][key2]\n\t}\n\treturn 0\n}\n\nfunc (m IntMapMap) set(key1 int, key2 int64, n int) {\n\tif _, ok := m[key1]; ok == false {\n\t\tm[key1] = make(IntMap, 0)\n\t}\n\tm[key1].set(key2, n)\n}\n\nfunc (m IntMapMap) increment(key1 int, key2 int64) {\n\tif _, ok := m[key1]; ok == false {\n\t\tm[key1] = make(IntMap, 0)\n\t}\n\tm[key1].increment(key2)\n}\n", "language": "Go", "metadata": {"date": 1564607022, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03780.html", "problem_id": "p03780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03780/input.txt", "sample_output_relpath": "derived/input_output/data/p03780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03780/Go/s814749344.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s814749344", "user_id": "u150542210"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tk := getNextInt64(scanner)\n\taa := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt64(scanner)\n\t}\n\n\tans := 0\n\timml := IntMapMap{}\n\timmr := IntMapMap{}\n\timml.increment(-1, 0)\n\timmr.increment(n, 0)\n\tfor i := 0; i < n; i++ {\n\t\tif aa[i] < k {\n\t\t\timml.increment(i, aa[i])\n\t\t}\n\t\tfor a := range imml[i-1] {\n\t\t\timml.increment(i, a)\n\t\t\tif a+aa[i] < k {\n\t\t\t\timml.increment(i, a+aa[i])\n\t\t\t}\n\t\t}\n\t\tif aa[n-i-1] < k {\n\t\t\timmr.increment(n-i-1, aa[n-i-1])\n\t\t}\n\t\tfor a := range immr[n-i] {\n\t\t\timmr.increment(n-i-1, a)\n\t\t\tif a+aa[n-i-1] < k {\n\t\t\t\timmr.increment(n-i-1, a+aa[n-i-1])\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif needed(i, n, k, aa, imml, immr) == false {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc needed(i, n int, k int64, aa []int64, imml, immr IntMapMap) bool {\n\tvar sl, sr [5001]int\n\tvar l int64\n\n\tfor a := range imml[i-1] {\n\t\tsl[a]++\n\t}\n\tfor a := range immr[i+1] {\n\t\tsr[a]++\n\t}\n\tfor ii := 1; ii < 5001; ii++ {\n\t\tsr[ii] += sr[ii-1]\n\t}\n\n\t// (l+r) < k && (l+r)+aa[i] >= k\n\n\tfor l = 0; l < k; l++ {\n\t\tif sl[l] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif l+aa[i] >= k {\n\t\t\treturn true\n\t\t}\n\t\tminr := k - l - aa[i] - 1\n\t\tmaxr := k - l - 1\n\t\tif minr < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif maxr < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif (sr[maxr] - sr[minr]) > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// IntMap ...\ntype IntMap map[int64]int\n\nfunc (m IntMap) get(key int64) int {\n\tif _, ok := m[key]; ok {\n\t\treturn m[key]\n\t}\n\treturn 0\n}\n\nfunc (m IntMap) set(key int64, n int) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key] = n\n}\n\nfunc (m IntMap) increment(key int64) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key]++\n}\n\n// IntMapMap ...\ntype IntMapMap map[int]IntMap\n\nfunc (m IntMapMap) get(key1 int, key2 int64) int {\n\tif _, ok := m[key1][key2]; ok {\n\t\treturn m[key1][key2]\n\t}\n\treturn 0\n}\n\nfunc (m IntMapMap) set(key1 int, key2 int64, n int) {\n\tif _, ok := m[key1]; ok == false {\n\t\tm[key1] = make(IntMap, 0)\n\t}\n\tm[key1].set(key2, n)\n}\n\nfunc (m IntMapMap) increment(key1 int, key2 int64) {\n\tif _, ok := m[key1]; ok == false {\n\t\tm[key1] = make(IntMap, 0)\n\t}\n\tm[key1].increment(key2)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nAtCoDeer the deer has N cards with positive integers written on them. The number on the i-th card (1≤i≤N) is a_i.\nBecause he loves big numbers, he calls a subset of the cards good when the sum of the numbers written on the cards in the subset, is K or greater.\n\nThen, for each card i, he judges whether it is unnecessary or not, as follows:\n\nIf, for any good subset of the cards containing card i, the set that can be obtained by eliminating card i from the subset is also good, card i is unnecessary.\n\nOtherwise, card i is NOT unnecessary.\n\nFind the number of the unnecessary cards. Here, he judges each card independently, and he does not throw away cards that turn out to be unnecessary.\n\nConstraints\n\nAll input values are integers.\n\n1≤N≤5000\n\n1≤K≤5000\n\n1≤a_i≤10^9 (1≤i≤N)\n\nPartial Score\n\n300 points will be awarded for passing the test set satisfying N,K≤400.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of the unnecessary cards.\n\nSample Input 1\n\n3 6\n1 4 3\n\nSample Output 1\n\n1\n\nThere are two good sets: {2,3} and {1,2,3}.\n\nCard 1 is only contained in {1,2,3}, and this set without card 1, {2,3}, is also good. Thus, card 1 is unnecessary.\n\nFor card 2, a good set {2,3} without card 2, {3}, is not good. Thus, card 2 is NOT unnecessary.\n\nNeither is card 3 for a similar reason, hence the answer is 1.\n\nSample Input 2\n\n5 400\n3 1 4 1 5\n\nSample Output 2\n\n5\n\nIn this case, there is no good set. Therefore, all the cards are unnecessary.\n\nSample Input 3\n\n6 20\n10 4 3 10 25 2\n\nSample Output 3\n\n3", "sample_input": "3 6\n1 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03780", "source_text": "Score : 600 points\n\nProblem Statement\n\nAtCoDeer the deer has N cards with positive integers written on them. The number on the i-th card (1≤i≤N) is a_i.\nBecause he loves big numbers, he calls a subset of the cards good when the sum of the numbers written on the cards in the subset, is K or greater.\n\nThen, for each card i, he judges whether it is unnecessary or not, as follows:\n\nIf, for any good subset of the cards containing card i, the set that can be obtained by eliminating card i from the subset is also good, card i is unnecessary.\n\nOtherwise, card i is NOT unnecessary.\n\nFind the number of the unnecessary cards. Here, he judges each card independently, and he does not throw away cards that turn out to be unnecessary.\n\nConstraints\n\nAll input values are integers.\n\n1≤N≤5000\n\n1≤K≤5000\n\n1≤a_i≤10^9 (1≤i≤N)\n\nPartial Score\n\n300 points will be awarded for passing the test set satisfying N,K≤400.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of the unnecessary cards.\n\nSample Input 1\n\n3 6\n1 4 3\n\nSample Output 1\n\n1\n\nThere are two good sets: {2,3} and {1,2,3}.\n\nCard 1 is only contained in {1,2,3}, and this set without card 1, {2,3}, is also good. Thus, card 1 is unnecessary.\n\nFor card 2, a good set {2,3} without card 2, {3}, is not good. Thus, card 2 is NOT unnecessary.\n\nNeither is card 3 for a similar reason, hence the answer is 1.\n\nSample Input 2\n\n5 400\n3 1 4 1 5\n\nSample Output 2\n\n5\n\nIn this case, there is no good set. Therefore, all the cards are unnecessary.\n\nSample Input 3\n\n6 20\n10 4 3 10 25 2\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2837, "cpu_time_ms": 2126, "memory_kb": 308864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s943933582", "group_id": "codeNet:p03780", "input_text": "package main\nimport (\n \"fmt\"\n \"os\"\n \"sort\"\n)\nfunc main() {\n var n,k,s int\n fmt.Scan(&n,&k)\n var a []int = make([]int,n)\n for i:=0;i 1 {\n mid = (btm+top)/2\n if a[mid] >= k {\n top = mid\n continue\n }\n dp := make(map[int]struct{})\n dp[0] = struct{}{}\n for i:=0;i= k-a[mid] {\n top = mid\n break\n }\n }\n btm = mid\n }\n fmt.Println(btm)\n}", "language": "Go", "metadata": {"date": 1556903415, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03780.html", "problem_id": "p03780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03780/input.txt", "sample_output_relpath": "derived/input_output/data/p03780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03780/Go/s943933582.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s943933582", "user_id": "u506403362"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"os\"\n \"sort\"\n)\nfunc main() {\n var n,k,s int\n fmt.Scan(&n,&k)\n var a []int = make([]int,n)\n for i:=0;i 1 {\n mid = (btm+top)/2\n if a[mid] >= k {\n top = mid\n continue\n }\n dp := make(map[int]struct{})\n dp[0] = struct{}{}\n for i:=0;i= k-a[mid] {\n top = mid\n break\n }\n }\n btm = mid\n }\n fmt.Println(btm)\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nAtCoDeer the deer has N cards with positive integers written on them. The number on the i-th card (1≤i≤N) is a_i.\nBecause he loves big numbers, he calls a subset of the cards good when the sum of the numbers written on the cards in the subset, is K or greater.\n\nThen, for each card i, he judges whether it is unnecessary or not, as follows:\n\nIf, for any good subset of the cards containing card i, the set that can be obtained by eliminating card i from the subset is also good, card i is unnecessary.\n\nOtherwise, card i is NOT unnecessary.\n\nFind the number of the unnecessary cards. Here, he judges each card independently, and he does not throw away cards that turn out to be unnecessary.\n\nConstraints\n\nAll input values are integers.\n\n1≤N≤5000\n\n1≤K≤5000\n\n1≤a_i≤10^9 (1≤i≤N)\n\nPartial Score\n\n300 points will be awarded for passing the test set satisfying N,K≤400.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of the unnecessary cards.\n\nSample Input 1\n\n3 6\n1 4 3\n\nSample Output 1\n\n1\n\nThere are two good sets: {2,3} and {1,2,3}.\n\nCard 1 is only contained in {1,2,3}, and this set without card 1, {2,3}, is also good. Thus, card 1 is unnecessary.\n\nFor card 2, a good set {2,3} without card 2, {3}, is not good. Thus, card 2 is NOT unnecessary.\n\nNeither is card 3 for a similar reason, hence the answer is 1.\n\nSample Input 2\n\n5 400\n3 1 4 1 5\n\nSample Output 2\n\n5\n\nIn this case, there is no good set. Therefore, all the cards are unnecessary.\n\nSample Input 3\n\n6 20\n10 4 3 10 25 2\n\nSample Output 3\n\n3", "sample_input": "3 6\n1 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03780", "source_text": "Score : 600 points\n\nProblem Statement\n\nAtCoDeer the deer has N cards with positive integers written on them. The number on the i-th card (1≤i≤N) is a_i.\nBecause he loves big numbers, he calls a subset of the cards good when the sum of the numbers written on the cards in the subset, is K or greater.\n\nThen, for each card i, he judges whether it is unnecessary or not, as follows:\n\nIf, for any good subset of the cards containing card i, the set that can be obtained by eliminating card i from the subset is also good, card i is unnecessary.\n\nOtherwise, card i is NOT unnecessary.\n\nFind the number of the unnecessary cards. Here, he judges each card independently, and he does not throw away cards that turn out to be unnecessary.\n\nConstraints\n\nAll input values are integers.\n\n1≤N≤5000\n\n1≤K≤5000\n\n1≤a_i≤10^9 (1≤i≤N)\n\nPartial Score\n\n300 points will be awarded for passing the test set satisfying N,K≤400.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of the unnecessary cards.\n\nSample Input 1\n\n3 6\n1 4 3\n\nSample Output 1\n\n1\n\nThere are two good sets: {2,3} and {1,2,3}.\n\nCard 1 is only contained in {1,2,3}, and this set without card 1, {2,3}, is also good. Thus, card 1 is unnecessary.\n\nFor card 2, a good set {2,3} without card 2, {3}, is not good. Thus, card 2 is NOT unnecessary.\n\nNeither is card 3 for a similar reason, hence the answer is 1.\n\nSample Input 2\n\n5 400\n3 1 4 1 5\n\nSample Output 2\n\n5\n\nIn this case, there is no good set. Therefore, all the cards are unnecessary.\n\nSample Input 3\n\n6 20\n10 4 3 10 25 2\n\nSample Output 3\n\n3", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 880, "cpu_time_ms": 2107, "memory_kb": 7680}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s208665701", "group_id": "codeNet:p03797", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt64() // S\n\tm := readInt64() // c\n\n\tif m <= 2*n {\n\t\tprintln(m / 2)\n\t\treturn\n\t}\n\tans := n\n\tl := m - 2*n\n\tans += l / 4\n\tprintln(ans)\n}\n", "language": "Go", "metadata": {"date": 1531447868, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03797.html", "problem_id": "p03797", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03797/input.txt", "sample_output_relpath": "derived/input_output/data/p03797/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03797/Go/s208665701.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s208665701", "user_id": "u705974985"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() []int {\n\tn := readInt()\n\treturn readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt64() // S\n\tm := readInt64() // c\n\n\tif m <= 2*n {\n\t\tprintln(m / 2)\n\t\treturn\n\t}\n\tans := n\n\tl := m - 2*n\n\tans += l / 4\n\tprintln(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "sample_input": "1 6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03797", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2006, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s896199480", "group_id": "codeNet:p03798", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tN := nextInt()\n\ts := nextString()\n\n\ts += string(s[0])\n\tstarts := [][]string{{\"S\", \"S\"}, {\"S\", \"W\"}, {\"W\", \"S\"}, {\"W\", \"W\"}}\n\tfor _, start := range starts {\n\t\tanimals := make([]string, N+2)\n\t\tanimals[0] = start[0]\n\t\tanimals[1] = start[1]\n\t\tfor i := 1; i <= N; i++ {\n\t\t\tif animals[i] == \"S\" {\n\t\t\t\tif s[i] == 'o' {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif s[i] == 'o' {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif animals[0] == animals[N] && animals[1] == animals[N+1] {\n\t\t\tfmt.Println(strings.Join(animals[:N], \"\"))\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(-1)\n}\n\n// Input. ----------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanLines)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\n\treturn sc.Text()\n}\n\n// ---------- Input.\n", "language": "Go", "metadata": {"date": 1487492815, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03798.html", "problem_id": "p03798", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03798/input.txt", "sample_output_relpath": "derived/input_output/data/p03798/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03798/Go/s896199480.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s896199480", "user_id": "u598186038"}, "prompt_components": {"gold_output": "SSSWWS\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tN := nextInt()\n\ts := nextString()\n\n\ts += string(s[0])\n\tstarts := [][]string{{\"S\", \"S\"}, {\"S\", \"W\"}, {\"W\", \"S\"}, {\"W\", \"W\"}}\n\tfor _, start := range starts {\n\t\tanimals := make([]string, N+2)\n\t\tanimals[0] = start[0]\n\t\tanimals[1] = start[1]\n\t\tfor i := 1; i <= N; i++ {\n\t\t\tif animals[i] == \"S\" {\n\t\t\t\tif s[i] == 'o' {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif s[i] == 'o' {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif animals[i-1] == \"S\" {\n\t\t\t\t\t\tanimals[i+1] = \"S\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tanimals[i+1] = \"W\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif animals[0] == animals[N] && animals[1] == animals[N+1] {\n\t\t\tfmt.Println(strings.Join(animals[:N], \"\"))\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(-1)\n}\n\n// Input. ----------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanLines)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\n\treturn sc.Text()\n}\n\n// ---------- Input.\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSnuke, who loves animals, built a zoo.\n\nThere are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle.\nThe animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1.\n\nThere are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies.\n\nSnuke cannot tell the difference between these two species, and asked each animal the following question: \"Are your neighbors of the same species?\" The animal numbered i answered s_i. Here, if s_i is o, the animal said that the two neighboring animals are of the same species, and if s_i is x, the animal said that the two neighboring animals are of different species.\n\nMore formally, a sheep answered o if the two neighboring animals are both sheep or both wolves, and answered x otherwise.\nSimilarly, a wolf answered x if the two neighboring animals are both sheep or both wolves, and answered o otherwise.\n\nSnuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print -1.\n\nConstraints\n\n3 ≤ N ≤ 10^{5}\n\ns is a string of length N consisting of o and x.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there does not exist an valid assignment that is consistent with s, print -1.\nOtherwise, print an string t in the following format. The output is considered correct if the assignment described by t is consistent with s.\n\nt is a string of length N consisting of S and W.\n\nIf t_i is S, it indicates that the animal numbered i is a sheep. If t_i is W, it indicates that the animal numbered i is a wolf.\n\nSample Input 1\n\n6\nooxoox\n\nSample Output 1\n\nSSSWWS\n\nFor example, if the animals numbered 1, 2, 3, 4, 5 and 6 are respectively a sheep, sheep, sheep, wolf, wolf, and sheep, it is consistent with their responses. Besides, there is another valid assignment of species: a wolf, sheep, wolf, sheep, wolf and wolf.\n\nLet us remind you: if the neiboring animals are of the same species, a sheep answers o and a wolf answers x. If the neiboring animals are of different species, a sheep answers x and a wolf answers o.\n\nSample Input 2\n\n3\noox\n\nSample Output 2\n\n-1\n\nPrint -1 if there is no valid assignment of species.\n\nSample Input 3\n\n10\noxooxoxoox\n\nSample Output 3\n\nSSWWSSSWWS", "sample_input": "6\nooxoox\n"}, "reference_outputs": ["SSSWWS\n"], "source_document_id": "p03798", "source_text": "Score : 500 points\n\nProblem Statement\n\nSnuke, who loves animals, built a zoo.\n\nThere are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle.\nThe animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1.\n\nThere are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies.\n\nSnuke cannot tell the difference between these two species, and asked each animal the following question: \"Are your neighbors of the same species?\" The animal numbered i answered s_i. Here, if s_i is o, the animal said that the two neighboring animals are of the same species, and if s_i is x, the animal said that the two neighboring animals are of different species.\n\nMore formally, a sheep answered o if the two neighboring animals are both sheep or both wolves, and answered x otherwise.\nSimilarly, a wolf answered x if the two neighboring animals are both sheep or both wolves, and answered o otherwise.\n\nSnuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print -1.\n\nConstraints\n\n3 ≤ N ≤ 10^{5}\n\ns is a string of length N consisting of o and x.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there does not exist an valid assignment that is consistent with s, print -1.\nOtherwise, print an string t in the following format. The output is considered correct if the assignment described by t is consistent with s.\n\nt is a string of length N consisting of S and W.\n\nIf t_i is S, it indicates that the animal numbered i is a sheep. If t_i is W, it indicates that the animal numbered i is a wolf.\n\nSample Input 1\n\n6\nooxoox\n\nSample Output 1\n\nSSSWWS\n\nFor example, if the animals numbered 1, 2, 3, 4, 5 and 6 are respectively a sheep, sheep, sheep, wolf, wolf, and sheep, it is consistent with their responses. Besides, there is another valid assignment of species: a wolf, sheep, wolf, sheep, wolf and wolf.\n\nLet us remind you: if the neiboring animals are of the same species, a sheep answers o and a wolf answers x. If the neiboring animals are of different species, a sheep answers x and a wolf answers o.\n\nSample Input 2\n\n3\noox\n\nSample Output 2\n\n-1\n\nPrint -1 if there is no valid assignment of species.\n\nSample Input 3\n\n10\noxooxoxoox\n\nSample Output 3\n\nSSWWSSSWWS", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1326, "cpu_time_ms": 7, "memory_kb": 4224}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s463981063", "group_id": "codeNet:p03799", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc min(nums ...int) int {\n\tret := nums[0]\n\tfor _, v := range nums {\n\t\tif v < ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := nextInt(), nextInt()\n\tvar ans int\n\tif n <= m/2 {\n\t\tans = n + (m-2*n)/4\n\t} else {\n\t\tans = m / 2\n\t}\n\tputs(ans)\n\twt.Flush()\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\trdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "language": "Go", "metadata": {"date": 1581893708, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03799.html", "problem_id": "p03799", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03799/input.txt", "sample_output_relpath": "derived/input_output/data/p03799/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03799/Go/s463981063.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s463981063", "user_id": "u502813058"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc min(nums ...int) int {\n\tret := nums[0]\n\tfor _, v := range nums {\n\t\tif v < ret {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := nextInt(), nextInt()\n\tvar ans int\n\tif n <= m/2 {\n\t\tans = n + (m-2*n)/4\n\t} else {\n\t\tans = m / 2\n\t}\n\tputs(ans)\n\twt.Flush()\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\trdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "sample_input": "1 6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03799", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 647, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s182725029", "group_id": "codeNet:p03799", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextLong() int64 {\n\ti, err := strconv.ParseInt(io.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextDouble() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tN := io.NextInt()\n\tM := io.NextInt()\n\td := intMin(N, M/2)\n\tN -= d\n\tM -= 2 * d\n\tans := d\n\tans += M / 4\n\tio.PrintLn(ans)\n}", "language": "Go", "metadata": {"date": 1487470436, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03799.html", "problem_id": "p03799", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03799/input.txt", "sample_output_relpath": "derived/input_output/data/p03799/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03799/Go/s182725029.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s182725029", "user_id": "u015679112"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextLong() int64 {\n\ti, err := strconv.ParseInt(io.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextDouble() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tN := io.NextInt()\n\tM := io.NextInt()\n\td := intMin(N, M/2)\n\tN -= d\n\tM -= 2 * d\n\tans := d\n\tans += M / 4\n\tio.PrintLn(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "sample_input": "1 6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03799", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke loves puzzles.\n\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\n\nSnuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces.\n\nFind the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces.\n\nConstraints\n\n1 ≤ N,M ≤ 10^{12}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 6\n\nSample Output 1\n\n2\n\nTwo Scc groups can be created as follows:\n\nCombine two c-shaped pieces into one S-shaped piece\n\nCreate two Scc groups, each from one S-shaped piece and two c-shaped pieces\n\nSample Input 2\n\n12345 678901\n\nSample Output 2\n\n175897", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1940, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s618826434", "group_id": "codeNet:p03804", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tiv, _ := strconv.Atoi(scanString())\n\treturn iv\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 100001), 100001*100)\n}\n\nfunc main() {\n\tn, m := scanInt(), scanInt()\n\ta := make([]string, n)\n\tfor i := range a {\n\t\ta[i] = scanString()\n\t}\n\tb := make([]string, m)\n\tfor i := range b {\n\t\tb[i] = scanString()\n\t}\n\n\tfor ai := 0; ai < n-m+1; ai++ {\n\t\tfor aj := 0; aj < n-m+1; aj++ {\n\t\tL:\n\t\t\tfor bi := 0; bi < m; bi++ {\n\t\t\t\tfor bj := 0; bj < m; bj++ {\n\t\t\t\t\tif a[ai+bi][aj+bj] != b[bi][bj] {\n\t\t\t\t\t\tbreak L\n\t\t\t\t\t}\n\t\t\t\t\tif bi == m-1 && bj == m-1 {\n\t\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1585436293, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03804/input.txt", "sample_output_relpath": "derived/input_output/data/p03804/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03804/Go/s618826434.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s618826434", "user_id": "u461993794"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tiv, _ := strconv.Atoi(scanString())\n\treturn iv\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 100001), 100001*100)\n}\n\nfunc main() {\n\tn, m := scanInt(), scanInt()\n\ta := make([]string, n)\n\tfor i := range a {\n\t\ta[i] = scanString()\n\t}\n\tb := make([]string, m)\n\tfor i := range b {\n\t\tb[i] = scanString()\n\t}\n\n\tfor ai := 0; ai < n-m+1; ai++ {\n\t\tfor aj := 0; aj < n-m+1; aj++ {\n\t\tL:\n\t\t\tfor bi := 0; bi < m; bi++ {\n\t\t\t\tfor bj := 0; bj < m; bj++ {\n\t\t\t\t\tif a[ai+bi][aj+bj] != b[bi][bj] {\n\t\t\t\t\t\tbreak L\n\t\t\t\t\t}\n\t\t\t\t\tif bi == m-1 && bj == m-1 {\n\t\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "sample_input": "3 2\n#.#\n.#.\n#.#\n#.\n.#\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03804", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 811, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s969695292", "group_id": "codeNet:p03804", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ta := make([]string, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tb := make([]string, m)\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\tvar ok bool\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\t// スタート地点が点(i,j)となる\n\t\t\tok = true\n\t\t\tfor k := 0; k < m && i+k < n; k++ {\n\t\t\t\tfor l := 0; l < m && j+l < n; l++ { // O(N^4)だが、1<=N,M<=50のため間に合う\n\t\t\t\t\tif a[i][j] != b[k][l] {\n\t\t\t\t\t\tok = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1573340714, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03804/input.txt", "sample_output_relpath": "derived/input_output/data/p03804/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03804/Go/s969695292.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s969695292", "user_id": "u196030116"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ta := make([]string, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tb := make([]string, m)\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\tvar ok bool\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\t// スタート地点が点(i,j)となる\n\t\t\tok = true\n\t\t\tfor k := 0; k < m && i+k < n; k++ {\n\t\t\t\tfor l := 0; l < m && j+l < n; l++ { // O(N^4)だが、1<=N,M<=50のため間に合う\n\t\t\t\t\tif a[i][j] != b[k][l] {\n\t\t\t\t\t\tok = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "sample_input": "3 2\n#.#\n.#.\n#.#\n#.\n.#\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03804", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 641, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s834824727", "group_id": "codeNet:p03804", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\taPixels := ScanStrings(n)\n\tbPixels := ScanStrings(m)\n\tmatchCount := 0\n\tbaseX := 0\n\n\tfor i := 0; i < len(aPixels); i++ {\n\t\tfirstIndex := strings.Index(aPixels[i], bPixels[matchCount])\n\t\tif firstIndex >= 0 {\n\t\t\tif matchCount == 0 {\n\t\t\t\tbaseX = firstIndex\n\t\t\t\tmatchCount++\n\t\t\t} else if baseX == firstIndex {\n\t\t\t\tmatchCount++\n\t\t\t} else {\n\t\t\t\tmatchCount = 0\n\t\t\t}\n\t\t\tif matchCount == len(bPixels) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tmatchCount = 0\n\t\t}\n\t}\n\tif matchCount == len(bPixels) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc ScanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1564341058, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03804.html", "problem_id": "p03804", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03804/input.txt", "sample_output_relpath": "derived/input_output/data/p03804/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03804/Go/s834824727.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s834824727", "user_id": "u717943620"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\taPixels := ScanStrings(n)\n\tbPixels := ScanStrings(m)\n\tmatchCount := 0\n\tbaseX := 0\n\n\tfor i := 0; i < len(aPixels); i++ {\n\t\tfirstIndex := strings.Index(aPixels[i], bPixels[matchCount])\n\t\tif firstIndex >= 0 {\n\t\t\tif matchCount == 0 {\n\t\t\t\tbaseX = firstIndex\n\t\t\t\tmatchCount++\n\t\t\t} else if baseX == firstIndex {\n\t\t\t\tmatchCount++\n\t\t\t} else {\n\t\t\t\tmatchCount = 0\n\t\t\t}\n\t\t\tif matchCount == len(bPixels) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tmatchCount = 0\n\t\t}\n\t}\n\tif matchCount == len(bPixels) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc ScanStrings(len int) (strings []string) {\n\tvar str string\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scanf(\"%s\", &str)\n\t\tstrings = append(strings, str)\n\t}\n\treturn\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "sample_input": "3 2\n#.#\n.#.\n#.#\n#.\n.#\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03804", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels.\n\nA pixel is the smallest element of an image, and in this problem it is a square of size 1×1.\n\nAlso, the given images are binary images, and the color of each pixel is either white or black.\n\nIn the input, every pixel is represented by a character: . corresponds to a white pixel, and # corresponds to a black pixel.\n\nThe image A is given as N strings A_1,...,A_N.\n\nThe j-th character in the string A_i corresponds to the pixel at the i-th row and j-th column of the image A (1≦i,j≦N).\n\nSimilarly, the template image B is given as M strings B_1,...,B_M.\n\nThe j-th character in the string B_i corresponds to the pixel at the i-th row and j-th column of the template image B (1≦i,j≦M).\n\nDetermine whether the template image B is contained in the image A when only parallel shifts can be applied to the images.\n\nConstraints\n\n1≦M≦N≦50\n\nA_i is a string of length N consisting of # and ..\n\nB_i is a string of length M consisting of # and ..\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nA_1\nA_2\n:\nA_N\nB_1\nB_2\n:\nB_M\n\nOutput\n\nPrint Yes if the template image B is contained in the image A. Print No otherwise.\n\nSample Input 1\n\n3 2\n#.#\n.#.\n#.#\n#.\n.#\n\nSample Output 1\n\nYes\n\nThe template image B is identical to the upper-left 2 × 2 subimage and the lower-right 2 × 2 subimage of A. Thus, the output should be Yes.\n\nSample Input 2\n\n4 1\n....\n....\n....\n....\n#\n\nSample Output 2\n\nNo\n\nThe template image B, composed of a black pixel, is not contained in the image A composed of white pixels.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 786, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s729860674", "group_id": "codeNet:p03805", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tVISITED = 1\n)\n\nvar (\n\tn int\n\tm int\n\ta []int\n\tb []int\n\n\tgraph map[int][]int\n\n\tans int\n)\n\nfunc main() {\n\tn = readi()\n\tm = readi()\n\ta = make([]int, m)\n\tb = make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\ta[i] = readi()\n\t\tb[i] = readi()\n\t}\n\n\t// init graph\n\tgraph = make(map[int][]int)\n\tfor i := 0; i < m; i++ {\n\t\tgraph[a[i]] = append(graph[a[i]], b[i])\n\t\tgraph[b[i]] = append(graph[b[i]], a[i])\n\t}\n\n\t// init visited\n\tvisited := make([]int, n+1)\n\tfor i := 0; i <= n; i++ {\n\t\tvisited[i] = -1\n\t}\n\n\tdfs(1, 1, visited)\n\tfmt.Println(ans)\n}\n\nfunc dfs(p, depth int, visited []int) {\n\ttmpVisited := make([]int, len(visited))\n\tcopy(tmpVisited, visited)\n\tif depth == n {\n\t\tans++\n\t\treturn\n\t}\n\ttmpVisited[p] = VISITED\n\n\tdests, ok := graph[p]\n\tif !ok {\n\t\treturn\n\t}\n\tfor _, d := range dests {\n\t\tif tmpVisited[d] == VISITED {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(d, depth+1, tmpVisited)\n\t}\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\n// 最大公約数\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\n// 最小公倍数\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc comb(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n\n\tCOMB_MAX = 510000\n)\n\nvar (\n\treadString func() string\n)\n\nvar (\n\tfac = [COMB_MAX]int{}\n\tfinv = [COMB_MAX]int{}\n\tinv = [COMB_MAX]int{}\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\nfunc combInit() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < COMB_MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590347755, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03805.html", "problem_id": "p03805", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03805/input.txt", "sample_output_relpath": "derived/input_output/data/p03805/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03805/Go/s729860674.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s729860674", "user_id": "u183912232"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tVISITED = 1\n)\n\nvar (\n\tn int\n\tm int\n\ta []int\n\tb []int\n\n\tgraph map[int][]int\n\n\tans int\n)\n\nfunc main() {\n\tn = readi()\n\tm = readi()\n\ta = make([]int, m)\n\tb = make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\ta[i] = readi()\n\t\tb[i] = readi()\n\t}\n\n\t// init graph\n\tgraph = make(map[int][]int)\n\tfor i := 0; i < m; i++ {\n\t\tgraph[a[i]] = append(graph[a[i]], b[i])\n\t\tgraph[b[i]] = append(graph[b[i]], a[i])\n\t}\n\n\t// init visited\n\tvisited := make([]int, n+1)\n\tfor i := 0; i <= n; i++ {\n\t\tvisited[i] = -1\n\t}\n\n\tdfs(1, 1, visited)\n\tfmt.Println(ans)\n}\n\nfunc dfs(p, depth int, visited []int) {\n\ttmpVisited := make([]int, len(visited))\n\tcopy(tmpVisited, visited)\n\tif depth == n {\n\t\tans++\n\t\treturn\n\t}\n\ttmpVisited[p] = VISITED\n\n\tdests, ok := graph[p]\n\tif !ok {\n\t\treturn\n\t}\n\tfor _, d := range dests {\n\t\tif tmpVisited[d] == VISITED {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(d, depth+1, tmpVisited)\n\t}\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\n// 最大公約数\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\n// 最小公倍数\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc comb(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n\n\tCOMB_MAX = 510000\n)\n\nvar (\n\treadString func() string\n)\n\nvar (\n\tfac = [COMB_MAX]int{}\n\tfinv = [COMB_MAX]int{}\n\tinv = [COMB_MAX]int{}\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\nfunc combInit() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < COMB_MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an undirected unweighted graph with N vertices and M edges that contains neither self-loops nor double edges.\n\nHere, a self-loop is an edge where a_i = b_i (1≤i≤M), and double edges are two edges where (a_i,b_i)=(a_j,b_j) or (a_i,b_i)=(b_j,a_j) (1≤i= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextLong() int64 {\n\ti, err := strconv.ParseInt(io.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextDouble() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc perm(N int, G [][]bool, size int, used []bool, order []int) int {\n\tif size == N {\n\t\treturn 1;\n\t}\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif used[i] {\n\t\t\tcontinue\n\t\t}\n\t\tif G[order[size - 1]][i] == false {\n\t\t\tcontinue\n\t\t}\n\t\tused[i] = true;\n\t\torder[size] = i;\n\t\tans += perm(N, G, size + 1, used, order)\n\t\tused[i] = false;\n\t}\n\treturn ans;\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tN := io.NextInt()\n\tM := io.NextInt()\n\tG := make([][]bool, N)\n\tfor i := 0; i < N; i++ {\n\t\tG[i] = make([]bool, N)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\ta := io.NextInt()\n\t\tb := io.NextInt()\n\t\ta--\n\t\tb--\n\t\tG[a][b] = true;\n\t\tG[b][a] = true;\n\t}\n\tused := make([]bool, N)\n\torder := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tused[i] = false;\n\t}\n\tused[0] = true;\n\torder[0] = 0;\n\tans := perm(N, G, 1, used, order);\n\tio.PrintLn(ans)\n}", "language": "Go", "metadata": {"date": 1486865831, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03805.html", "problem_id": "p03805", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03805/input.txt", "sample_output_relpath": "derived/input_output/data/p03805/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03805/Go/s714739403.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s714739403", "user_id": "u015679112"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextLong() int64 {\n\ti, err := strconv.ParseInt(io.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextDouble() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc perm(N int, G [][]bool, size int, used []bool, order []int) int {\n\tif size == N {\n\t\treturn 1;\n\t}\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif used[i] {\n\t\t\tcontinue\n\t\t}\n\t\tif G[order[size - 1]][i] == false {\n\t\t\tcontinue\n\t\t}\n\t\tused[i] = true;\n\t\torder[size] = i;\n\t\tans += perm(N, G, size + 1, used, order)\n\t\tused[i] = false;\n\t}\n\treturn ans;\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tN := io.NextInt()\n\tM := io.NextInt()\n\tG := make([][]bool, N)\n\tfor i := 0; i < N; i++ {\n\t\tG[i] = make([]bool, N)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\ta := io.NextInt()\n\t\tb := io.NextInt()\n\t\ta--\n\t\tb--\n\t\tG[a][b] = true;\n\t\tG[b][a] = true;\n\t}\n\tused := make([]bool, N)\n\torder := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tused[i] = false;\n\t}\n\tused[0] = true;\n\torder[0] = 0;\n\tans := perm(N, G, 1, used, order);\n\tio.PrintLn(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an undirected unweighted graph with N vertices and M edges that contains neither self-loops nor double edges.\n\nHere, a self-loop is an edge where a_i = b_i (1≤i≤M), and double edges are two edges where (a_i,b_i)=(a_j,b_j) or (a_i,b_i)=(b_j,a_j) (1≤i 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tt := total / 15\n\tfor i := 0; i < N; i++ {\n\t\tp := t - K[i]\n\t\tif p >= 0 && p % N == 0 {\n\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r:rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1486440228, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03808.html", "problem_id": "p03808", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03808/input.txt", "sample_output_relpath": "derived/input_output/data/p03808/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03808/Go/s364004747.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s364004747", "user_id": "u504669764"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\tA := sc.NextIntArray()\n\tK := make([]int, N)\n\n\ttotal := 0\n\tfor i := 0; i < N; i++ {\n\t\tK[i] = A[(i + 1) % N] - A[i]\n\t\ttotal += A[i]\n\t}\n\n\tif total % 15 > 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tt := total / 15\n\tfor i := 0; i < N; i++ {\n\t\tp := t - K[i]\n\t\tif p >= 0 && p % N == 0 {\n\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r:rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N boxes arranged in a circle. The i-th box contains A_i stones.\n\nDetermine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation:\n\nSelect one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j)-th box. Here, the (N+k)-th box is identified with the k-th box.\n\nNote that the operation cannot be performed if there is a box that does not contain enough number of stones to be removed.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\n\nOutput\n\nIf it is possible to remove all the stones from the boxes, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n4 5 1 2 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed in one operation by selecting the second box.\n\nSample Input 2\n\n5\n6 9 12 10 8\n\nSample Output 2\n\nYES\n\nSample Input 3\n\n4\n1 2 3 1\n\nSample Output 3\n\nNO", "sample_input": "5\n4 5 1 2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03808", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N boxes arranged in a circle. The i-th box contains A_i stones.\n\nDetermine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation:\n\nSelect one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j)-th box. Here, the (N+k)-th box is identified with the k-th box.\n\nNote that the operation cannot be performed if there is a box that does not contain enough number of stones to be removed.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\n\nOutput\n\nIf it is possible to remove all the stones from the boxes, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n4 5 1 2 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed in one operation by selecting the second box.\n\nSample Input 2\n\n5\n6 9 12 10 8\n\nSample Output 2\n\nYES\n\nSample Input 3\n\n4\n1 2 3 1\n\nSample Output 3\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1923, "cpu_time_ms": 47, "memory_kb": 8320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s887803811", "group_id": "codeNet:p03809", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\nfunc SumInt(A ...int) int {\n sum := 0\n for _, a := range A {\n sum += a\n }\n return sum\n}\nfunc AbsInt(x int) int {\n if x < 0 { x = -x }\n return x\n}\n\nfunc Solve() {\n var N int\n NextInt(&N)\n var A []int\n NextIntVec(&A)\n T := make([][]int, N)\n for i := range T {\n T[i] = make([]int, 0)\n }\n var a, b int\n for i := 1; i < N; i++ {\n NextInt(&a, &b)\n a, b = a - 1, b - 1\n T[a] = append(T[a], b)\n T[b] = append(T[b], a)\n }\n P := make([]int, N)\n for i := range P[1:] {\n P[i + 1] = -1\n }\n Q := make([]int, N)\n pos := 1\n for _, q := range Q {\n for _, adj := range T[q] {\n if 0 <= P[adj] { continue }\n P[adj] = q\n Q[pos] = adj\n pos++\n }\n }\n DP := make([][]int, N)\n for i := range DP {\n DP[i] = make([]int, 2)\n }\n ans := \"YES\"\n for i := N - 1; 0 <= i; i-- {\n u := Q[i]\n p := P[u]\n if 0 < u && len(T[u]) == 1 {\n DP[u][0] = A[u]\n DP[u][1] = A[u]\n }\n C := 2 * A[u] - DP[u][0]\n if C < 0 || 2 * DP[u][1] - DP[u][0] < C {\n ans = \"NO\"\n break\n }\n DP[p][0] += C\n DP[p][1] = MaxInt(C, DP[p][1])\n }\n Write(ans)\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1583552296, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03809.html", "problem_id": "p03809", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03809/input.txt", "sample_output_relpath": "derived/input_output/data/p03809/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03809/Go/s887803811.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s887803811", "user_id": "u415905784"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\nfunc SumInt(A ...int) int {\n sum := 0\n for _, a := range A {\n sum += a\n }\n return sum\n}\nfunc AbsInt(x int) int {\n if x < 0 { x = -x }\n return x\n}\n\nfunc Solve() {\n var N int\n NextInt(&N)\n var A []int\n NextIntVec(&A)\n T := make([][]int, N)\n for i := range T {\n T[i] = make([]int, 0)\n }\n var a, b int\n for i := 1; i < N; i++ {\n NextInt(&a, &b)\n a, b = a - 1, b - 1\n T[a] = append(T[a], b)\n T[b] = append(T[b], a)\n }\n P := make([]int, N)\n for i := range P[1:] {\n P[i + 1] = -1\n }\n Q := make([]int, N)\n pos := 1\n for _, q := range Q {\n for _, adj := range T[q] {\n if 0 <= P[adj] { continue }\n P[adj] = q\n Q[pos] = adj\n pos++\n }\n }\n DP := make([][]int, N)\n for i := range DP {\n DP[i] = make([]int, 2)\n }\n ans := \"YES\"\n for i := N - 1; 0 <= i; i-- {\n u := Q[i]\n p := P[u]\n if 0 < u && len(T[u]) == 1 {\n DP[u][0] = A[u]\n DP[u][1] = A[u]\n }\n C := 2 * A[u] - DP[u][0]\n if C < 0 || 2 * DP[u][1] - DP[u][0] < C {\n ans = \"NO\"\n break\n }\n DP[p][0] += C\n DP[p][1] = MaxInt(C, DP[p][1])\n }\n Write(ans)\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nThere is a tree with N vertices, numbered 1 through N.\nThe i-th of the N-1 edges connects vertices a_i and b_i.\n\nCurrently, there are A_i stones placed on vertex i.\nDetermine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation:\n\nSelect a pair of different leaves. Then, remove exactly one stone from every vertex on the path between those two vertices.\nHere, a leaf is a vertex of the tree whose degree is 1, and the selected leaves themselves are also considered as vertices on the path connecting them.\n\nNote that the operation cannot be performed if there is a vertex with no stone on the path.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ a_i,b_i ≦ N\n\n0 ≦ A_i ≦ 10^9\n\nThe given graph is a tree.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf it is possible to remove all the stones from the vertices, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n1 2 1 1 2\n2 4\n5 2\n3 2\n1 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed, as follows:\n\nSelect vertices 4 and 5. Then, there is one stone remaining on each vertex except 4.\n\nSelect vertices 1 and 5. Then, there is no stone on any vertex.\n\nSample Input 2\n\n3\n1 2 1\n1 2\n2 3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n6\n3 2 2 2 2 2\n1 2\n2 3\n1 4\n1 5\n4 6\n\nSample Output 3\n\nYES", "sample_input": "5\n1 2 1 1 2\n2 4\n5 2\n3 2\n1 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03809", "source_text": "Score : 700 points\n\nProblem Statement\n\nThere is a tree with N vertices, numbered 1 through N.\nThe i-th of the N-1 edges connects vertices a_i and b_i.\n\nCurrently, there are A_i stones placed on vertex i.\nDetermine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation:\n\nSelect a pair of different leaves. Then, remove exactly one stone from every vertex on the path between those two vertices.\nHere, a leaf is a vertex of the tree whose degree is 1, and the selected leaves themselves are also considered as vertices on the path connecting them.\n\nNote that the operation cannot be performed if there is a vertex with no stone on the path.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ a_i,b_i ≦ N\n\n0 ≦ A_i ≦ 10^9\n\nThe given graph is a tree.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1 A_2 … A_N\na_1 b_1\n:\na_{N-1} b_{N-1}\n\nOutput\n\nIf it is possible to remove all the stones from the vertices, print YES. Otherwise, print NO.\n\nSample Input 1\n\n5\n1 2 1 1 2\n2 4\n5 2\n3 2\n1 3\n\nSample Output 1\n\nYES\n\nAll the stones can be removed, as follows:\n\nSelect vertices 4 and 5. Then, there is one stone remaining on each vertex except 4.\n\nSelect vertices 1 and 5. Then, there is no stone on any vertex.\n\nSample Input 2\n\n3\n1 2 1\n1 2\n2 3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n6\n3 2 2 2 2 2\n1 2\n2 3\n1 4\n1 5\n4 6\n\nSample Output 3\n\nYES", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2623, "cpu_time_ms": 130, "memory_kb": 15104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s646453486", "group_id": "codeNet:p03815", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tx := getInt()\n\n\tresult := (x / 11) * 2\n\tif x % 11 != 0 {\n\t\tif x % 11 <= 5 {\n\t\t\tresult++\n\t\t} else {\n\t\t\tresult += 2\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1588551455, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03815.html", "problem_id": "p03815", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03815/input.txt", "sample_output_relpath": "derived/input_output/data/p03815/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03815/Go/s646453486.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s646453486", "user_id": "u964273035"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tx := getInt()\n\n\tresult := (x / 11) * 2\n\tif x % 11 != 0 {\n\t\tif x % 11 <= 5 {\n\t\t\tresult++\n\t\t} else {\n\t\t\tresult += 2\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "sample_input": "7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03815", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5293, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s157772200", "group_id": "codeNet:p03815", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) Scan() (ok bool) {\n\tok = me.baseScanner.Scan()\n\treturn\n}\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan()\n\tn := r.getInt()\n\n\tcnt := n / 11\n\tn -= cnt * 11\n\tcnt *= 2\n\tswitch {\n\tcase n <= 6:\n\t\tcnt++\n\tcase n <= 7:\n\t\tcnt += 3\n\tdefault:\n\t\tcnt += 2\n\t}\n\tif n <= 6 {\n\t\tcnt++\n\t} else {\n\t\tcnt += 2\n\t}\n\tfmt.Fprintln(stdout, cnt)\n\n}\n", "language": "Go", "metadata": {"date": 1566009090, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03815.html", "problem_id": "p03815", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03815/input.txt", "sample_output_relpath": "derived/input_output/data/p03815/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03815/Go/s157772200.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s157772200", "user_id": "u463655976"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) Scan() (ok bool) {\n\tok = me.baseScanner.Scan()\n\treturn\n}\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan()\n\tn := r.getInt()\n\n\tcnt := n / 11\n\tn -= cnt * 11\n\tcnt *= 2\n\tswitch {\n\tcase n <= 6:\n\t\tcnt++\n\tcase n <= 7:\n\t\tcnt += 3\n\tdefault:\n\t\tcnt += 2\n\t}\n\tif n <= 6 {\n\t\tcnt++\n\t} else {\n\t\tcnt += 2\n\t}\n\tfmt.Fprintln(stdout, cnt)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "sample_input": "7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03815", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3017, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s449506858", "group_id": "codeNet:p03817", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\n\tc := x / 11 * 2\n\tif x%11 > 0 && x%11 <= 5 {\n\t\tc += 1\n\t}\n\tif x%11 > 5 {\n\t\tc += 2\n\t}\n\tfmt.Println(c)\n}", "language": "Go", "metadata": {"date": 1543279541, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03817.html", "problem_id": "p03817", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03817/input.txt", "sample_output_relpath": "derived/input_output/data/p03817/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03817/Go/s449506858.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s449506858", "user_id": "u875592584"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\n\tc := x / 11 * 2\n\tif x%11 > 0 && x%11 <= 5 {\n\t\tc += 1\n\t}\n\tif x%11 > 5 {\n\t\tc += 2\n\t}\n\tfmt.Println(c)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "sample_input": "7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03817", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:\n\nOperation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.\n\nFor example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.\nIf the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.\nBesides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.\n\nFind the minimum number of operation Snuke needs to perform in order to score at least x points in total.\n\nConstraints\n\n1 ≦ x ≦ 10^{15}\n\nx is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n7\n\nSample Output 1\n\n2\n\nSample Input 2\n\n149696127901\n\nSample Output 2\n\n27217477801", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 169, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s910438352", "group_id": "codeNet:p03827", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tcnt := 0\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tswitch rune(s[i]) {\n\t\tcase 'I':\n\t\t\tcnt++\n\t\tcase 'D':\n\t\t\tcnt--\n\t\t}\n\t\tans = max(ans, cnt)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1540967764, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03827.html", "problem_id": "p03827", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03827/input.txt", "sample_output_relpath": "derived/input_output/data/p03827/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03827/Go/s910438352.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s910438352", "user_id": "u323680411"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tcnt := 0\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tswitch rune(s[i]) {\n\t\tcase 'I':\n\t\t\tcnt++\n\t\tcase 'D':\n\t\t\tcnt--\n\t\t}\n\t\tans = max(ans, cnt)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "sample_input": "5\nIIDID\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03827", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have an integer variable x.\nInitially, x=0.\n\nSome person gave you a string S of length N, and using the string you performed the following operation N times.\nIn the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D.\n\nFind the maximum value taken by x during the operations (including before the first operation, and after the last operation).\n\nConstraints\n\n1≤N≤100\n\n|S|=N\n\nNo characters except I and D occur in S.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the maximum value taken by x during the operations.\n\nSample Input 1\n\n5\nIIDID\n\nSample Output 1\n\n2\n\nAfter each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.\n\nSample Input 2\n\n7\nDDIDDII\n\nSample Output 2\n\n0\n\nThe initial value x=0 is the maximum value taken by x, thus the output should be 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 310, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s410967325", "group_id": "codeNet:p03834", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n for _, c := range s {\n if int(c) == int(',') {\n fmt.Print(\" \")\n } else {\n fmt.Printf(\"%c\", c)\n }\n }\n fmt.Println()\n}", "language": "Go", "metadata": {"date": 1556243445, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03834.html", "problem_id": "p03834", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03834/input.txt", "sample_output_relpath": "derived/input_output/data/p03834/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03834/Go/s410967325.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s410967325", "user_id": "u813098295"}, "prompt_components": {"gold_output": "happy newyear enjoy\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n for _, c := range s {\n if int(c) == int(',') {\n fmt.Print(\" \")\n } else {\n fmt.Printf(\"%c\", c)\n }\n }\n fmt.Println()\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAs a New Year's gift, Dolphin received a string s of length 19.\n\nThe string s has the following format: [five lowercase English letters],[seven lowercase English letters],[five lowercase English letters].\n\nDolphin wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "sample_input": "happy,newyear,enjoy\n"}, "reference_outputs": ["happy newyear enjoy\n"], "source_document_id": "p03834", "source_text": "Score : 100 points\n\nProblem Statement\n\nAs a New Year's gift, Dolphin received a string s of length 19.\n\nThe string s has the following format: [five lowercase English letters],[seven lowercase English letters],[five lowercase English letters].\n\nDolphin wants to convert the comma-separated string s into a space-separated string.\n\nWrite a program to perform the conversion for him.\n\nConstraints\n\nThe length of s is 19.\n\nThe sixth and fourteenth characters in s are ,.\n\nThe other characters in s are lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string after the conversion.\n\nSample Input 1\n\nhappy,newyear,enjoy\n\nSample Output 1\n\nhappy newyear enjoy\n\nReplace all the commas in happy,newyear,enjoy with spaces to obtain happy newyear enjoy.\n\nSample Input 2\n\nhaiku,atcoder,tasks\n\nSample Output 2\n\nhaiku atcoder tasks\n\nSample Input 3\n\nabcde,fghihgf,edcba\n\nSample Output 3\n\nabcde fghihgf edcba", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 245, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s068033578", "group_id": "codeNet:p03836", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc one(dx, dy int) string {\n\treturn strings.Repeat(\"U\", dy) + strings.Repeat(\"R\", dx)\n}\n\nfunc two(dx, dy int) string {\n\treturn strings.Repeat(\"D\", dy) + strings.Repeat(\"L\", dx)\n}\n\nfunc three(dx, dy int) string {\n\tp := \"L\"\n\tp += strings.Repeat(\"U\", dy+1)\n\tp += strings.Repeat(\"R\", dx+1)\n\tp += \"D\"\n\n\treturn p\n}\n\nfunc four(dx, dy int) string {\n\tp := \"R\"\n\tp += strings.Repeat(\"D\", dy+1)\n\tp += strings.Repeat(\"L\", dx+1)\n\tp += \"U\"\n\n\treturn p\n}\nfunc main() {\n\tvar sx, sy, tx, ty, dx, dy int\n\tfmt.Scanf(\"%d %d %d %d\", &sx, &sy, &tx, &ty)\n\n\tdx = tx - sx\n\tdy = ty - sy\n\tpaths := make([]string, 4, 4)\n\n\tpaths[0] = one(dx, dy)\n\tpaths[1] = two(dx, dy)\n\tpaths[2] = three(dx, dy)\n\tpaths[3] = four(dx, dy)\n\n\tfmt.Println(strings.Join(paths, \"\"))\n}\n", "language": "Go", "metadata": {"date": 1577504176, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03836.html", "problem_id": "p03836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03836/input.txt", "sample_output_relpath": "derived/input_output/data/p03836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03836/Go/s068033578.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s068033578", "user_id": "u283719735"}, "prompt_components": {"gold_output": "UURDDLLUUURRDRDDDLLU\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc one(dx, dy int) string {\n\treturn strings.Repeat(\"U\", dy) + strings.Repeat(\"R\", dx)\n}\n\nfunc two(dx, dy int) string {\n\treturn strings.Repeat(\"D\", dy) + strings.Repeat(\"L\", dx)\n}\n\nfunc three(dx, dy int) string {\n\tp := \"L\"\n\tp += strings.Repeat(\"U\", dy+1)\n\tp += strings.Repeat(\"R\", dx+1)\n\tp += \"D\"\n\n\treturn p\n}\n\nfunc four(dx, dy int) string {\n\tp := \"R\"\n\tp += strings.Repeat(\"D\", dy+1)\n\tp += strings.Repeat(\"L\", dx+1)\n\tp += \"U\"\n\n\treturn p\n}\nfunc main() {\n\tvar sx, sy, tx, ty, dx, dy int\n\tfmt.Scanf(\"%d %d %d %d\", &sx, &sy, &tx, &ty)\n\n\tdx = tx - sx\n\tdy = ty - sy\n\tpaths := make([]string, 4, 4)\n\n\tpaths[0] = one(dx, dy)\n\tpaths[1] = two(dx, dy)\n\tpaths[2] = three(dx, dy)\n\tpaths[3] = four(dx, dy)\n\n\tfmt.Println(strings.Join(paths, \"\"))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.\n\nCurrently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.\n\nHere, both the x- and y-coordinates before and after each movement must be integers.\n\nHe will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).\n\nHere, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).\n\nUnder this condition, find a shortest path for him.\n\nConstraints\n\n-1000 ≤ sx < tx ≤ 1000\n\n-1000 ≤ sy < ty ≤ 1000\n\nsx,sy,tx and ty are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nsx sy tx ty\n\nOutput\n\nPrint a string S that represents a shortest path for Dolphin.\n\nThe i-th character in S should correspond to his i-th movement.\n\nThe directions of the movements should be indicated by the following characters:\n\nU: Up\n\nD: Down\n\nL: Left\n\nR: Right\n\nIf there exist multiple shortest paths under the condition, print any of them.\n\nSample Input 1\n\n0 0 1 2\n\nSample Output 1\n\nUURDDLLUUURRDRDDDLLU\n\nOne possible shortest path is:\n\nGoing from (sx,sy) to (tx,ty) for the first time: (0,0) → (0,1) → (0,2) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the first time: (1,2) → (1,1) → (1,0) → (0,0)\n\nGoing from (sx,sy) to (tx,ty) for the second time: (0,0) → (-1,0) → (-1,1) → (-1,2) → (-1,3) → (0,3) → (1,3) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the second time: (1,2) → (2,2) → (2,1) → (2,0) → (2,-1) → (1,-1) → (0,-1) → (0,0)\n\nSample Input 2\n\n-2 -2 1 1\n\nSample Output 2\n\nUURRURRDDDLLDLLULUUURRURRDDDLLDL", "sample_input": "0 0 1 2\n"}, "reference_outputs": ["UURDDLLUUURRDRDDDLLU\n"], "source_document_id": "p03836", "source_text": "Score : 300 points\n\nProblem Statement\n\nDolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.\n\nCurrently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.\n\nHere, both the x- and y-coordinates before and after each movement must be integers.\n\nHe will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).\n\nHere, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).\n\nUnder this condition, find a shortest path for him.\n\nConstraints\n\n-1000 ≤ sx < tx ≤ 1000\n\n-1000 ≤ sy < ty ≤ 1000\n\nsx,sy,tx and ty are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nsx sy tx ty\n\nOutput\n\nPrint a string S that represents a shortest path for Dolphin.\n\nThe i-th character in S should correspond to his i-th movement.\n\nThe directions of the movements should be indicated by the following characters:\n\nU: Up\n\nD: Down\n\nL: Left\n\nR: Right\n\nIf there exist multiple shortest paths under the condition, print any of them.\n\nSample Input 1\n\n0 0 1 2\n\nSample Output 1\n\nUURDDLLUUURRDRDDDLLU\n\nOne possible shortest path is:\n\nGoing from (sx,sy) to (tx,ty) for the first time: (0,0) → (0,1) → (0,2) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the first time: (1,2) → (1,1) → (1,0) → (0,0)\n\nGoing from (sx,sy) to (tx,ty) for the second time: (0,0) → (-1,0) → (-1,1) → (-1,2) → (-1,3) → (0,3) → (1,3) → (1,2)\n\nGoing from (tx,ty) to (sx,sy) for the second time: (1,2) → (2,2) → (2,1) → (2,0) → (2,-1) → (1,-1) → (0,-1) → (0,0)\n\nSample Input 2\n\n-2 -2 1 1\n\nSample Output 2\n\nUURRURRDDDLLDLLULUUURRURRDDDLLDL", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 777, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s184474514", "group_id": "codeNet:p03845", "input_text": "package main\nimport \"fmt\"\nvar (N int\n t[100000] int\n M int\n P [100]int\n X [100]int\n )\nfunc main(){\n fmt.Scanln(&N)\n sum := 0\n for i:=0;i< N;i++{\n fmt.Scan(&t[i])\n sum += t[i]\n }\n fmt.Scanln(&M)\n for i:=0;i= 1 && a%x == 0 {\n\t\tfmt.Printf(\"%d\\n\", chunk+1)\n\t} else if chunk >= 1 {\n\t\tfmt.Printf(\"%d\\n\", chunk)\n\t} else if x%a <= (b - a) {\n\t\tfmt.Printf(\"%d\\n\", 1)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", 0)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1594108252, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03861/input.txt", "sample_output_relpath": "derived/input_output/data/p03861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03861/Go/s585854179.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s585854179", "user_id": "u131131890"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, x int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &x)\n\n\tchunk := (b - a) / x\n\tif chunk >= 1 && a%x == 0 {\n\t\tfmt.Printf(\"%d\\n\", chunk+1)\n\t} else if chunk >= 1 {\n\t\tfmt.Printf(\"%d\\n\", chunk)\n\t} else if x%a <= (b - a) {\n\t\tfmt.Printf(\"%d\\n\", 1)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", 0)\n\t}\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "sample_input": "4 8 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03861", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 325, "cpu_time_ms": 7, "memory_kb": 1848}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s484179933", "group_id": "codeNet:p03861", "input_text": "package main\nimport \"fmt\"\nvar v1,v2,v3,res uint64\nfunc main(){\n fmt.Scanln(&v1,&v2,&v3)\n res := (v1 - v2)/v3\n if v1%v3 == 0 {\n print(res + 1)\n }else{\n print(res)\n }\n \n \n}", "language": "Go", "metadata": {"date": 1587342820, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03861/input.txt", "sample_output_relpath": "derived/input_output/data/p03861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03861/Go/s484179933.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s484179933", "user_id": "u029444479"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\nimport \"fmt\"\nvar v1,v2,v3,res uint64\nfunc main(){\n fmt.Scanln(&v1,&v2,&v3)\n res := (v1 - v2)/v3\n if v1%v3 == 0 {\n print(res + 1)\n }else{\n print(res)\n }\n \n \n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "sample_input": "4 8 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03861", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 183, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s867050046", "group_id": "codeNet:p03861", "input_text": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main () {\n var small, large, divider int\n fmt.Scan(&small, &large, ÷r)\n fmt.Printf(\"%d\", large/3 - small/3)\n}", "language": "Go", "metadata": {"date": 1575770699, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03861/input.txt", "sample_output_relpath": "derived/input_output/data/p03861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03861/Go/s867050046.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s867050046", "user_id": "u511254943"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main () {\n var small, large, divider int\n fmt.Scan(&small, &large, ÷r)\n fmt.Printf(\"%d\", large/3 - small/3)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "sample_input": "4 8 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03861", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 159, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s167214689", "group_id": "codeNet:p03861", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a,b,x int\n\tfmt.Scan(&a,&b,&x)\n\n\tvar count int\n\n\tfor i:=a; i <= b ; i++ {\n\n\t\tif a % x == 0 {\n\t\t\tcount++\n\t\t}\n\t\ta++\n\n\t}\n\tfmt.Println(count)\n\n}\n", "language": "Go", "metadata": {"date": 1568615683, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03861.html", "problem_id": "p03861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03861/input.txt", "sample_output_relpath": "derived/input_output/data/p03861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03861/Go/s167214689.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s167214689", "user_id": "u175397141"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a,b,x int\n\tfmt.Scan(&a,&b,&x)\n\n\tvar count int\n\n\tfor i:=a; i <= b ; i++ {\n\n\t\tif a % x == 0 {\n\t\t\tcount++\n\t\t}\n\t\ta++\n\n\t}\n\tfmt.Println(count)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "sample_input": "4 8 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03861", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\nConstraints\n\n0 ≤ a ≤ b ≤ 10^{18}\n\n1 ≤ x ≤ 10^{18}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the number of the integers between a and b, inclusive, that are divisible by x.\n\nSample Input 1\n\n4 8 2\n\nSample Output 1\n\n3\n\nThere are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.\n\nSample Input 2\n\n0 5 1\n\nSample Output 2\n\n6\n\nThere are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.\n\nSample Input 3\n\n9 9 2\n\nSample Output 3\n\n0\n\nThere are no integer between 9 and 9, inclusive, that is divisible by 2.\n\nSample Input 4\n\n1 1000000000000000000 3\n\nSample Output 4\n\n333333333333333333\n\nWatch out for integer overflows.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 188, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s289810296", "group_id": "codeNet:p03862", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, x, ans int\n\tvar a []int\n\tvar scan int\n\n\tfmt.Scan(&n, &x)\n\ta = make([]int, n)\n\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Scan(&scan)\n\t\ta[i] = scan\n\t}\n\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tswitch {\n\t\tcase a[i]+a[i+1] > x:\n\t\t\tfor {\n\t\t\t\ta[i+1]--\n\t\t\t\tans++\n\t\t\t\tif a[i]+a[i+1] == x {\n\t\t\t\t\tbreak\n\t\t\t\t} else if a[i+1] == 0 && a[i]+a[i+1] > x {\n\t\t\t\t\ta[i]--\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\tfmt.Print(ans)\n}", "language": "Go", "metadata": {"date": 1584593234, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03862.html", "problem_id": "p03862", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03862/input.txt", "sample_output_relpath": "derived/input_output/data/p03862/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03862/Go/s289810296.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s289810296", "user_id": "u831067059"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, x, ans int\n\tvar a []int\n\tvar scan int\n\n\tfmt.Scan(&n, &x)\n\ta = make([]int, n)\n\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Scan(&scan)\n\t\ta[i] = scan\n\t}\n\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tswitch {\n\t\tcase a[i]+a[i+1] > x:\n\t\t\tfor {\n\t\t\t\ta[i+1]--\n\t\t\t\tans++\n\t\t\t\tif a[i]+a[i+1] == x {\n\t\t\t\t\tbreak\n\t\t\t\t} else if a[i+1] == 0 && a[i]+a[i+1] > x {\n\t\t\t\t\ta[i]--\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\tfmt.Print(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N boxes arranged in a row.\nInitially, the i-th box from the left contains a_i candies.\n\nSnuke can perform the following operation any number of times:\n\nChoose a box containing at least one candy, and eat one of the candies in the chosen box.\n\nHis objective is as follows:\n\nAny two neighboring boxes contain at most x candies in total.\n\nFind the minimum number of operations required to achieve the objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n0 ≤ a_i ≤ 10^9\n\n0 ≤ x ≤ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of operations required to achieve the objective.\n\nSample Input 1\n\n3 3\n2 2 2\n\nSample Output 1\n\n1\n\nEat one candy in the second box.\nThen, the number of candies in each box becomes (2, 1, 2).\n\nSample Input 2\n\n6 1\n1 6 1 2 0 4\n\nSample Output 2\n\n11\n\nFor example, eat six candies in the second box, two in the fourth box, and three in the sixth box.\nThen, the number of candies in each box becomes (1, 0, 1, 0, 0, 1).\n\nSample Input 3\n\n5 9\n3 1 4 1 5\n\nSample Output 3\n\n0\n\nThe objective is already achieved without performing operations.\n\nSample Input 4\n\n2 0\n5 5\n\nSample Output 4\n\n10\n\nAll the candies need to be eaten.", "sample_input": "3 3\n2 2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03862", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N boxes arranged in a row.\nInitially, the i-th box from the left contains a_i candies.\n\nSnuke can perform the following operation any number of times:\n\nChoose a box containing at least one candy, and eat one of the candies in the chosen box.\n\nHis objective is as follows:\n\nAny two neighboring boxes contain at most x candies in total.\n\nFind the minimum number of operations required to achieve the objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n0 ≤ a_i ≤ 10^9\n\n0 ≤ x ≤ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum number of operations required to achieve the objective.\n\nSample Input 1\n\n3 3\n2 2 2\n\nSample Output 1\n\n1\n\nEat one candy in the second box.\nThen, the number of candies in each box becomes (2, 1, 2).\n\nSample Input 2\n\n6 1\n1 6 1 2 0 4\n\nSample Output 2\n\n11\n\nFor example, eat six candies in the second box, two in the fourth box, and three in the sixth box.\nThen, the number of candies in each box becomes (1, 0, 1, 0, 0, 1).\n\nSample Input 3\n\n5 9\n3 1 4 1 5\n\nSample Output 3\n\n0\n\nThe objective is already achieved without performing operations.\n\nSample Input 4\n\n2 0\n5 5\n\nSample Output 4\n\n10\n\nAll the candies need to be eaten.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 465, "cpu_time_ms": 2108, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s681565779", "group_id": "codeNet:p03880", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := NewScanner()\n\tN := next.Int()\n\ta, vec, G := make([]int, N), make([]bool, 32), 0\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = next.Int()\n\t\t\n\t\tG ^= a[i]\n\n\t\tfor j := uint(0); j < 32; j++ {\n\t\t\tif (a[i] >> j) % 2 == 1 {\n\t\t\t\tvec[j] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := uint(31); i > 0; i-- {\n\t\tif (G >> i) % 2 == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif vec[i] {\n\t\t\tG ^= (1 << i - 1)\n\t\t\tans++\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tif G % 2 == 1 {\n\t\tif !vec[0] {\n\t\t\tans = -1\n\t\t} else {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Scanner begin\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc NewScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Standard Functions begin\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(e, ret) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(ret, a) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc ModPow(x, n, mod int) int {\n\tret := 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\t\n\treturn ret\n}\n\nfunc ModPowInt64(x, n, mod int64) int64 {\n\tvar ret int64 = 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc IntComp(a, b interface{}) bool {\n\tna := a.(int)\n\tnb := b.(int)\n\n\treturn na < nb\n}\n\nfunc Int64Comp(a, b interface{}) bool {\n\tna := a.(int64)\n\tnb := b.(int64)\n\n\treturn na < nb\n}\n\nfunc FloatComp(a, b interface{}) bool {\n\tna := a.(float32)\n\tnb := b.(float32)\n\n\treturn na < nb\n}\n\nfunc Float64Comp(a, b interface{}) bool {\n\tna := a.(float64)\n\tnb := b.(float64)\n\n\treturn na < nb\n}\n\n// Standard Structs begin\n//1 Line Structs\ntype Merger func(a, b interface{}) interface{}\ntype Comparator func(a, b interface{}) bool\n\n// Pair begin\ntype pair struct {\n\tfirst, second int64\n}\n\nfunc Newpair() *pair {\n\treturn &pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p pair) Less(q pair) bool {\n\tif p.first < q.first {\n\t\treturn true\n\t} else if p.first == q.first {\n\t\treturn p.second < q.second\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc (p pair) String() string {\n\treturn fmt.Sprint(p.first, p.second)\n}\n\nfunc PairComp(p, q interface{}) bool {\n\tnp := p.(pair)\n\tnq := q.(pair)\n\n\treturn np.Less(nq)\n}\n\n// Priority Queue begin\n// Method\n// push : Push the value to the priority queue.\n// top : Return the (Min / Max) value in the priority queue.\n// pop : Delete the (Min / Max) value in the priority queue.\n// size : Return the number of values in the priority queue.\n// empty : Return Is priority queue has the values?\ntype PriorityQueue struct {\n\tdata\t[]interface{}\n\tcomp\tComparator\n}\n\nfunc NewPriorityQueue(comp Comparator) *PriorityQueue {\n\treturn &PriorityQueue{make([]interface{}, 0), comp}\n}\n\nfunc (qu *PriorityQueue) push(x interface{}) {\n\tn := len(qu.data)\n\tqu.data = append(qu.data, x)\n\n\tfor n != 0 {\n\t\tpar := (n - 1) / 2\n\t\t\n\t\tif qu.comp(qu.data[par], qu.data[n]) {\n\t\t\tqu.data[par], qu.data[n] = qu.data[n], qu.data[par]\n\t\t}\n\n\t\tn = par\n\t}\n}\n\nfunc (qu *PriorityQueue) pop() {\n\tn := len(qu.data) - 1\n\tqu.data[0] = qu.data[n]\n\tqu.data = qu.data[:n]\n\n\tfor i, j := 0, 1; j < n; {\n\t\tj = 2 * i + 1\n\n\t\tif (j != n - 1) && qu.comp(qu.data[j], qu.data[j + 1]) {\n\t\t\tj++\n\t\t}\n\n\t\tif qu.comp(qu.data[i], qu.data[j]) {\n\t\t\tqu.data[i], qu.data[j] = qu.data[j], qu.data[i]\n\t\t}\n\n\t\ti = j\n\t}\n}\n\nfunc (qu *PriorityQueue) top() interface{} {\n\treturn qu.data[0]\n}\n\nfunc (qu *PriorityQueue) size() int {\n\treturn len(qu.data)\n}\n\nfunc (qu *PriorityQueue) empty() bool {\n\treturn len(qu.data) == 0\n}\n\n//Segment Tree\n//update : Update k-th value of SegmentTree.data to x\n//get\t : Get the value in range [a, b)\ntype SegmentTree struct {\n\tdata\t[]interface{}\n\tid\t\tinterface{}\n\tsize\tint\n\tmerge\tMerger\n}\n\nfunc NewSegmentTree(n int, id interface{}, merge Merger) *SegmentTree {\n\tsz := 1\n\tfor sz < n {\n\t\tsz *= 2\n\t}\n\n\tdata := make([]interface{}, sz * 2 - 1)\n\tfor i := 0; i < sz * 2 - 1; i++ {\n\t\tdata[i] = id\n\t}\n\n\treturn &SegmentTree{data, id, sz, merge}\n}\n\nfunc (seg *SegmentTree) update(k int, x interface{}) {\n\tk += seg.size - 1;\n\tseg.data[k] = x\n\n\tfor k > 0 {\n\t\tk = (k - 1) / 2\n\n\t\tseg.data[k] = seg.merge(seg.data[2 * k + 1], seg.data[2 * k + 2])\n\t}\n}\n\nfunc (seg *SegmentTree) get(a, b int) interface{} {\n\treturn seg._get(a, b, 0, 0, seg.size)\n}\n\nfunc (seg *SegmentTree) _get(a, b, k, l, r int) interface{} {\n\tif b <= l || r <= a {\n\t\treturn seg.id\n\t}\n\n\tif a <= l && r <= b {\n\t\treturn seg.data[k]\n\t}\n\n\tL := seg._get(a, b, 2 * k + 1, l, (l + r) / 2)\n\tR := seg._get(a, b, 2 * k + 2, (l + r) / 2, r)\n\treturn seg.merge(L, R)\n}\n\nfunc (seg *SegmentTree) String() string {\n\treturn fmt.Sprint(seg.data[seg.size - 1:])\n}", "language": "Go", "metadata": {"date": 1531968380, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03880.html", "problem_id": "p03880", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03880/input.txt", "sample_output_relpath": "derived/input_output/data/p03880/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03880/Go/s681565779.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s681565779", "user_id": "u424655672"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := NewScanner()\n\tN := next.Int()\n\ta, vec, G := make([]int, N), make([]bool, 32), 0\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = next.Int()\n\t\t\n\t\tG ^= a[i]\n\n\t\tfor j := uint(0); j < 32; j++ {\n\t\t\tif (a[i] >> j) % 2 == 1 {\n\t\t\t\tvec[j] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := uint(31); i > 0; i-- {\n\t\tif (G >> i) % 2 == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif vec[i] {\n\t\t\tG ^= (1 << i - 1)\n\t\t\tans++\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tif G % 2 == 1 {\n\t\tif !vec[0] {\n\t\t\tans = -1\n\t\t} else {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Scanner begin\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc NewScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Standard Functions begin\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(e, ret) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(ret, a) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc ModPow(x, n, mod int) int {\n\tret := 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\t\n\treturn ret\n}\n\nfunc ModPowInt64(x, n, mod int64) int64 {\n\tvar ret int64 = 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc IntComp(a, b interface{}) bool {\n\tna := a.(int)\n\tnb := b.(int)\n\n\treturn na < nb\n}\n\nfunc Int64Comp(a, b interface{}) bool {\n\tna := a.(int64)\n\tnb := b.(int64)\n\n\treturn na < nb\n}\n\nfunc FloatComp(a, b interface{}) bool {\n\tna := a.(float32)\n\tnb := b.(float32)\n\n\treturn na < nb\n}\n\nfunc Float64Comp(a, b interface{}) bool {\n\tna := a.(float64)\n\tnb := b.(float64)\n\n\treturn na < nb\n}\n\n// Standard Structs begin\n//1 Line Structs\ntype Merger func(a, b interface{}) interface{}\ntype Comparator func(a, b interface{}) bool\n\n// Pair begin\ntype pair struct {\n\tfirst, second int64\n}\n\nfunc Newpair() *pair {\n\treturn &pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p pair) Less(q pair) bool {\n\tif p.first < q.first {\n\t\treturn true\n\t} else if p.first == q.first {\n\t\treturn p.second < q.second\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc (p pair) String() string {\n\treturn fmt.Sprint(p.first, p.second)\n}\n\nfunc PairComp(p, q interface{}) bool {\n\tnp := p.(pair)\n\tnq := q.(pair)\n\n\treturn np.Less(nq)\n}\n\n// Priority Queue begin\n// Method\n// push : Push the value to the priority queue.\n// top : Return the (Min / Max) value in the priority queue.\n// pop : Delete the (Min / Max) value in the priority queue.\n// size : Return the number of values in the priority queue.\n// empty : Return Is priority queue has the values?\ntype PriorityQueue struct {\n\tdata\t[]interface{}\n\tcomp\tComparator\n}\n\nfunc NewPriorityQueue(comp Comparator) *PriorityQueue {\n\treturn &PriorityQueue{make([]interface{}, 0), comp}\n}\n\nfunc (qu *PriorityQueue) push(x interface{}) {\n\tn := len(qu.data)\n\tqu.data = append(qu.data, x)\n\n\tfor n != 0 {\n\t\tpar := (n - 1) / 2\n\t\t\n\t\tif qu.comp(qu.data[par], qu.data[n]) {\n\t\t\tqu.data[par], qu.data[n] = qu.data[n], qu.data[par]\n\t\t}\n\n\t\tn = par\n\t}\n}\n\nfunc (qu *PriorityQueue) pop() {\n\tn := len(qu.data) - 1\n\tqu.data[0] = qu.data[n]\n\tqu.data = qu.data[:n]\n\n\tfor i, j := 0, 1; j < n; {\n\t\tj = 2 * i + 1\n\n\t\tif (j != n - 1) && qu.comp(qu.data[j], qu.data[j + 1]) {\n\t\t\tj++\n\t\t}\n\n\t\tif qu.comp(qu.data[i], qu.data[j]) {\n\t\t\tqu.data[i], qu.data[j] = qu.data[j], qu.data[i]\n\t\t}\n\n\t\ti = j\n\t}\n}\n\nfunc (qu *PriorityQueue) top() interface{} {\n\treturn qu.data[0]\n}\n\nfunc (qu *PriorityQueue) size() int {\n\treturn len(qu.data)\n}\n\nfunc (qu *PriorityQueue) empty() bool {\n\treturn len(qu.data) == 0\n}\n\n//Segment Tree\n//update : Update k-th value of SegmentTree.data to x\n//get\t : Get the value in range [a, b)\ntype SegmentTree struct {\n\tdata\t[]interface{}\n\tid\t\tinterface{}\n\tsize\tint\n\tmerge\tMerger\n}\n\nfunc NewSegmentTree(n int, id interface{}, merge Merger) *SegmentTree {\n\tsz := 1\n\tfor sz < n {\n\t\tsz *= 2\n\t}\n\n\tdata := make([]interface{}, sz * 2 - 1)\n\tfor i := 0; i < sz * 2 - 1; i++ {\n\t\tdata[i] = id\n\t}\n\n\treturn &SegmentTree{data, id, sz, merge}\n}\n\nfunc (seg *SegmentTree) update(k int, x interface{}) {\n\tk += seg.size - 1;\n\tseg.data[k] = x\n\n\tfor k > 0 {\n\t\tk = (k - 1) / 2\n\n\t\tseg.data[k] = seg.merge(seg.data[2 * k + 1], seg.data[2 * k + 2])\n\t}\n}\n\nfunc (seg *SegmentTree) get(a, b int) interface{} {\n\treturn seg._get(a, b, 0, 0, seg.size)\n}\n\nfunc (seg *SegmentTree) _get(a, b, k, l, r int) interface{} {\n\tif b <= l || r <= a {\n\t\treturn seg.id\n\t}\n\n\tif a <= l && r <= b {\n\t\treturn seg.data[k]\n\t}\n\n\tL := seg._get(a, b, 2 * k + 1, l, (l + r) / 2)\n\tR := seg._get(a, b, 2 * k + 2, (l + r) / 2, r)\n\treturn seg.merge(L, R)\n}\n\nfunc (seg *SegmentTree) String() string {\n\treturn fmt.Sprint(seg.data[seg.size - 1:])\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nA cheetah and a cheater are going to play the game of Nim.\nIn this game they use N piles of stones.\nInitially the i-th pile contains a_i stones.\nThe players take turns alternately, and the cheetah plays first.\nIn each turn, the player chooses one of the piles, and takes one or more stones from the pile.\nThe player who can't make a move loses.\n\nHowever, before the game starts, the cheater wants to cheat a bit to make sure that he can win regardless of the moves by the cheetah.\nFrom each pile, the cheater takes zero or one stone and eats it before the game.\nIn case there are multiple ways to guarantee his winning, he wants to minimize the number of stones he eats.\n\nCompute the number of stones the cheater will eat.\nIn case there is no way for the cheater to win the game even with the cheating, print -1 instead.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n2 ≤ a_i ≤ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1\n:\na_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n4\n\nSample Output 1\n\n3\n\nThe only way for the cheater to win the game is to take stones from all piles and eat them.\n\nSample Input 2\n\n3\n100\n100\n100\n\nSample Output 2\n\n-1", "sample_input": "3\n2\n3\n4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03880", "source_text": "Score : 500 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nA cheetah and a cheater are going to play the game of Nim.\nIn this game they use N piles of stones.\nInitially the i-th pile contains a_i stones.\nThe players take turns alternately, and the cheetah plays first.\nIn each turn, the player chooses one of the piles, and takes one or more stones from the pile.\nThe player who can't make a move loses.\n\nHowever, before the game starts, the cheater wants to cheat a bit to make sure that he can win regardless of the moves by the cheetah.\nFrom each pile, the cheater takes zero or one stone and eats it before the game.\nIn case there are multiple ways to guarantee his winning, he wants to minimize the number of stones he eats.\n\nCompute the number of stones the cheater will eat.\nIn case there is no way for the cheater to win the game even with the cheating, print -1 instead.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n2 ≤ a_i ≤ 10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1\n:\na_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n2\n3\n4\n\nSample Output 1\n\n3\n\nThe only way for the cheater to win the game is to take stones from all piles and eat them.\n\nSample Input 2\n\n3\n100\n100\n100\n\nSample Output 2\n\n-1", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7352, "cpu_time_ms": 38, "memory_kb": 4608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s598655131", "group_id": "codeNet:p03919", "input_text": "package main\n\nimport(\n \"fmt\"\n \"bufio\"\n \"os\"\n \"sort\"\n \"strings\"\n \"strconv\"\n)\n\n\n\nfunc main() {\n var h,w int\n fmt.Scan(&h,&w)\n x,y := 0,0\n for i:=0;i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd64(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd64(b, a%b)\n }\n}\n\nfunc lcm64(a, b int64) int64 {\n return a / gcd64(a, b) * b\n}\n\n// 入力処理\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc readLineNums(len int) (nums []int){\n for i:=0; i=0 && h=0 && w= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd64(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd64(b, a%b)\n }\n}\n\nfunc lcm64(a, b int64) int64 {\n return a / gcd64(a, b) * b\n}\n\n// 入力処理\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc readLineNums(len int) (nums []int){\n for i:=0; i=0 && h=0 && w lang -> bool\n\tplanet := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\tplanet[i] = make(map[int]bool)\n\t\tvar langs int\n\t\tfmt.Fscan(r, &langs)\n\t\tfor j := 0; j < langs; j++ {\n\t\t\tvar lang int\n\t\t\tfmt.Fscan(r, &lang)\n\t\t\tplanet[i][lang] = true\n\t\t}\n\t}\n\n\tif communicatable(planet, n) {\n\t\tfmt.Fprintln(w, \"YES\")\n\t} else {\n\t\tfmt.Fprintln(w, \"NO\")\n\t}\n}\n\nfunc communicatable(planet map[int]map[int]bool, n int) bool {\n\t// p1 -> p2 -> bool\n\ttable := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\ttable[i] = make(map[int]bool)\n\t}\n\n\tfor p1, langs1 := range planet {\n\tP:\n\t\tfor p2, langs2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor l2 := range langs2 {\n\t\t\t\tif _, ok := langs1[l2]; ok {\n\t\t\t\t\ttable[p1][p2] = true\n\t\t\t\t\ttable[p2][p1] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor {\n\t\tend, i := canCommunicateWithX(planet, table)\n\t\tif end {\n\t\t\treturn true\n\t\t}\n\t\tif i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc canCommunicateWithX(planet map[int]map[int]bool, table map[int]map[int]bool) (bool, int) {\n\tnewtable := make(map[int]map[int]bool)\n\tfor i := 0; i < len(table); i++ {\n\t\tnewtable[i] = make(map[int]bool)\n\t}\n\tnew := 0\n\tend := true\n\tfor p1 := range planet {\n\tP:\n\t\tfor p2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tif _, ok := table[p1][p2]; ok {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor px1 := range table[p1] {\n\t\t\t\tif _, ok := table[p2][px1]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor px2 := range table[p2] {\n\t\t\t\tif _, ok := table[p1][px2]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tend = false\n\t\t}\n\t}\n\t// update table\n\tfor p1, ps := range newtable {\n\t\tfor p2 := range ps {\n\t\t\ttable[p1][p2] = true\n\t\t\ttable[p2][p1] = true\n\t\t}\n\t}\n\treturn end, new\n}\n\nfunc genRange(i, j int) []int {\n\trs := make([]int, 0, j-i)\n\tfor ; i < j; i++ {\n\t\trs = append(rs, i)\n\t}\n\treturn rs\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6`,\n\t\t\twant: `YES\n`,\n\t\t},\n\t\t{\n\t\t\tin: `4 4\n2 1 2\n2 1 2\n1 3\n2 4 3`,\n\t\t\twant: `NO\n`,\n\t\t},\n\t}\n\tfor i, tt := range tests {\n\t\tfmt.Printf(\"=== TEST %d\\n\", i)\n\t\tbuf := new(bytes.Buffer)\n\t\tsolve(strings.NewReader(tt.in), buf)\n\t\tif got := buf.String(); got != tt.want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, tt.want)\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1480190951, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03921.html", "problem_id": "p03921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03921/input.txt", "sample_output_relpath": "derived/input_output/data/p03921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03921/Go/s553928712.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s553928712", "user_id": "u755406270"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tif false {\n\t\ttest()\n\t} else {\n\t\tsolve(os.Stdin, os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int // number of participants\n\tvar m int // number of languages\n\tfmt.Fscanln(r, &n, &m)\n\t// planet: paticipant -> lang -> bool\n\tplanet := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\tplanet[i] = make(map[int]bool)\n\t\tvar langs int\n\t\tfmt.Fscan(r, &langs)\n\t\tfor j := 0; j < langs; j++ {\n\t\t\tvar lang int\n\t\t\tfmt.Fscan(r, &lang)\n\t\t\tplanet[i][lang] = true\n\t\t}\n\t}\n\n\tif communicatable(planet, n) {\n\t\tfmt.Fprintln(w, \"YES\")\n\t} else {\n\t\tfmt.Fprintln(w, \"NO\")\n\t}\n}\n\nfunc communicatable(planet map[int]map[int]bool, n int) bool {\n\t// p1 -> p2 -> bool\n\ttable := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\ttable[i] = make(map[int]bool)\n\t}\n\n\tfor p1, langs1 := range planet {\n\tP:\n\t\tfor p2, langs2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor l2 := range langs2 {\n\t\t\t\tif _, ok := langs1[l2]; ok {\n\t\t\t\t\ttable[p1][p2] = true\n\t\t\t\t\ttable[p2][p1] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor {\n\t\tend, i := canCommunicateWithX(planet, table)\n\t\tif end {\n\t\t\treturn true\n\t\t}\n\t\tif i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc canCommunicateWithX(planet map[int]map[int]bool, table map[int]map[int]bool) (bool, int) {\n\tnewtable := make(map[int]map[int]bool)\n\tfor i := 0; i < len(table); i++ {\n\t\tnewtable[i] = make(map[int]bool)\n\t}\n\tnew := 0\n\tend := true\n\tfor p1 := range planet {\n\tP:\n\t\tfor p2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tif _, ok := table[p1][p2]; ok {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor px1 := range table[p1] {\n\t\t\t\tif _, ok := table[p2][px1]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor px2 := range table[p2] {\n\t\t\t\tif _, ok := table[p1][px2]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tend = false\n\t\t}\n\t}\n\t// update table\n\tfor p1, ps := range newtable {\n\t\tfor p2 := range ps {\n\t\t\ttable[p1][p2] = true\n\t\t\ttable[p2][p1] = true\n\t\t}\n\t}\n\treturn end, new\n}\n\nfunc genRange(i, j int) []int {\n\trs := make([]int, 0, j-i)\n\tfor ; i < j; i++ {\n\t\trs = append(rs, i)\n\t}\n\treturn rs\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6`,\n\t\t\twant: `YES\n`,\n\t\t},\n\t\t{\n\t\t\tin: `4 4\n2 1 2\n2 1 2\n1 3\n2 4 3`,\n\t\t\twant: `NO\n`,\n\t\t},\n\t}\n\tfor i, tt := range tests {\n\t\tfmt.Printf(\"=== TEST %d\\n\", i)\n\t\tbuf := new(bytes.Buffer)\n\t\tsolve(strings.NewReader(tt.in), buf)\n\t\tif got := buf.String(); got != tt.want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, tt.want)\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOn a planet far, far away, M languages are spoken. They are conveniently numbered 1 through M.\n\nFor CODE FESTIVAL 20XX held on this planet, N participants gathered from all over the planet.\n\nThe i-th (1≦i≦N) participant can speak K_i languages numbered L_{i,1}, L_{i,2}, ..., L_{i,{}K_i}.\n\nTwo participants A and B can communicate with each other if and only if one of the following conditions is satisfied:\n\nThere exists a language that both A and B can speak.\n\nThere exists a participant X that both A and B can communicate with.\n\nDetermine whether all N participants can communicate with all other participants.\n\nConstraints\n\n2≦N≦10^5\n\n1≦M≦10^5\n\n1≦K_i≦M\n\n(The sum of all K_i)≦10^5\n\n1≦L_{i,j}≦M\n\nL_{i,1}, L_{i,2}, ..., L_{i,{}K_i} are pairwise distinct.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying the following: N≦1000, M≦1000 and (The sum of all K_i)≦1000.\n\nAdditional 200 points will be awarded for passing the test set without additional constraints.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nK_1 L_{1,1} L_{1,2} ... L_{1,{}K_1}\nK_2 L_{2,1} L_{2,2} ... L_{2,{}K_2}\n:\nK_N L_{N,1} L_{N,2} ... L_{N,{}K_N}\n\nOutput\n\nIf all N participants can communicate with all other participants, print YES. Otherwise, print NO.\n\nSample Input 1\n\n4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n\nSample Output 1\n\nYES\n\nAny two participants can communicate with each other, as follows:\n\nParticipants 1 and 2: both can speak language 2.\n\nParticipants 2 and 3: both can speak language 4.\n\nParticipants 1 and 3: both can communicate with participant 2.\n\nParticipants 3 and 4: both can speak language 6.\n\nParticipants 2 and 4: both can communicate with participant 3.\n\nParticipants 1 and 4: both can communicate with participant 2.\n\nNote that there can be languages spoken by no participant.\n\nSample Input 2\n\n4 4\n2 1 2\n2 1 2\n1 3\n2 4 3\n\nSample Output 2\n\nNO\n\nFor example, participants 1 and 3 cannot communicate with each other.", "sample_input": "4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03921", "source_text": "Score : 400 points\n\nProblem Statement\n\nOn a planet far, far away, M languages are spoken. They are conveniently numbered 1 through M.\n\nFor CODE FESTIVAL 20XX held on this planet, N participants gathered from all over the planet.\n\nThe i-th (1≦i≦N) participant can speak K_i languages numbered L_{i,1}, L_{i,2}, ..., L_{i,{}K_i}.\n\nTwo participants A and B can communicate with each other if and only if one of the following conditions is satisfied:\n\nThere exists a language that both A and B can speak.\n\nThere exists a participant X that both A and B can communicate with.\n\nDetermine whether all N participants can communicate with all other participants.\n\nConstraints\n\n2≦N≦10^5\n\n1≦M≦10^5\n\n1≦K_i≦M\n\n(The sum of all K_i)≦10^5\n\n1≦L_{i,j}≦M\n\nL_{i,1}, L_{i,2}, ..., L_{i,{}K_i} are pairwise distinct.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying the following: N≦1000, M≦1000 and (The sum of all K_i)≦1000.\n\nAdditional 200 points will be awarded for passing the test set without additional constraints.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nK_1 L_{1,1} L_{1,2} ... L_{1,{}K_1}\nK_2 L_{2,1} L_{2,2} ... L_{2,{}K_2}\n:\nK_N L_{N,1} L_{N,2} ... L_{N,{}K_N}\n\nOutput\n\nIf all N participants can communicate with all other participants, print YES. Otherwise, print NO.\n\nSample Input 1\n\n4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n\nSample Output 1\n\nYES\n\nAny two participants can communicate with each other, as follows:\n\nParticipants 1 and 2: both can speak language 2.\n\nParticipants 2 and 3: both can speak language 4.\n\nParticipants 1 and 3: both can communicate with participant 2.\n\nParticipants 3 and 4: both can speak language 6.\n\nParticipants 2 and 4: both can communicate with participant 3.\n\nParticipants 1 and 4: both can communicate with participant 2.\n\nNote that there can be languages spoken by no participant.\n\nSample Input 2\n\n4 4\n2 1 2\n2 1 2\n1 3\n2 4 3\n\nSample Output 2\n\nNO\n\nFor example, participants 1 and 3 cannot communicate with each other.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2590, "cpu_time_ms": 2108, "memory_kb": 90752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s294185970", "group_id": "codeNet:p03921", "input_text": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tif true {\n\t\ttest()\n\t} else {\n\t\tsolve(os.Stdin, os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int // number of participants\n\tvar m int // number of languages\n\tfmt.Fscanln(r, &n, &m)\n\t// planet: paticipant -> lang -> bool\n\tplanet := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\tplanet[i] = make(map[int]bool)\n\t\tvar langs int\n\t\tfmt.Fscan(r, &langs)\n\t\tfor j := 0; j < langs; j++ {\n\t\t\tvar lang int\n\t\t\tfmt.Fscan(r, &lang)\n\t\t\tplanet[i][lang] = true\n\t\t}\n\t}\n\n\tif communicatable(planet, n) {\n\t\tfmt.Fprintln(w, \"YES\")\n\t} else {\n\t\tfmt.Fprintln(w, \"NO\")\n\t}\n}\n\nfunc communicatable(planet map[int]map[int]bool, n int) bool {\n\t// p1 -> p2 -> bool\n\ttable := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\ttable[i] = make(map[int]bool)\n\t}\n\n\tfor p1, langs1 := range planet {\n\tP:\n\t\tfor p2, langs2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor l2 := range langs2 {\n\t\t\t\tif _, ok := langs1[l2]; ok {\n\t\t\t\t\ttable[p1][p2] = true\n\t\t\t\t\ttable[p2][p1] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor {\n\t\tend, i := canCommunicateWithX(planet, table)\n\t\tif end {\n\t\t\treturn true\n\t\t}\n\t\tif i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc canCommunicateWithX(planet map[int]map[int]bool, table map[int]map[int]bool) (bool, int) {\n\tnewtable := make(map[int]map[int]bool)\n\tfor i := 0; i < len(table); i++ {\n\t\tnewtable[i] = make(map[int]bool)\n\t}\n\tnew := 0\n\tend := true\n\tfor p1 := range planet {\n\tP:\n\t\tfor p2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tif _, ok := table[p1][p2]; ok {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor px1 := range table[p1] {\n\t\t\t\tif _, ok := table[p2][px1]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor px2 := range table[p2] {\n\t\t\t\tif _, ok := table[p1][px2]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tend = false\n\t\t}\n\t}\n\t// update table\n\tfor p1, ps := range newtable {\n\t\tfor p2 := range ps {\n\t\t\ttable[p1][p2] = true\n\t\t\ttable[p2][p1] = true\n\t\t}\n\t}\n\treturn end, new\n}\n\nfunc genRange(i, j int) []int {\n\trs := make([]int, 0, j-i)\n\tfor ; i < j; i++ {\n\t\trs = append(rs, i)\n\t}\n\treturn rs\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6`,\n\t\t\twant: `YES\n`,\n\t\t},\n\t\t{\n\t\t\tin: `4 4\n2 1 2\n2 1 2\n1 3\n2 4 3`,\n\t\t\twant: `NO\n`,\n\t\t},\n\t}\n\tfor i, tt := range tests {\n\t\tfmt.Printf(\"=== TEST %d\\n\", i)\n\t\tbuf := new(bytes.Buffer)\n\t\tsolve(strings.NewReader(tt.in), buf)\n\t\tif got := buf.String(); got != tt.want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, tt.want)\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1480190861, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03921.html", "problem_id": "p03921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03921/input.txt", "sample_output_relpath": "derived/input_output/data/p03921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03921/Go/s294185970.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s294185970", "user_id": "u755406270"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tif true {\n\t\ttest()\n\t} else {\n\t\tsolve(os.Stdin, os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int // number of participants\n\tvar m int // number of languages\n\tfmt.Fscanln(r, &n, &m)\n\t// planet: paticipant -> lang -> bool\n\tplanet := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\tplanet[i] = make(map[int]bool)\n\t\tvar langs int\n\t\tfmt.Fscan(r, &langs)\n\t\tfor j := 0; j < langs; j++ {\n\t\t\tvar lang int\n\t\t\tfmt.Fscan(r, &lang)\n\t\t\tplanet[i][lang] = true\n\t\t}\n\t}\n\n\tif communicatable(planet, n) {\n\t\tfmt.Fprintln(w, \"YES\")\n\t} else {\n\t\tfmt.Fprintln(w, \"NO\")\n\t}\n}\n\nfunc communicatable(planet map[int]map[int]bool, n int) bool {\n\t// p1 -> p2 -> bool\n\ttable := make(map[int]map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\ttable[i] = make(map[int]bool)\n\t}\n\n\tfor p1, langs1 := range planet {\n\tP:\n\t\tfor p2, langs2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor l2 := range langs2 {\n\t\t\t\tif _, ok := langs1[l2]; ok {\n\t\t\t\t\ttable[p1][p2] = true\n\t\t\t\t\ttable[p2][p1] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor {\n\t\tend, i := canCommunicateWithX(planet, table)\n\t\tif end {\n\t\t\treturn true\n\t\t}\n\t\tif i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc canCommunicateWithX(planet map[int]map[int]bool, table map[int]map[int]bool) (bool, int) {\n\tnewtable := make(map[int]map[int]bool)\n\tfor i := 0; i < len(table); i++ {\n\t\tnewtable[i] = make(map[int]bool)\n\t}\n\tnew := 0\n\tend := true\n\tfor p1 := range planet {\n\tP:\n\t\tfor p2 := range planet {\n\t\t\tif !(p1 < p2) {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tif _, ok := table[p1][p2]; ok {\n\t\t\t\tcontinue P\n\t\t\t}\n\t\t\tfor px1 := range table[p1] {\n\t\t\t\tif _, ok := table[p2][px1]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor px2 := range table[p2] {\n\t\t\t\tif _, ok := table[p1][px2]; ok {\n\t\t\t\t\tnew++\n\t\t\t\t\tnewtable[p1][p2] = true\n\t\t\t\t\tcontinue P\n\t\t\t\t}\n\t\t\t}\n\t\t\tend = false\n\t\t}\n\t}\n\t// update table\n\tfor p1, ps := range newtable {\n\t\tfor p2 := range ps {\n\t\t\ttable[p1][p2] = true\n\t\t\ttable[p2][p1] = true\n\t\t}\n\t}\n\treturn end, new\n}\n\nfunc genRange(i, j int) []int {\n\trs := make([]int, 0, j-i)\n\tfor ; i < j; i++ {\n\t\trs = append(rs, i)\n\t}\n\treturn rs\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6`,\n\t\t\twant: `YES\n`,\n\t\t},\n\t\t{\n\t\t\tin: `4 4\n2 1 2\n2 1 2\n1 3\n2 4 3`,\n\t\t\twant: `NO\n`,\n\t\t},\n\t}\n\tfor i, tt := range tests {\n\t\tfmt.Printf(\"=== TEST %d\\n\", i)\n\t\tbuf := new(bytes.Buffer)\n\t\tsolve(strings.NewReader(tt.in), buf)\n\t\tif got := buf.String(); got != tt.want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, tt.want)\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOn a planet far, far away, M languages are spoken. They are conveniently numbered 1 through M.\n\nFor CODE FESTIVAL 20XX held on this planet, N participants gathered from all over the planet.\n\nThe i-th (1≦i≦N) participant can speak K_i languages numbered L_{i,1}, L_{i,2}, ..., L_{i,{}K_i}.\n\nTwo participants A and B can communicate with each other if and only if one of the following conditions is satisfied:\n\nThere exists a language that both A and B can speak.\n\nThere exists a participant X that both A and B can communicate with.\n\nDetermine whether all N participants can communicate with all other participants.\n\nConstraints\n\n2≦N≦10^5\n\n1≦M≦10^5\n\n1≦K_i≦M\n\n(The sum of all K_i)≦10^5\n\n1≦L_{i,j}≦M\n\nL_{i,1}, L_{i,2}, ..., L_{i,{}K_i} are pairwise distinct.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying the following: N≦1000, M≦1000 and (The sum of all K_i)≦1000.\n\nAdditional 200 points will be awarded for passing the test set without additional constraints.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nK_1 L_{1,1} L_{1,2} ... L_{1,{}K_1}\nK_2 L_{2,1} L_{2,2} ... L_{2,{}K_2}\n:\nK_N L_{N,1} L_{N,2} ... L_{N,{}K_N}\n\nOutput\n\nIf all N participants can communicate with all other participants, print YES. Otherwise, print NO.\n\nSample Input 1\n\n4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n\nSample Output 1\n\nYES\n\nAny two participants can communicate with each other, as follows:\n\nParticipants 1 and 2: both can speak language 2.\n\nParticipants 2 and 3: both can speak language 4.\n\nParticipants 1 and 3: both can communicate with participant 2.\n\nParticipants 3 and 4: both can speak language 6.\n\nParticipants 2 and 4: both can communicate with participant 3.\n\nParticipants 1 and 4: both can communicate with participant 2.\n\nNote that there can be languages spoken by no participant.\n\nSample Input 2\n\n4 4\n2 1 2\n2 1 2\n1 3\n2 4 3\n\nSample Output 2\n\nNO\n\nFor example, participants 1 and 3 cannot communicate with each other.", "sample_input": "4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03921", "source_text": "Score : 400 points\n\nProblem Statement\n\nOn a planet far, far away, M languages are spoken. They are conveniently numbered 1 through M.\n\nFor CODE FESTIVAL 20XX held on this planet, N participants gathered from all over the planet.\n\nThe i-th (1≦i≦N) participant can speak K_i languages numbered L_{i,1}, L_{i,2}, ..., L_{i,{}K_i}.\n\nTwo participants A and B can communicate with each other if and only if one of the following conditions is satisfied:\n\nThere exists a language that both A and B can speak.\n\nThere exists a participant X that both A and B can communicate with.\n\nDetermine whether all N participants can communicate with all other participants.\n\nConstraints\n\n2≦N≦10^5\n\n1≦M≦10^5\n\n1≦K_i≦M\n\n(The sum of all K_i)≦10^5\n\n1≦L_{i,j}≦M\n\nL_{i,1}, L_{i,2}, ..., L_{i,{}K_i} are pairwise distinct.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying the following: N≦1000, M≦1000 and (The sum of all K_i)≦1000.\n\nAdditional 200 points will be awarded for passing the test set without additional constraints.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nK_1 L_{1,1} L_{1,2} ... L_{1,{}K_1}\nK_2 L_{2,1} L_{2,2} ... L_{2,{}K_2}\n:\nK_N L_{N,1} L_{N,2} ... L_{N,{}K_N}\n\nOutput\n\nIf all N participants can communicate with all other participants, print YES. Otherwise, print NO.\n\nSample Input 1\n\n4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n\nSample Output 1\n\nYES\n\nAny two participants can communicate with each other, as follows:\n\nParticipants 1 and 2: both can speak language 2.\n\nParticipants 2 and 3: both can speak language 4.\n\nParticipants 1 and 3: both can communicate with participant 2.\n\nParticipants 3 and 4: both can speak language 6.\n\nParticipants 2 and 4: both can communicate with participant 3.\n\nParticipants 1 and 4: both can communicate with participant 2.\n\nNote that there can be languages spoken by no participant.\n\nSample Input 2\n\n4 4\n2 1 2\n2 1 2\n1 3\n2 4 3\n\nSample Output 2\n\nNO\n\nFor example, participants 1 and 3 cannot communicate with each other.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2589, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s024650030", "group_id": "codeNet:p03937", "input_text": "package main\n\nimport \"fmt\"\n\nvar table [][]string\n\ntype Pos struct {\n\ty, x int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\ttable = make([][]string, h)\n\tfor i := 0; i < h; i++ {\n\t\ttable[i] = make([]string, w)\n\t\tvar m string\n\t\tfmt.Scan(&m)\n\t\tfor j := 0; j < w; j++ {\n\t\t\ttable[i][j] = string([]rune(m)[j])\n\t\t}\n\t}\n\tif table[0][0] == \".\" || table[h-1][w-1] == \".\" {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\tqueue := []Pos{}\n\tqueue = append(queue, Pos{y: 0, x: 0})\n\tfor len(queue) > 0 {\n\t\tvar cur Pos\n\t\tcur, queue = queue[len(queue)-1], queue[:len(queue)-1]\n\t\ttable[cur.y][cur.x] = \".\"\n\t\tif cur.y == h-1 && cur.x == w-1 {\n\t\t\tbreak\n\t\t}\n\t\tsteps := []int{0, 1, 0}\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tnext_y, next_x := cur.y+steps[i], cur.x+steps[i+1]\n\t\t\tif 0 <= next_y && next_y < h && 0 <= next_x && next_x < w {\n\t\t\t\tif table[next_y][next_x] == \"#\" {\n\t\t\t\t\tnext_Pos := Pos{next_y, next_x}\n\t\t\t\t\tqueue = append(queue, next_Pos)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor y := 0; y < h; y++ {\n\t\tfor x := 0; x < w; x++ {\n\t\t\tif table[y][x] == \"#\" {\n\t\t\t\tfmt.Println(\"Impossible\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Possible\")\n}\n", "language": "Go", "metadata": {"date": 1586462412, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03937.html", "problem_id": "p03937", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03937/input.txt", "sample_output_relpath": "derived/input_output/data/p03937/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03937/Go/s024650030.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s024650030", "user_id": "u445624660"}, "prompt_components": {"gold_output": "Possible\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar table [][]string\n\ntype Pos struct {\n\ty, x int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\ttable = make([][]string, h)\n\tfor i := 0; i < h; i++ {\n\t\ttable[i] = make([]string, w)\n\t\tvar m string\n\t\tfmt.Scan(&m)\n\t\tfor j := 0; j < w; j++ {\n\t\t\ttable[i][j] = string([]rune(m)[j])\n\t\t}\n\t}\n\tif table[0][0] == \".\" || table[h-1][w-1] == \".\" {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\tqueue := []Pos{}\n\tqueue = append(queue, Pos{y: 0, x: 0})\n\tfor len(queue) > 0 {\n\t\tvar cur Pos\n\t\tcur, queue = queue[len(queue)-1], queue[:len(queue)-1]\n\t\ttable[cur.y][cur.x] = \".\"\n\t\tif cur.y == h-1 && cur.x == w-1 {\n\t\t\tbreak\n\t\t}\n\t\tsteps := []int{0, 1, 0}\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tnext_y, next_x := cur.y+steps[i], cur.x+steps[i+1]\n\t\t\tif 0 <= next_y && next_y < h && 0 <= next_x && next_x < w {\n\t\t\t\tif table[next_y][next_x] == \"#\" {\n\t\t\t\t\tnext_Pos := Pos{next_y, next_x}\n\t\t\t\t\tqueue = append(queue, next_Pos)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor y := 0; y < h; y++ {\n\t\tfor x := 0; x < w; x++ {\n\t\t\tif table[y][x] == \"#\" {\n\t\t\t\tfmt.Println(\"Impossible\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Possible\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nWe have a grid of H rows and W columns. Initially, there is a stone in the top left cell. Shik is trying to move the stone to the bottom right cell. In each step, he can move the stone one cell to its left, up, right, or down (if such cell exists). It is possible that the stone visits a cell multiple times (including the bottom right and the top left cell).\n\nYou are given a matrix of characters a_{ij} (1 \\leq i \\leq H, 1 \\leq j \\leq W). After Shik completes all moving actions, a_{ij} is # if the stone had ever located at the i-th row and the j-th column during the process of moving. Otherwise, a_{ij} is .. Please determine whether it is possible that Shik only uses right and down moves in all steps.\n\nConstraints\n\n2 \\leq H, W \\leq 8\n\na_{i,j} is either # or ..\n\nThere exists a valid sequence of moves for Shik to generate the map a.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\na_{11}a_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf it is possible that Shik only uses right and down moves, print Possible. Otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n##...\n.##..\n..##.\n...##\n\nSample Output 1\n\nPossible\n\nThe matrix can be generated by a 7-move sequence: right, down, right, down, right, down, and right.\n\nSample Input 2\n\n5 3\n###\n..#\n###\n#..\n###\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n4 5\n##...\n.###.\n.###.\n...##\n\nSample Output 3\n\nImpossible", "sample_input": "4 5\n##...\n.##..\n..##.\n...##\n"}, "reference_outputs": ["Possible\n"], "source_document_id": "p03937", "source_text": "Score : 200 points\n\nProblem Statement\n\n#nck {\nwidth: 30px;\nheight: auto;\n}\n\nWe have a grid of H rows and W columns. Initially, there is a stone in the top left cell. Shik is trying to move the stone to the bottom right cell. In each step, he can move the stone one cell to its left, up, right, or down (if such cell exists). It is possible that the stone visits a cell multiple times (including the bottom right and the top left cell).\n\nYou are given a matrix of characters a_{ij} (1 \\leq i \\leq H, 1 \\leq j \\leq W). After Shik completes all moving actions, a_{ij} is # if the stone had ever located at the i-th row and the j-th column during the process of moving. Otherwise, a_{ij} is .. Please determine whether it is possible that Shik only uses right and down moves in all steps.\n\nConstraints\n\n2 \\leq H, W \\leq 8\n\na_{i,j} is either # or ..\n\nThere exists a valid sequence of moves for Shik to generate the map a.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\na_{11}a_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf it is possible that Shik only uses right and down moves, print Possible. Otherwise, print Impossible.\n\nSample Input 1\n\n4 5\n##...\n.##..\n..##.\n...##\n\nSample Output 1\n\nPossible\n\nThe matrix can be generated by a 7-move sequence: right, down, right, down, right, down, and right.\n\nSample Input 2\n\n5 3\n###\n..#\n###\n#..\n###\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n4 5\n##...\n.###.\n.###.\n...##\n\nSample Output 3\n\nImpossible", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1094, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s303399581", "group_id": "codeNet:p03943", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := getInt()\n\tb := getInt()\n\tc := getInt()\n\n\tma := max(a, max(b, c))\n\tsu := 0\n\tif ma == a {\n\t\tsu = b + c\n\t} else if ma == b {\n\t\tsu = a + c\n\t} else {\n\t\tsu = a + b\n\t}\n\n\tif ma == su {\n\t\tout(\"Yes\")\n\t} else {\n\t\tout(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1580264650, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03943.html", "problem_id": "p03943", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03943/input.txt", "sample_output_relpath": "derived/input_output/data/p03943/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03943/Go/s303399581.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s303399581", "user_id": "u814575783"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := getInt()\n\tb := getInt()\n\tc := getInt()\n\n\tma := max(a, max(b, c))\n\tsu := 0\n\tif ma == a {\n\t\tsu = b + c\n\t} else if ma == b {\n\t\tsu = a + c\n\t} else {\n\t\tsu = a + b\n\t}\n\n\tif ma == su {\n\t\tout(\"Yes\")\n\t} else {\n\t\tout(\"No\")\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTwo students of AtCoder Kindergarten are fighting over candy packs.\n\nThere are three candy packs, each of which contains a, b, and c candies, respectively.\n\nTeacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible.\n\nNote that Evi cannot take candies out of the packs, and the whole contents of each pack must be given to one of the students.\n\nConstraints\n\n1 ≦ a, b, c ≦ 100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nIf it is possible to distribute the packs so that each student gets the same number of candies, print Yes. Otherwise, print No.\n\nSample Input 1\n\n10 30 20\n\nSample Output 1\n\nYes\n\nGive the pack with 30 candies to one student, and give the two packs with 10 and 20 candies to the other. Then, each gets 30 candies.\n\nSample Input 2\n\n30 30 100\n\nSample Output 2\n\nNo\n\nIn this case, the student who gets the pack with 100 candies always has more candies than the other.\n\nNote that every pack must be given to one of them.\n\nSample Input 3\n\n56 25 31\n\nSample Output 3\n\nYes", "sample_input": "10 30 20\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03943", "source_text": "Score : 100 points\n\nProblem Statement\n\nTwo students of AtCoder Kindergarten are fighting over candy packs.\n\nThere are three candy packs, each of which contains a, b, and c candies, respectively.\n\nTeacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible.\n\nNote that Evi cannot take candies out of the packs, and the whole contents of each pack must be given to one of the students.\n\nConstraints\n\n1 ≦ a, b, c ≦ 100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nIf it is possible to distribute the packs so that each student gets the same number of candies, print Yes. Otherwise, print No.\n\nSample Input 1\n\n10 30 20\n\nSample Output 1\n\nYes\n\nGive the pack with 30 candies to one student, and give the two packs with 10 and 20 candies to the other. Then, each gets 30 candies.\n\nSample Input 2\n\n30 30 100\n\nSample Output 2\n\nNo\n\nIn this case, the student who gets the pack with 100 candies always has more candies than the other.\n\nNote that every pack must be given to one of them.\n\nSample Input 3\n\n56 25 31\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 641, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s938175853", "group_id": "codeNet:p03943", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsum := 0\n\tvar a [3]int\n\tfor i := 0; i < 3; i++ {\n\t\ta[i] = nextInt()\n\t\tsum += a[i]\n\t}\n\n\tif sum%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\thalf := sum / 2\n\t\tis_half_exist := false\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tif a[i] == half {\n\t\t\t\tis_half_exist = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif is_half_exist {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1478732921, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03943.html", "problem_id": "p03943", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03943/input.txt", "sample_output_relpath": "derived/input_output/data/p03943/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03943/Go/s938175853.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938175853", "user_id": "u975773137"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsum := 0\n\tvar a [3]int\n\tfor i := 0; i < 3; i++ {\n\t\ta[i] = nextInt()\n\t\tsum += a[i]\n\t}\n\n\tif sum%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\thalf := sum / 2\n\t\tis_half_exist := false\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tif a[i] == half {\n\t\t\t\tis_half_exist = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif is_half_exist {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTwo students of AtCoder Kindergarten are fighting over candy packs.\n\nThere are three candy packs, each of which contains a, b, and c candies, respectively.\n\nTeacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible.\n\nNote that Evi cannot take candies out of the packs, and the whole contents of each pack must be given to one of the students.\n\nConstraints\n\n1 ≦ a, b, c ≦ 100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nIf it is possible to distribute the packs so that each student gets the same number of candies, print Yes. Otherwise, print No.\n\nSample Input 1\n\n10 30 20\n\nSample Output 1\n\nYes\n\nGive the pack with 30 candies to one student, and give the two packs with 10 and 20 candies to the other. Then, each gets 30 candies.\n\nSample Input 2\n\n30 30 100\n\nSample Output 2\n\nNo\n\nIn this case, the student who gets the pack with 100 candies always has more candies than the other.\n\nNote that every pack must be given to one of them.\n\nSample Input 3\n\n56 25 31\n\nSample Output 3\n\nYes", "sample_input": "10 30 20\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03943", "source_text": "Score : 100 points\n\nProblem Statement\n\nTwo students of AtCoder Kindergarten are fighting over candy packs.\n\nThere are three candy packs, each of which contains a, b, and c candies, respectively.\n\nTeacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible.\n\nNote that Evi cannot take candies out of the packs, and the whole contents of each pack must be given to one of the students.\n\nConstraints\n\n1 ≦ a, b, c ≦ 100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nIf it is possible to distribute the packs so that each student gets the same number of candies, print Yes. Otherwise, print No.\n\nSample Input 1\n\n10 30 20\n\nSample Output 1\n\nYes\n\nGive the pack with 30 candies to one student, and give the two packs with 10 and 20 candies to the other. Then, each gets 30 candies.\n\nSample Input 2\n\n30 30 100\n\nSample Output 2\n\nNo\n\nIn this case, the student who gets the pack with 100 candies always has more candies than the other.\n\nNote that every pack must be given to one of them.\n\nSample Input 3\n\n56 25 31\n\nSample Output 3\n\nYes", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 597, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s932629804", "group_id": "codeNet:p03944", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\n\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tw, h, n := iScan(), iScan(), iScan()\n\tp, q := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tx, y, a := iScan(), iScan(), iScan()\n\t\tif a == 1 {\n\t\t\tp = larger(p, x)\n\t\t} else if a == 2 {\n\t\t\tw = smaller(w, x)\n\t\t} else if a == 3 {\n\t\t\tq = larger(q, y)\n\t\t} else if a == 4 {\n\t\t\th = smaller(h, y)\n\t\t}\n\t}\n\tfmt.Println(larger(0, w-p) * larger(0, h-q))\n}\n", "language": "Go", "metadata": {"date": 1594505458, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03944.html", "problem_id": "p03944", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03944/input.txt", "sample_output_relpath": "derived/input_output/data/p03944/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03944/Go/s932629804.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s932629804", "user_id": "u843722521"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\n\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tw, h, n := iScan(), iScan(), iScan()\n\tp, q := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tx, y, a := iScan(), iScan(), iScan()\n\t\tif a == 1 {\n\t\t\tp = larger(p, x)\n\t\t} else if a == 2 {\n\t\t\tw = smaller(w, x)\n\t\t} else if a == 3 {\n\t\t\tq = larger(q, y)\n\t\t} else if a == 4 {\n\t\t\th = smaller(h, y)\n\t\t}\n\t}\n\tfmt.Println(larger(0, w-p) * larger(0, h-q))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "sample_input": "5 4 2\n2 1 1\n3 3 4\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03944", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1534, "cpu_time_ms": 9, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s064416961", "group_id": "codeNet:p03944", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar W, H, N int\n\tcon.Scan(&W, &H, &N)\n\tM := make([][]bool, H)\n\tfor i := range M {\n\t\tM[i] = make([]bool, W)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tvar x, y, a int\n\t\tcon.Scan(&x, &y, &a)\n\t\tswitch a {\n\t\tcase 1:\n\t\t\tfor j := 0; j < x; j++ {\n\t\t\t\tfor k := 0; k < H; k++ {\n\t\t\t\t\tM[k][j] = true\n\t\t\t\t}\n\t\t\t}\n\t\tcase 2:\n\t\t\tfor j := x; j < W; j++ {\n\t\t\t\tfor k := 0; k < H; k++ {\n\t\t\t\t\tM[k][j] = true\n\t\t\t\t}\n\t\t\t}\n\t\tcase 3:\n\t\t\tfor j := 0; j < y; j++ {\n\t\t\t\tfor k := 0; k < W; k++ {\n\t\t\t\t\tM[j][k] = true\n\t\t\t\t}\n\t\t\t}\n\t\tcase 4:\n\t\t\tfor j := y; j < H; j++ {\n\t\t\t\tfor k := 0; k < W; k++ {\n\t\t\t\t\tM[j][k] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tc := 0\n\tfor i := range M {\n\t\tfor _, a := range M[i] {\n\t\t\tif !a {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\tcon.Println(c)\n\treturn nil\n}\n", "language": "Go", "metadata": {"date": 1578537638, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03944.html", "problem_id": "p03944", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03944/input.txt", "sample_output_relpath": "derived/input_output/data/p03944/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03944/Go/s064416961.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s064416961", "user_id": "u718747410"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar W, H, N int\n\tcon.Scan(&W, &H, &N)\n\tM := make([][]bool, H)\n\tfor i := range M {\n\t\tM[i] = make([]bool, W)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tvar x, y, a int\n\t\tcon.Scan(&x, &y, &a)\n\t\tswitch a {\n\t\tcase 1:\n\t\t\tfor j := 0; j < x; j++ {\n\t\t\t\tfor k := 0; k < H; k++ {\n\t\t\t\t\tM[k][j] = true\n\t\t\t\t}\n\t\t\t}\n\t\tcase 2:\n\t\t\tfor j := x; j < W; j++ {\n\t\t\t\tfor k := 0; k < H; k++ {\n\t\t\t\t\tM[k][j] = true\n\t\t\t\t}\n\t\t\t}\n\t\tcase 3:\n\t\t\tfor j := 0; j < y; j++ {\n\t\t\t\tfor k := 0; k < W; k++ {\n\t\t\t\t\tM[j][k] = true\n\t\t\t\t}\n\t\t\t}\n\t\tcase 4:\n\t\t\tfor j := y; j < H; j++ {\n\t\t\t\tfor k := 0; k < W; k++ {\n\t\t\t\t\tM[j][k] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tc := 0\n\tfor i := range M {\n\t\tfor _, a := range M[i] {\n\t\t\tif !a {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\tcon.Println(c)\n\treturn nil\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "sample_input": "5 4 2\n2 1 1\n3 3 4\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03944", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.\n\nSnuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).\n\nThen, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:\n\nIf a_i = 1, he painted the region satisfying x < x_i within the rectangle.\n\nIf a_i = 2, he painted the region satisfying x > x_i within the rectangle.\n\nIf a_i = 3, he painted the region satisfying y < y_i within the rectangle.\n\nIf a_i = 4, he painted the region satisfying y > y_i within the rectangle.\n\nFind the area of the white region within the rectangle after he finished painting.\n\nConstraints\n\n1 ≦ W, H ≦ 100\n\n1 ≦ N ≦ 100\n\n0 ≦ x_i ≦ W (1 ≦ i ≦ N)\n\n0 ≦ y_i ≦ H (1 ≦ i ≦ N)\n\nW, H (21:32, added), x_i and y_i are integers.\n\na_i (1 ≦ i ≦ N) is 1, 2, 3 or 4.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nW H N\nx_1 y_1 a_1\nx_2 y_2 a_2\n:\nx_N y_N a_N\n\nOutput\n\nPrint the area of the white region within the rectangle after Snuke finished painting.\n\nSample Input 1\n\n5 4 2\n2 1 1\n3 3 4\n\nSample Output 1\n\n9\n\nThe figure below shows the rectangle before Snuke starts painting.\n\nFirst, as (x_1, y_1) = (2, 1) and a_1 = 1, he paints the region satisfying x < 2 within the rectangle:\n\nThen, as (x_2, y_2) = (3, 3) and a_2 = 4, he paints the region satisfying y > 3 within the rectangle:\n\nNow, the area of the white region within the rectangle is 9.\n\nSample Input 2\n\n5 4 3\n2 1 1\n3 3 4\n1 4 2\n\nSample Output 2\n\n0\n\nIt is possible that the whole region within the rectangle is painted black.\n\nSample Input 3\n\n10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n\nSample Output 3\n\n64", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1600, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s867378596", "group_id": "codeNet:p03946", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInt2() (int, int) {\n\treturn nextInt(), nextInt()\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, _ := nextInt2()\n\ta := nextInts(n)\n\n\t// max[i]: i以後の街で最高のりんごの値段\n\tmax := make([]int, n)\n\tmax[n-1] = a[0]\n\tfor i := n - 2; i >= 0; i-- {\n\t\tmax[i] = max[i+1]\n\t\tif a[i] > max[i] {\n\t\t\tmax[i] = a[i]\n\t\t}\n\t}\n\t// profit[i]: iでりんごを買ったとき,得られる利益の最大値\n\tprofit := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tprofit[i] = max[i] - a[i]\n\t}\n\n\tm := map[int]int{}\n\tmaxProfit := -1\n\tfor _, p := range profit {\n\t\tm[p]++\n\t\tif p > maxProfit {\n\t\t\tmaxProfit = p\n\t\t}\n\t}\n\n\tputs(m[maxProfit])\n}\n", "language": "Go", "metadata": {"date": 1590655666, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03946.html", "problem_id": "p03946", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03946/input.txt", "sample_output_relpath": "derived/input_output/data/p03946/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03946/Go/s867378596.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s867378596", "user_id": "u502813058"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInt2() (int, int) {\n\treturn nextInt(), nextInt()\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, _ := nextInt2()\n\ta := nextInts(n)\n\n\t// max[i]: i以後の街で最高のりんごの値段\n\tmax := make([]int, n)\n\tmax[n-1] = a[0]\n\tfor i := n - 2; i >= 0; i-- {\n\t\tmax[i] = max[i+1]\n\t\tif a[i] > max[i] {\n\t\t\tmax[i] = a[i]\n\t\t}\n\t}\n\t// profit[i]: iでりんごを買ったとき,得られる利益の最大値\n\tprofit := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tprofit[i] = max[i] - a[i]\n\t}\n\n\tm := map[int]int{}\n\tmaxProfit := -1\n\tfor _, p := range profit {\n\t\tm[p]++\n\t\tif p > maxProfit {\n\t\t\tmaxProfit = p\n\t\t}\n\t}\n\n\tputs(m[maxProfit])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N towns located in a line, conveniently numbered 1 through N. Takahashi the merchant is going on a travel from town 1 to town N, buying and selling apples.\n\nTakahashi will begin the travel at town 1, with no apple in his possession. The actions that can be performed during the travel are as follows:\n\nMove: When at town i (i < N), move to town i + 1.\n\nMerchandise: Buy or sell an arbitrary number of apples at the current town. Here, it is assumed that one apple can always be bought and sold for A_i yen (the currency of Japan) at town i (1 ≦ i ≦ N), where A_i are distinct integers. Also, you can assume that he has an infinite supply of money.\n\nFor some reason, there is a constraint on merchandising apple during the travel: the sum of the number of apples bought and the number of apples sold during the whole travel, must be at most T. (Note that a single apple can be counted in both.)\n\nDuring the travel, Takahashi will perform actions so that the profit of the travel is maximized. Here, the profit of the travel is the amount of money that is gained by selling apples, minus the amount of money that is spent on buying apples. Note that we are not interested in apples in his possession at the end of the travel.\n\nAoki, a business rival of Takahashi, wants to trouble Takahashi by manipulating the market price of apples. Prior to the beginning of Takahashi's travel, Aoki can change A_i into another arbitrary non-negative integer A_i' for any town i, any number of times. The cost of performing this operation is |A_i - A_i'|. After performing this operation, different towns may have equal values of A_i.\n\nAoki's objective is to decrease Takahashi's expected profit by at least 1 yen. Find the minimum total cost to achieve it. You may assume that Takahashi's expected profit is initially at least 1 yen.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nA_i are distinct.\n\n2 ≦ T ≦ 10^9\n\nIn the initial state, Takahashi's expected profit is at least 1 yen.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN T\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum total cost to decrease Takahashi's expected profit by at least 1 yen.\n\nSample Input 1\n\n3 2\n100 50 200\n\nSample Output 1\n\n1\n\nIn the initial state, Takahashi can achieve the maximum profit of 150 yen as follows:\n\nMove from town 1 to town 2.\n\nBuy one apple for 50 yen at town 2.\n\nMove from town 2 to town 3.\n\nSell one apple for 200 yen at town 3.\n\nIf, for example, Aoki changes the price of an apple at town 2 from 50 yen to 51 yen, Takahashi will not be able to achieve the profit of 150 yen. The cost of performing this operation is 1, thus the answer is 1.\n\nThere are other ways to decrease Takahashi's expected profit, such as changing the price of an apple at town 3 from 200 yen to 199 yen.\n\nSample Input 2\n\n5 8\n50 30 40 10 20\n\nSample Output 2\n\n2\n\nSample Input 3\n\n10 100\n7 10 4 5 9 3 6 8 2 1\n\nSample Output 3\n\n2", "sample_input": "3 2\n100 50 200\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03946", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N towns located in a line, conveniently numbered 1 through N. Takahashi the merchant is going on a travel from town 1 to town N, buying and selling apples.\n\nTakahashi will begin the travel at town 1, with no apple in his possession. The actions that can be performed during the travel are as follows:\n\nMove: When at town i (i < N), move to town i + 1.\n\nMerchandise: Buy or sell an arbitrary number of apples at the current town. Here, it is assumed that one apple can always be bought and sold for A_i yen (the currency of Japan) at town i (1 ≦ i ≦ N), where A_i are distinct integers. Also, you can assume that he has an infinite supply of money.\n\nFor some reason, there is a constraint on merchandising apple during the travel: the sum of the number of apples bought and the number of apples sold during the whole travel, must be at most T. (Note that a single apple can be counted in both.)\n\nDuring the travel, Takahashi will perform actions so that the profit of the travel is maximized. Here, the profit of the travel is the amount of money that is gained by selling apples, minus the amount of money that is spent on buying apples. Note that we are not interested in apples in his possession at the end of the travel.\n\nAoki, a business rival of Takahashi, wants to trouble Takahashi by manipulating the market price of apples. Prior to the beginning of Takahashi's travel, Aoki can change A_i into another arbitrary non-negative integer A_i' for any town i, any number of times. The cost of performing this operation is |A_i - A_i'|. After performing this operation, different towns may have equal values of A_i.\n\nAoki's objective is to decrease Takahashi's expected profit by at least 1 yen. Find the minimum total cost to achieve it. You may assume that Takahashi's expected profit is initially at least 1 yen.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nA_i are distinct.\n\n2 ≦ T ≦ 10^9\n\nIn the initial state, Takahashi's expected profit is at least 1 yen.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN T\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum total cost to decrease Takahashi's expected profit by at least 1 yen.\n\nSample Input 1\n\n3 2\n100 50 200\n\nSample Output 1\n\n1\n\nIn the initial state, Takahashi can achieve the maximum profit of 150 yen as follows:\n\nMove from town 1 to town 2.\n\nBuy one apple for 50 yen at town 2.\n\nMove from town 2 to town 3.\n\nSell one apple for 200 yen at town 3.\n\nIf, for example, Aoki changes the price of an apple at town 2 from 50 yen to 51 yen, Takahashi will not be able to achieve the profit of 150 yen. The cost of performing this operation is 1, thus the answer is 1.\n\nThere are other ways to decrease Takahashi's expected profit, such as changing the price of an apple at town 3 from 200 yen to 199 yen.\n\nSample Input 2\n\n5 8\n50 30 40 10 20\n\nSample Output 2\n\n2\n\nSample Input 3\n\n10 100\n7 10 4 5 9 3 6 8 2 1\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1205, "cpu_time_ms": 46, "memory_kb": 8576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s784811273", "group_id": "codeNet:p03946", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\t_ = getNextInt(scanner)\n\tlis := make([][]int, n)\n\tlens := make([]int, n)\n\n\tj := 0\n\tfor i := 0; i < n; i++ {\n\t\tlis[i] = make([]int, 0)\n\t\ta := getNextInt(scanner)\n\t\tl := 0\n\t\tr := j\n\t\tfor l < r {\n\t\t\tm := (l + r) >> 1\n\t\t\tif lis[m][lens[m]-1] <= a {\n\t\t\t\tr = m\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tl = m + 1\n\t\t}\n\t\tif r == j {\n\t\t\tj++\n\t\t}\n\t\tlis[l] = append(lis[l], a)\n\t\tlens[l]++\n\t}\n\n\tim := IntMap{}\n\tmax := 0\n\n\tfor i := 0; i < j; i++ {\n\t\tif lens[i] < 2 {\n\t\t\tcontinue\n\t\t}\n\t\tprofit := lis[i][lens[i]-1] - lis[i][0]\n\n\t\tim.increment(profit)\n\t\tfor ii := 0; lis[i][ii] == lis[i][ii+1]; ii++ {\n\t\t\tim.increment(profit)\n\t\t}\n\n\t\tif max < profit {\n\t\t\tmax = profit\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, im.get(max))\n\n\twriter.Flush()\n}\n\n// IntMap ...\ntype IntMap map[int]int\n\nfunc (m IntMap) get(key int) int {\n\tif _, ok := m[key]; ok {\n\t\treturn m[key]\n\t}\n\treturn 0\n}\n\nfunc (m IntMap) set(key, n int) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key] = n\n}\n\nfunc (m IntMap) increment(key int) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key]++\n}\n", "language": "Go", "metadata": {"date": 1564776981, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03946.html", "problem_id": "p03946", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03946/input.txt", "sample_output_relpath": "derived/input_output/data/p03946/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03946/Go/s784811273.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s784811273", "user_id": "u150542210"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\t_ = getNextInt(scanner)\n\tlis := make([][]int, n)\n\tlens := make([]int, n)\n\n\tj := 0\n\tfor i := 0; i < n; i++ {\n\t\tlis[i] = make([]int, 0)\n\t\ta := getNextInt(scanner)\n\t\tl := 0\n\t\tr := j\n\t\tfor l < r {\n\t\t\tm := (l + r) >> 1\n\t\t\tif lis[m][lens[m]-1] <= a {\n\t\t\t\tr = m\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tl = m + 1\n\t\t}\n\t\tif r == j {\n\t\t\tj++\n\t\t}\n\t\tlis[l] = append(lis[l], a)\n\t\tlens[l]++\n\t}\n\n\tim := IntMap{}\n\tmax := 0\n\n\tfor i := 0; i < j; i++ {\n\t\tif lens[i] < 2 {\n\t\t\tcontinue\n\t\t}\n\t\tprofit := lis[i][lens[i]-1] - lis[i][0]\n\n\t\tim.increment(profit)\n\t\tfor ii := 0; lis[i][ii] == lis[i][ii+1]; ii++ {\n\t\t\tim.increment(profit)\n\t\t}\n\n\t\tif max < profit {\n\t\t\tmax = profit\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, im.get(max))\n\n\twriter.Flush()\n}\n\n// IntMap ...\ntype IntMap map[int]int\n\nfunc (m IntMap) get(key int) int {\n\tif _, ok := m[key]; ok {\n\t\treturn m[key]\n\t}\n\treturn 0\n}\n\nfunc (m IntMap) set(key, n int) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key] = n\n}\n\nfunc (m IntMap) increment(key int) {\n\tif _, ok := m[key]; ok == false {\n\t\tm[key] = 0\n\t}\n\tm[key]++\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N towns located in a line, conveniently numbered 1 through N. Takahashi the merchant is going on a travel from town 1 to town N, buying and selling apples.\n\nTakahashi will begin the travel at town 1, with no apple in his possession. The actions that can be performed during the travel are as follows:\n\nMove: When at town i (i < N), move to town i + 1.\n\nMerchandise: Buy or sell an arbitrary number of apples at the current town. Here, it is assumed that one apple can always be bought and sold for A_i yen (the currency of Japan) at town i (1 ≦ i ≦ N), where A_i are distinct integers. Also, you can assume that he has an infinite supply of money.\n\nFor some reason, there is a constraint on merchandising apple during the travel: the sum of the number of apples bought and the number of apples sold during the whole travel, must be at most T. (Note that a single apple can be counted in both.)\n\nDuring the travel, Takahashi will perform actions so that the profit of the travel is maximized. Here, the profit of the travel is the amount of money that is gained by selling apples, minus the amount of money that is spent on buying apples. Note that we are not interested in apples in his possession at the end of the travel.\n\nAoki, a business rival of Takahashi, wants to trouble Takahashi by manipulating the market price of apples. Prior to the beginning of Takahashi's travel, Aoki can change A_i into another arbitrary non-negative integer A_i' for any town i, any number of times. The cost of performing this operation is |A_i - A_i'|. After performing this operation, different towns may have equal values of A_i.\n\nAoki's objective is to decrease Takahashi's expected profit by at least 1 yen. Find the minimum total cost to achieve it. You may assume that Takahashi's expected profit is initially at least 1 yen.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nA_i are distinct.\n\n2 ≦ T ≦ 10^9\n\nIn the initial state, Takahashi's expected profit is at least 1 yen.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN T\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum total cost to decrease Takahashi's expected profit by at least 1 yen.\n\nSample Input 1\n\n3 2\n100 50 200\n\nSample Output 1\n\n1\n\nIn the initial state, Takahashi can achieve the maximum profit of 150 yen as follows:\n\nMove from town 1 to town 2.\n\nBuy one apple for 50 yen at town 2.\n\nMove from town 2 to town 3.\n\nSell one apple for 200 yen at town 3.\n\nIf, for example, Aoki changes the price of an apple at town 2 from 50 yen to 51 yen, Takahashi will not be able to achieve the profit of 150 yen. The cost of performing this operation is 1, thus the answer is 1.\n\nThere are other ways to decrease Takahashi's expected profit, such as changing the price of an apple at town 3 from 200 yen to 199 yen.\n\nSample Input 2\n\n5 8\n50 30 40 10 20\n\nSample Output 2\n\n2\n\nSample Input 3\n\n10 100\n7 10 4 5 9 3 6 8 2 1\n\nSample Output 3\n\n2", "sample_input": "3 2\n100 50 200\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03946", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N towns located in a line, conveniently numbered 1 through N. Takahashi the merchant is going on a travel from town 1 to town N, buying and selling apples.\n\nTakahashi will begin the travel at town 1, with no apple in his possession. The actions that can be performed during the travel are as follows:\n\nMove: When at town i (i < N), move to town i + 1.\n\nMerchandise: Buy or sell an arbitrary number of apples at the current town. Here, it is assumed that one apple can always be bought and sold for A_i yen (the currency of Japan) at town i (1 ≦ i ≦ N), where A_i are distinct integers. Also, you can assume that he has an infinite supply of money.\n\nFor some reason, there is a constraint on merchandising apple during the travel: the sum of the number of apples bought and the number of apples sold during the whole travel, must be at most T. (Note that a single apple can be counted in both.)\n\nDuring the travel, Takahashi will perform actions so that the profit of the travel is maximized. Here, the profit of the travel is the amount of money that is gained by selling apples, minus the amount of money that is spent on buying apples. Note that we are not interested in apples in his possession at the end of the travel.\n\nAoki, a business rival of Takahashi, wants to trouble Takahashi by manipulating the market price of apples. Prior to the beginning of Takahashi's travel, Aoki can change A_i into another arbitrary non-negative integer A_i' for any town i, any number of times. The cost of performing this operation is |A_i - A_i'|. After performing this operation, different towns may have equal values of A_i.\n\nAoki's objective is to decrease Takahashi's expected profit by at least 1 yen. Find the minimum total cost to achieve it. You may assume that Takahashi's expected profit is initially at least 1 yen.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nA_i are distinct.\n\n2 ≦ T ≦ 10^9\n\nIn the initial state, Takahashi's expected profit is at least 1 yen.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN T\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum total cost to decrease Takahashi's expected profit by at least 1 yen.\n\nSample Input 1\n\n3 2\n100 50 200\n\nSample Output 1\n\n1\n\nIn the initial state, Takahashi can achieve the maximum profit of 150 yen as follows:\n\nMove from town 1 to town 2.\n\nBuy one apple for 50 yen at town 2.\n\nMove from town 2 to town 3.\n\nSell one apple for 200 yen at town 3.\n\nIf, for example, Aoki changes the price of an apple at town 2 from 50 yen to 51 yen, Takahashi will not be able to achieve the profit of 150 yen. The cost of performing this operation is 1, thus the answer is 1.\n\nThere are other ways to decrease Takahashi's expected profit, such as changing the price of an apple at town 3 from 200 yen to 199 yen.\n\nSample Input 2\n\n5 8\n50 30 40 10 20\n\nSample Output 2\n\n2\n\nSample Input 3\n\n10 100\n7 10 4 5 9 3 6 8 2 1\n\nSample Output 3\n\n2", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1759, "cpu_time_ms": 54, "memory_kb": 8704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s947081177", "group_id": "codeNet:p03951", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype bufReader struct {\n\tr *bufio.Reader\n\tbuf []byte\n\ti int\n}\n\nvar reader = &bufReader{\n\tbufio.NewReader(os.Stdin),\n\tmake([]byte, 0),\n\t0,\n}\n\nfunc (r *bufReader) readLine() {\n\tif r.i < len(r.buf) {\n\t\treturn\n\t}\n\tr.buf = make([]byte, 0)\n\tr.i = 0\n\tfor {\n\t\tline, isPrefix, err := r.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tr.buf = append(r.buf, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (r *bufReader) next() string {\n\tr.readLine()\n\tfrom := r.i\n\tfor ; r.i < len(r.buf); r.i++ {\n\t\tif r.buf[r.i] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\ts := string(r.buf[from:r.i])\n\tr.i++\n\treturn s\n}\n\nfunc (r *bufReader) nextLine() string {\n\tr.readLine()\n\ts := string(r.buf[r.i:])\n\tr.i = len(r.buf)\n\treturn s\n}\n\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n\treturn reader.next()\n}\n\nfunc nextInt64() int64 {\n\ti, err := strconv.ParseInt(reader.next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInt() int {\n\treturn int(nextInt64())\n}\n\nfunc nextLine() string {\n\treturn reader.nextLine()\n}\n\nfunc out(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc max64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\treturn int(max64(int64(x), int64(y)))\n}\n\nfunc min64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\treturn int(min64(int64(x), int64(y)))\n}\n\nfunc abs64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc abs(x int) int {\n\treturn int(abs64(int64(x)))\n}\n\nfunc joinInt64s(a []int64, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.FormatInt(v, 10)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc joinInts(a []int, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.Itoa(v)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc divUp64(x, y int64) int64 {\n\treturn (x + y - 1) / y\n}\n\nfunc divUp(x, y int) int {\n\treturn int(divUp64(int64(x), int64(y)))\n}\n\nfunc gcd64(x, y int64) int64 {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc gcd(x, y int) int {\n\treturn int(gcd64(int64(x), int64(y)))\n}\n\nfunc lcm64(x, y int64) int64 {\n\treturn x * y / gcd64(x, y)\n}\n\nfunc lcm(x, y int) int {\n\treturn int(lcm64(int64(x), int64(y)))\n}\n\nfunc pow64(x, y int64) int64 {\n\treturn int64(math.Pow(float64(x), float64(y)))\n}\n\nfunc pow(x, y int) int {\n\treturn int(pow64(int64(x), int64(y)))\n}\n\nfunc main() {\n\tsolve()\n\twriter.Flush()\n}\n\nfunc solve() {\n\tN := nextInt()\n\ts, t := nextLine(), nextLine()\n\ti := 0\n\tfor ; !strings.HasPrefix(t, s[i:]) && i < N; i++ {\n\t}\n\tout(N - i + i*2)\n}\n", "language": "Go", "metadata": {"date": 1477931796, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03951.html", "problem_id": "p03951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03951/input.txt", "sample_output_relpath": "derived/input_output/data/p03951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03951/Go/s947081177.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s947081177", "user_id": "u518732500"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype bufReader struct {\n\tr *bufio.Reader\n\tbuf []byte\n\ti int\n}\n\nvar reader = &bufReader{\n\tbufio.NewReader(os.Stdin),\n\tmake([]byte, 0),\n\t0,\n}\n\nfunc (r *bufReader) readLine() {\n\tif r.i < len(r.buf) {\n\t\treturn\n\t}\n\tr.buf = make([]byte, 0)\n\tr.i = 0\n\tfor {\n\t\tline, isPrefix, err := r.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tr.buf = append(r.buf, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (r *bufReader) next() string {\n\tr.readLine()\n\tfrom := r.i\n\tfor ; r.i < len(r.buf); r.i++ {\n\t\tif r.buf[r.i] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\ts := string(r.buf[from:r.i])\n\tr.i++\n\treturn s\n}\n\nfunc (r *bufReader) nextLine() string {\n\tr.readLine()\n\ts := string(r.buf[r.i:])\n\tr.i = len(r.buf)\n\treturn s\n}\n\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n\treturn reader.next()\n}\n\nfunc nextInt64() int64 {\n\ti, err := strconv.ParseInt(reader.next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInt() int {\n\treturn int(nextInt64())\n}\n\nfunc nextLine() string {\n\treturn reader.nextLine()\n}\n\nfunc out(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc max64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\treturn int(max64(int64(x), int64(y)))\n}\n\nfunc min64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\treturn int(min64(int64(x), int64(y)))\n}\n\nfunc abs64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc abs(x int) int {\n\treturn int(abs64(int64(x)))\n}\n\nfunc joinInt64s(a []int64, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.FormatInt(v, 10)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc joinInts(a []int, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.Itoa(v)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc divUp64(x, y int64) int64 {\n\treturn (x + y - 1) / y\n}\n\nfunc divUp(x, y int) int {\n\treturn int(divUp64(int64(x), int64(y)))\n}\n\nfunc gcd64(x, y int64) int64 {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc gcd(x, y int) int {\n\treturn int(gcd64(int64(x), int64(y)))\n}\n\nfunc lcm64(x, y int64) int64 {\n\treturn x * y / gcd64(x, y)\n}\n\nfunc lcm(x, y int) int {\n\treturn int(lcm64(int64(x), int64(y)))\n}\n\nfunc pow64(x, y int64) int64 {\n\treturn int64(math.Pow(float64(x), float64(y)))\n}\n\nfunc pow(x, y int) int {\n\treturn int(pow64(int64(x), int64(y)))\n}\n\nfunc main() {\n\tsolve()\n\twriter.Flush()\n}\n\nfunc solve() {\n\tN := nextInt()\n\ts, t := nextLine(), nextLine()\n\ti := 0\n\tfor ; !strings.HasPrefix(t, s[i:]) && i < N; i++ {\n\t}\n\tout(N - i + i*2)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke is interested in strings that satisfy the following conditions:\n\nThe length of the string is at least N.\n\nThe first N characters equal to the string s.\n\nThe last N characters equal to the string t.\n\nFind the length of the shortest string that satisfies the conditions.\n\nConstraints\n\n1≤N≤100\n\nThe lengths of s and t are both N.\n\ns and t consist of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\nt\n\nOutput\n\nPrint the length of the shortest string that satisfies the conditions.\n\nSample Input 1\n\n3\nabc\ncde\n\nSample Output 1\n\n5\n\nThe shortest string is abcde.\n\nSample Input 2\n\n1\na\nz\n\nSample Output 2\n\n2\n\nThe shortest string is az.\n\nSample Input 3\n\n4\nexpr\nexpr\n\nSample Output 3\n\n4\n\nThe shortest string is expr.", "sample_input": "3\nabc\ncde\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03951", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke is interested in strings that satisfy the following conditions:\n\nThe length of the string is at least N.\n\nThe first N characters equal to the string s.\n\nThe last N characters equal to the string t.\n\nFind the length of the shortest string that satisfies the conditions.\n\nConstraints\n\n1≤N≤100\n\nThe lengths of s and t are both N.\n\ns and t consist of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\ns\nt\n\nOutput\n\nPrint the length of the shortest string that satisfies the conditions.\n\nSample Input 1\n\n3\nabc\ncde\n\nSample Output 1\n\n5\n\nThe shortest string is abcde.\n\nSample Input 2\n\n1\na\nz\n\nSample Output 2\n\n2\n\nThe shortest string is az.\n\nSample Input 3\n\n4\nexpr\nexpr\n\nSample Output 3\n\n4\n\nThe shortest string is expr.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2638, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s418865612", "group_id": "codeNet:p03952", "input_text": "///\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Sat May 12 20:36:32 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar N, x int\n\nfunc main() {\n\tfmt.Scan(&N, &x)\n\tif N == x {\n\t\tfor i := 1; i < 2*N; i++ {\n\t\t\tfmt.Println(i)\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1526171903, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03952.html", "problem_id": "p03952", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03952/input.txt", "sample_output_relpath": "derived/input_output/data/p03952/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03952/Go/s418865612.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s418865612", "user_id": "u802614675"}, "prompt_components": {"gold_output": "Yes\n1\n6\n3\n7\n4\n5\n2\n", "input_to_evaluate": "///\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Sat May 12 20:36:32 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar N, x int\n\nfunc main() {\n\tfmt.Scan(&N, &x)\n\tif N == x {\n\t\tfor i := 1; i < 2*N; i++ {\n\t\t\tfmt.Println(i)\n\t\t}\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a pyramid with N steps, built with blocks.\nThe steps are numbered 1 through N from top to bottom.\nFor each 1≤i≤N, step i consists of 2i-1 blocks aligned horizontally.\nThe pyramid is built so that the blocks at the centers of the steps are aligned vertically.\n\nA pyramid with N=4 steps\n\nSnuke wrote a permutation of (1, 2, ..., 2N-1) into the blocks of step N.\nThen, he wrote integers into all remaining blocks, under the following rule:\n\nThe integer written into a block b must be equal to the median of the three integers written into the three blocks directly under b, or to the lower left or lower right of b.\n\nWriting integers into the blocks\n\nAfterwards, he erased all integers written into the blocks.\nNow, he only remembers that the integer written into the block of step 1 was x.\n\nConstruct a permutation of (1, 2, ..., 2N-1) that could have been written into the blocks of step N, or declare that Snuke's memory is incorrect and such a permutation does not exist.\n\nConstraints\n\n2≤N≤10^5\n\n1≤x≤2N-1\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN x\n\nOutput\n\nIf no permutation of (1, 2, ..., 2N-1) could have been written into the blocks of step N, print No.\n\nOtherwise, print Yes in the first line, then print 2N-1 lines in addition.\n\nThe i-th of these 2N-1 lines should contain the i-th element of a possible permutation.\n\nSample Input 1\n\n4 4\n\nSample Output 1\n\nYes\n1\n6\n3\n7\n4\n5\n2\n\nThis case corresponds to the figure in the problem statement.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\nNo\n\nNo matter what permutation was written into the blocks of step N, the integer written into the block of step 1 would be 2.", "sample_input": "4 4\n"}, "reference_outputs": ["Yes\n1\n6\n3\n7\n4\n5\n2\n"], "source_document_id": "p03952", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a pyramid with N steps, built with blocks.\nThe steps are numbered 1 through N from top to bottom.\nFor each 1≤i≤N, step i consists of 2i-1 blocks aligned horizontally.\nThe pyramid is built so that the blocks at the centers of the steps are aligned vertically.\n\nA pyramid with N=4 steps\n\nSnuke wrote a permutation of (1, 2, ..., 2N-1) into the blocks of step N.\nThen, he wrote integers into all remaining blocks, under the following rule:\n\nThe integer written into a block b must be equal to the median of the three integers written into the three blocks directly under b, or to the lower left or lower right of b.\n\nWriting integers into the blocks\n\nAfterwards, he erased all integers written into the blocks.\nNow, he only remembers that the integer written into the block of step 1 was x.\n\nConstruct a permutation of (1, 2, ..., 2N-1) that could have been written into the blocks of step N, or declare that Snuke's memory is incorrect and such a permutation does not exist.\n\nConstraints\n\n2≤N≤10^5\n\n1≤x≤2N-1\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN x\n\nOutput\n\nIf no permutation of (1, 2, ..., 2N-1) could have been written into the blocks of step N, print No.\n\nOtherwise, print Yes in the first line, then print 2N-1 lines in addition.\n\nThe i-th of these 2N-1 lines should contain the i-th element of a possible permutation.\n\nSample Input 1\n\n4 4\n\nSample Output 1\n\nYes\n1\n6\n3\n7\n4\n5\n2\n\nThis case corresponds to the figure in the problem statement.\n\nSample Input 2\n\n2 1\n\nSample Output 2\n\nNo\n\nNo matter what permutation was written into the blocks of step N, the integer written into the block of step 1 would be 2.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 263, "cpu_time_ms": 397, "memory_kb": 3328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s306970944", "group_id": "codeNet:p03957", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype bufReader struct {\n\tr *bufio.Reader\n\tbuf []byte\n\ti int\n}\n\nvar reader = &bufReader{\n\tbufio.NewReader(os.Stdin),\n\tmake([]byte, 0),\n\t0,\n}\n\nfunc (r *bufReader) readLine() {\n\tif r.i < len(r.buf) {\n\t\treturn\n\t}\n\tr.buf = make([]byte, 0)\n\tr.i = 0\n\tfor {\n\t\tline, isPrefix, err := r.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tr.buf = append(r.buf, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (r *bufReader) next() string {\n\tr.readLine()\n\tfrom := r.i\n\tfor ; r.i < len(r.buf); r.i++ {\n\t\tif r.buf[r.i] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\ts := string(r.buf[from:r.i])\n\tr.i++\n\treturn s\n}\n\nfunc (r *bufReader) nextLine() string {\n\tr.readLine()\n\ts := string(r.buf[r.i:])\n\tr.i = len(r.buf)\n\treturn s\n}\n\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n\treturn reader.next()\n}\n\nfunc nextInt64() int64 {\n\ti, err := strconv.ParseInt(reader.next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInt() int {\n\treturn int(nextInt64())\n}\n\nfunc nextLine() string {\n\treturn reader.nextLine()\n}\n\nfunc out(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc max64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\treturn int(max64(int64(x), int64(y)))\n}\n\nfunc min64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\treturn int(min64(int64(x), int64(y)))\n}\n\nfunc abs64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc abs(x int) int {\n\treturn int(abs64(int64(x)))\n}\n\nfunc joinInt64s(a []int64, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.FormatInt(v, 10)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc joinInts(a []int, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.Itoa(v)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc divUp64(x, y int64) int64 {\n\treturn (x + y - 1) / y\n}\n\nfunc divUp(x, y int) int {\n\treturn int(divUp64(int64(x), int64(y)))\n}\n\nfunc gcd64(x, y int64) int64 {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc gcd(x, y int) int {\n\treturn int(gcd64(int64(x), int64(y)))\n}\n\nfunc lcm64(x, y int64) int64 {\n\treturn x * y / gcd64(x, y)\n}\n\nfunc lcm(x, y int) int {\n\treturn int(lcm64(int64(x), int64(y)))\n}\n\nfunc main() {\n\tsolve()\n\twriter.Flush()\n}\n\nfunc solve() {\n\ts := nextLine()\n\tc := strings.Index(s, \"C\")\n\tif c == -1 {\n\t\tout(\"No\")\n\t\treturn\n\t}\n\tf := strings.Index(s[c:], \"F\")\n\tif f == -1 {\n\t\tout(\"No\")\n\t\treturn\n\t}\n\tout(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1477271038, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03957.html", "problem_id": "p03957", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03957/input.txt", "sample_output_relpath": "derived/input_output/data/p03957/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03957/Go/s306970944.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s306970944", "user_id": "u518732500"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype bufReader struct {\n\tr *bufio.Reader\n\tbuf []byte\n\ti int\n}\n\nvar reader = &bufReader{\n\tbufio.NewReader(os.Stdin),\n\tmake([]byte, 0),\n\t0,\n}\n\nfunc (r *bufReader) readLine() {\n\tif r.i < len(r.buf) {\n\t\treturn\n\t}\n\tr.buf = make([]byte, 0)\n\tr.i = 0\n\tfor {\n\t\tline, isPrefix, err := r.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tr.buf = append(r.buf, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (r *bufReader) next() string {\n\tr.readLine()\n\tfrom := r.i\n\tfor ; r.i < len(r.buf); r.i++ {\n\t\tif r.buf[r.i] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\ts := string(r.buf[from:r.i])\n\tr.i++\n\treturn s\n}\n\nfunc (r *bufReader) nextLine() string {\n\tr.readLine()\n\ts := string(r.buf[r.i:])\n\tr.i = len(r.buf)\n\treturn s\n}\n\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n\treturn reader.next()\n}\n\nfunc nextInt64() int64 {\n\ti, err := strconv.ParseInt(reader.next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInt() int {\n\treturn int(nextInt64())\n}\n\nfunc nextLine() string {\n\treturn reader.nextLine()\n}\n\nfunc out(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc max64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\treturn int(max64(int64(x), int64(y)))\n}\n\nfunc min64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\treturn int(min64(int64(x), int64(y)))\n}\n\nfunc abs64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc abs(x int) int {\n\treturn int(abs64(int64(x)))\n}\n\nfunc joinInt64s(a []int64, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.FormatInt(v, 10)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc joinInts(a []int, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.Itoa(v)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nfunc divUp64(x, y int64) int64 {\n\treturn (x + y - 1) / y\n}\n\nfunc divUp(x, y int) int {\n\treturn int(divUp64(int64(x), int64(y)))\n}\n\nfunc gcd64(x, y int64) int64 {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc gcd(x, y int) int {\n\treturn int(gcd64(int64(x), int64(y)))\n}\n\nfunc lcm64(x, y int64) int64 {\n\treturn x * y / gcd64(x, y)\n}\n\nfunc lcm(x, y int) int {\n\treturn int(lcm64(int64(x), int64(y)))\n}\n\nfunc main() {\n\tsolve()\n\twriter.Flush()\n}\n\nfunc solve() {\n\ts := nextLine()\n\tc := strings.Index(s, \"C\")\n\tif c == -1 {\n\t\tout(\"No\")\n\t\treturn\n\t}\n\tf := strings.Index(s[c:], \"F\")\n\tif f == -1 {\n\t\tout(\"No\")\n\t\treturn\n\t}\n\tout(\"Yes\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODEFESTIVAL, which can be shortened to the string CF by deleting some characters.\n\nMr. Takahashi, full of curiosity, wondered if he could obtain CF from other strings in the same way.\n\nYou are given a string s consisting of uppercase English letters.\nDetermine whether the string CF can be obtained from the string s by deleting some characters.\n\nConstraints\n\n2 ≤ |s| ≤ 100\n\nAll characters in s are uppercase English letters (A-Z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint Yes if the string CF can be obtained from the string s by deleting some characters.\nOtherwise print No.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nYes\n\nCF is obtained by deleting characters other than the first character C and the fifth character F.\n\nSample Input 2\n\nFESTIVALCODE\n\nSample Output 2\n\nNo\n\nFC can be obtained but CF cannot be obtained because you cannot change the order of the characters.\n\nSample Input 3\n\nCF\n\nSample Output 3\n\nYes\n\nIt is also possible not to delete any characters.\n\nSample Input 4\n\nFCF\n\nSample Output 4\n\nYes\n\nCF is obtained by deleting the first character.", "sample_input": "CODEFESTIVAL\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03957", "source_text": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODEFESTIVAL, which can be shortened to the string CF by deleting some characters.\n\nMr. Takahashi, full of curiosity, wondered if he could obtain CF from other strings in the same way.\n\nYou are given a string s consisting of uppercase English letters.\nDetermine whether the string CF can be obtained from the string s by deleting some characters.\n\nConstraints\n\n2 ≤ |s| ≤ 100\n\nAll characters in s are uppercase English letters (A-Z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint Yes if the string CF can be obtained from the string s by deleting some characters.\nOtherwise print No.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nYes\n\nCF is obtained by deleting characters other than the first character C and the fifth character F.\n\nSample Input 2\n\nFESTIVALCODE\n\nSample Output 2\n\nNo\n\nFC can be obtained but CF cannot be obtained because you cannot change the order of the characters.\n\nSample Input 3\n\nCF\n\nSample Output 3\n\nYes\n\nIt is also possible not to delete any characters.\n\nSample Input 4\n\nFCF\n\nSample Output 4\n\nYes\n\nCF is obtained by deleting the first character.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2517, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s895160590", "group_id": "codeNet:p03958", "input_text": "// 明らかに最大のやつに引っ張られる\n// それ以外のやつは最大のやつの合間にはさめばいいので、max(A)-1<=max(A)以外の合計、ならばいける\n// いけない場合はmax(A)-1-max(A)以外の合計かな\npackage main\n\nimport \"fmt\"\n\nvar k, t int\n\nfunc main() {\n\tfmt.Scan(&k, &t)\n\tmax_a := -1\n\tfor i := 0; i < t; i++ {\n\t\tvar j int\n\t\tfmt.Scan(&j)\n\t\tif j > max_a {\n\t\t\tmax_a = j\n\t\t}\n\t}\n\tsum := k - max_a\n\tif max_a-1 <= sum {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(max_a - 1 - sum)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593007890, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03958.html", "problem_id": "p03958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03958/input.txt", "sample_output_relpath": "derived/input_output/data/p03958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03958/Go/s895160590.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s895160590", "user_id": "u445624660"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "// 明らかに最大のやつに引っ張られる\n// それ以外のやつは最大のやつの合間にはさめばいいので、max(A)-1<=max(A)以外の合計、ならばいける\n// いけない場合はmax(A)-1-max(A)以外の合計かな\npackage main\n\nimport \"fmt\"\n\nvar k, t int\n\nfunc main() {\n\tfmt.Scan(&k, &t)\n\tmax_a := -1\n\tfor i := 0; i < t; i++ {\n\t\tvar j int\n\t\tfmt.Scan(&j)\n\t\tif j > max_a {\n\t\t\tmax_a = j\n\t\t}\n\t}\n\tsum := k - max_a\n\tif max_a-1 <= sum {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(max_a - 1 - sum)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are K pieces of cakes.\nMr. Takahashi would like to eat one cake per day, taking K days to eat them all.\n\nThere are T types of cake, and the number of the cakes of type i (1 ≤ i ≤ T) is a_i.\n\nEating the same type of cake two days in a row would be no fun,\nso Mr. Takahashi would like to decide the order for eating cakes that minimizes the number of days on which he has to eat the same type of cake as the day before.\n\nCompute the minimum number of days on which the same type of cake as the previous day will be eaten.\n\nConstraints\n\n1 ≤ K ≤ 10000\n\n1 ≤ T ≤ 100\n\n1 ≤ a_i ≤ 100\n\na_1 + a_2 + ... + a_T = K\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK T\na_1 a_2 ... a_T\n\nOutput\n\nPrint the minimum number of days on which the same type of cake as the previous day will be eaten.\n\nSample Input 1\n\n7 3\n3 2 2\n\nSample Output 1\n\n0\n\nFor example, if Mr. Takahashi eats cakes in the order of 2, 1, 2, 3, 1, 3, 1, he can avoid eating the same type of cake as the previous day.\n\nSample Input 2\n\n6 3\n1 4 1\n\nSample Output 2\n\n1\n\nThere are 6 cakes.\nFor example, if Mr. Takahashi eats cakes in the order of 2, 3, 2, 2, 1, 2, he has to eat the same type of cake (i.e., type 2) as the previous day only on the fourth day.\nSince this is the minimum number, the answer is 1.\n\nSample Input 3\n\n100 1\n100\n\nSample Output 3\n\n99\n\nSince Mr. Takahashi has only one type of cake, he has no choice but to eat the same type of cake as the previous day from the second day and after.", "sample_input": "7 3\n3 2 2\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03958", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are K pieces of cakes.\nMr. Takahashi would like to eat one cake per day, taking K days to eat them all.\n\nThere are T types of cake, and the number of the cakes of type i (1 ≤ i ≤ T) is a_i.\n\nEating the same type of cake two days in a row would be no fun,\nso Mr. Takahashi would like to decide the order for eating cakes that minimizes the number of days on which he has to eat the same type of cake as the day before.\n\nCompute the minimum number of days on which the same type of cake as the previous day will be eaten.\n\nConstraints\n\n1 ≤ K ≤ 10000\n\n1 ≤ T ≤ 100\n\n1 ≤ a_i ≤ 100\n\na_1 + a_2 + ... + a_T = K\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK T\na_1 a_2 ... a_T\n\nOutput\n\nPrint the minimum number of days on which the same type of cake as the previous day will be eaten.\n\nSample Input 1\n\n7 3\n3 2 2\n\nSample Output 1\n\n0\n\nFor example, if Mr. Takahashi eats cakes in the order of 2, 1, 2, 3, 1, 3, 1, he can avoid eating the same type of cake as the previous day.\n\nSample Input 2\n\n6 3\n1 4 1\n\nSample Output 2\n\n1\n\nThere are 6 cakes.\nFor example, if Mr. Takahashi eats cakes in the order of 2, 3, 2, 2, 1, 2, he has to eat the same type of cake (i.e., type 2) as the previous day only on the fourth day.\nSince this is the minimum number, the answer is 1.\n\nSample Input 3\n\n100 1\n100\n\nSample Output 3\n\n99\n\nSince Mr. Takahashi has only one type of cake, he has no choice but to eat the same type of cake as the previous day from the second day and after.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 526, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s243020411", "group_id": "codeNet:p03959", "input_text": "///\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sat May 26 17:04:42 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD int64 = 1e9 + 7\n\nvar N int\nvar T, A []int64\n\nfunc max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tfmt.Scan(&N)\n\tT = make([]int64, N)\n\tA = make([]int64, N)\n\n\tmax_t := int64(0)\n\tfor i := range T {\n\t\tfmt.Scan(&T[i])\n\t\tmax_t = max(max_t, T[i])\n\t}\n\n\tmax_a := int64(0)\n\tfor i := range A {\n\t\tfmt.Scan(&A[i])\n\t\tmax_a = max(max_a, A[i])\n\t}\n\n\tif max_a != max_t {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tdp := make([]int64, N)\n\tfor i := range T {\n\t\tif i != 0 {\n\t\t\tif T[i] != T[i-1] {\n\t\t\t\tdp[i] = 1\n\t\t\t} else {\n\t\t\t\tdp[i] = T[i]\n\t\t\t}\n\t\t} else {\n\t\t\tdp[i] = 1\n\t\t}\n\t}\n\n\tdp2 := make([]int64, N)\n\tfor i := len(A) - 1; i >= 0; i-- {\n\t\tif i != len(A)-1 {\n\t\t\tif A[i] != A[i+1] {\n\t\t\t\tdp2[i] = 1\n\t\t\t} else {\n\t\t\t\tdp2[i] = A[i]\n\t\t\t}\n\t\t} else {\n\t\t\tdp2[i] = 1\n\t\t}\n\t}\n\n\tfmt.Println(dp)\n\tfmt.Println(dp2)\n\n\tans := int64(1)\n\tfor i := range dp {\n\t\tans *= min(dp[i], dp2[i]) % MOD\n\t\tans %= MOD\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1527370333, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03959.html", "problem_id": "p03959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03959/input.txt", "sample_output_relpath": "derived/input_output/data/p03959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03959/Go/s243020411.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s243020411", "user_id": "u802614675"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "///\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sat May 26 17:04:42 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD int64 = 1e9 + 7\n\nvar N int\nvar T, A []int64\n\nfunc max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tfmt.Scan(&N)\n\tT = make([]int64, N)\n\tA = make([]int64, N)\n\n\tmax_t := int64(0)\n\tfor i := range T {\n\t\tfmt.Scan(&T[i])\n\t\tmax_t = max(max_t, T[i])\n\t}\n\n\tmax_a := int64(0)\n\tfor i := range A {\n\t\tfmt.Scan(&A[i])\n\t\tmax_a = max(max_a, A[i])\n\t}\n\n\tif max_a != max_t {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tdp := make([]int64, N)\n\tfor i := range T {\n\t\tif i != 0 {\n\t\t\tif T[i] != T[i-1] {\n\t\t\t\tdp[i] = 1\n\t\t\t} else {\n\t\t\t\tdp[i] = T[i]\n\t\t\t}\n\t\t} else {\n\t\t\tdp[i] = 1\n\t\t}\n\t}\n\n\tdp2 := make([]int64, N)\n\tfor i := len(A) - 1; i >= 0; i-- {\n\t\tif i != len(A)-1 {\n\t\t\tif A[i] != A[i+1] {\n\t\t\t\tdp2[i] = 1\n\t\t\t} else {\n\t\t\t\tdp2[i] = A[i]\n\t\t\t}\n\t\t} else {\n\t\t\tdp2[i] = 1\n\t\t}\n\t}\n\n\tfmt.Println(dp)\n\tfmt.Println(dp2)\n\n\tans := int64(1)\n\tfor i := range dp {\n\t\tans *= min(dp[i], dp2[i]) % MOD\n\t\tans %= MOD\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nMountaineers Mr. Takahashi and Mr. Aoki recently trekked across a certain famous mountain range.\nThe mountain range consists of N mountains, extending from west to east in a straight line as Mt. 1, Mt. 2, ..., Mt. N.\nMr. Takahashi traversed the range from the west and Mr. Aoki from the east.\n\nThe height of Mt. i is h_i, but they have forgotten the value of each h_i.\nInstead, for each i (1 ≤ i ≤ N), they recorded the maximum height of the mountains climbed up to the time they reached the peak of Mt. i (including Mt. i).\nMr. Takahashi's record is T_i and Mr. Aoki's record is A_i.\n\nWe know that the height of each mountain h_i is a positive integer.\nCompute the number of the possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nNote that the records may be incorrect and thus there may be no possible sequence of the mountains' heights.\nIn such a case, output 0.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ T_i ≤ 10^9\n\n1 ≤ A_i ≤ 10^9\n\nT_i ≤ T_{i+1} (1 ≤ i ≤ N - 1)\n\nA_i ≥ A_{i+1} (1 ≤ i ≤ N - 1)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nSample Input 1\n\n5\n1 3 3 3 3\n3 3 2 2 2\n\nSample Output 1\n\n4\n\nThe possible sequences of the mountains' heights are:\n\n1, 3, 2, 2, 2\n\n1, 3, 2, 1, 2\n\n1, 3, 1, 2, 2\n\n1, 3, 1, 1, 2\n\nfor a total of four sequences.\n\nSample Input 2\n\n5\n1 1 1 2 2\n3 2 1 1 1\n\nSample Output 2\n\n0\n\nThe records are contradictory, since Mr. Takahashi recorded 2 as the highest peak after climbing all the mountains but Mr. Aoki recorded 3.\n\nSample Input 3\n\n10\n1 3776 3776 8848 8848 8848 8848 8848 8848 8848\n8848 8848 8848 8848 8848 8848 8848 8848 3776 5\n\nSample Output 3\n\n884111967\n\nDon't forget to compute the number modulo 10^9 + 7.\n\nSample Input 4\n\n1\n17\n17\n\nSample Output 4\n\n1\n\nSome mountain ranges consist of only one mountain.", "sample_input": "5\n1 3 3 3 3\n3 3 2 2 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03959", "source_text": "Score : 400 points\n\nProblem Statement\n\nMountaineers Mr. Takahashi and Mr. Aoki recently trekked across a certain famous mountain range.\nThe mountain range consists of N mountains, extending from west to east in a straight line as Mt. 1, Mt. 2, ..., Mt. N.\nMr. Takahashi traversed the range from the west and Mr. Aoki from the east.\n\nThe height of Mt. i is h_i, but they have forgotten the value of each h_i.\nInstead, for each i (1 ≤ i ≤ N), they recorded the maximum height of the mountains climbed up to the time they reached the peak of Mt. i (including Mt. i).\nMr. Takahashi's record is T_i and Mr. Aoki's record is A_i.\n\nWe know that the height of each mountain h_i is a positive integer.\nCompute the number of the possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nNote that the records may be incorrect and thus there may be no possible sequence of the mountains' heights.\nIn such a case, output 0.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ T_i ≤ 10^9\n\n1 ≤ A_i ≤ 10^9\n\nT_i ≤ T_{i+1} (1 ≤ i ≤ N - 1)\n\nA_i ≥ A_{i+1} (1 ≤ i ≤ N - 1)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 T_2 ... T_N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of possible sequences of the mountains' heights, modulo 10^9 + 7.\n\nSample Input 1\n\n5\n1 3 3 3 3\n3 3 2 2 2\n\nSample Output 1\n\n4\n\nThe possible sequences of the mountains' heights are:\n\n1, 3, 2, 2, 2\n\n1, 3, 2, 1, 2\n\n1, 3, 1, 2, 2\n\n1, 3, 1, 1, 2\n\nfor a total of four sequences.\n\nSample Input 2\n\n5\n1 1 1 2 2\n3 2 1 1 1\n\nSample Output 2\n\n0\n\nThe records are contradictory, since Mr. Takahashi recorded 2 as the highest peak after climbing all the mountains but Mr. Aoki recorded 3.\n\nSample Input 3\n\n10\n1 3776 3776 8848 8848 8848 8848 8848 8848 8848\n8848 8848 8848 8848 8848 8848 8848 8848 3776 5\n\nSample Output 3\n\n884111967\n\nDon't forget to compute the number modulo 10^9 + 7.\n\nSample Input 4\n\n1\n17\n17\n\nSample Output 4\n\n1\n\nSome mountain ranges consist of only one mountain.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1102, "cpu_time_ms": 1508, "memory_kb": 11520}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s135174800", "group_id": "codeNet:p03962", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, ans int\n\tfmt.Scan(&a, &b, &c)\n\n\tif a == b && b == c {\n\t\tans = 1\n\t} else if a == b || b == c || c == a {\n\t\tans = 2\n\t} else {\n\t\tans = 3\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1560347228, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03962.html", "problem_id": "p03962", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03962/input.txt", "sample_output_relpath": "derived/input_output/data/p03962/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03962/Go/s135174800.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s135174800", "user_id": "u879870653"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, ans int\n\tfmt.Scan(&a, &b, &c)\n\n\tif a == b && b == c {\n\t\tans = 1\n\t} else if a == b || b == c || c == a {\n\t\tans = 2\n\t} else {\n\t\tans = 3\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer recently bought three paint cans.\nThe color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c.\nHere, the color of each paint can is represented by an integer between 1 and 100, inclusive.\n\nSince he is forgetful, he might have bought more than one paint can in the same color.\nCount the number of different kinds of colors of these paint cans and tell him.\n\nConstraints\n\n1≦a,b,c≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the number of different kinds of colors of the paint cans.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n3\n\nThree different colors: 1, 3, and 4.\n\nSample Input 2\n\n3 3 33\n\nSample Output 2\n\n2\n\nTwo different colors: 3 and 33.", "sample_input": "3 1 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03962", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer recently bought three paint cans.\nThe color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c.\nHere, the color of each paint can is represented by an integer between 1 and 100, inclusive.\n\nSince he is forgetful, he might have bought more than one paint can in the same color.\nCount the number of different kinds of colors of these paint cans and tell him.\n\nConstraints\n\n1≦a,b,c≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b c\n\nOutput\n\nPrint the number of different kinds of colors of the paint cans.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n3\n\nThree different colors: 1, 3, and 4.\n\nSample Input 2\n\n3 3 33\n\nSample Output 2\n\n2\n\nTwo different colors: 3 and 33.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s471395520", "group_id": "codeNet:p03963", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tk := nextInt()\n\tans := k\n\tfor i := 1; i < n; i++ {\n\t\tans *= k - 1\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1596944441, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03963.html", "problem_id": "p03963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03963/input.txt", "sample_output_relpath": "derived/input_output/data/p03963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03963/Go/s471395520.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s471395520", "user_id": "u756000295"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tk := nextInt()\n\tans := k\n\tfor i := 1; i < n; i++ {\n\t\tans *= k - 1\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N balls placed in a row.\nAtCoDeer the deer is painting each of these in one of the K colors of his paint cans.\nFor aesthetic reasons, any two adjacent balls must be painted in different colors.\n\nFind the number of the possible ways to paint the balls.\n\nConstraints\n\n1≦N≦1000\n\n2≦K≦1000\n\nThe correct answer is at most 2^{31}-1.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of the possible ways to paint the balls.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nWe will denote the colors by 0 and 1. There are two possible ways: we can either paint the left ball in color 0 and the right ball in color 1, or paint the left in color 1 and the right in color 0.\n\nSample Input 2\n\n1 10\n\nSample Output 2\n\n10\n\nSince there is only one ball, we can use any of the ten colors to paint it. Thus, the answer is ten.", "sample_input": "2 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03963", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N balls placed in a row.\nAtCoDeer the deer is painting each of these in one of the K colors of his paint cans.\nFor aesthetic reasons, any two adjacent balls must be painted in different colors.\n\nFind the number of the possible ways to paint the balls.\n\nConstraints\n\n1≦N≦1000\n\n2≦K≦1000\n\nThe correct answer is at most 2^{31}-1.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of the possible ways to paint the balls.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n2\n\nWe will denote the colors by 0 and 1. There are two possible ways: we can either paint the left ball in color 0 and the right ball in color 1, or paint the left in color 1 and the right in color 0.\n\nSample Input 2\n\n1 10\n\nSample Output 2\n\n10\n\nSince there is only one ball, we can use any of the ten colors to paint it. Thus, the answer is ten.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 553, "cpu_time_ms": 3, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s716372482", "group_id": "codeNet:p03964", "input_text": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc ceildiv(x, y int) int {\n return int(math.Ceil(float64(x) / float64(y)))\n}\n\nfunc main() {\n var n int\n var x, y int\n fmt.Scan(&n)\n a, b := 1, 1\n for i := 0; i < n; i++ {\n fmt.Scan(&x, &y)\n mx := ceildiv(a, x)\n my := ceildiv(b, y)\n m := my\n if mx > m {\n m = mx\n }\n a = m * x\n b = m * y\n }\n fmt.Println(a + b)\n}\n", "language": "Go", "metadata": {"date": 1591202175, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03964.html", "problem_id": "p03964", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03964/input.txt", "sample_output_relpath": "derived/input_output/data/p03964/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03964/Go/s716372482.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s716372482", "user_id": "u219197917"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc ceildiv(x, y int) int {\n return int(math.Ceil(float64(x) / float64(y)))\n}\n\nfunc main() {\n var n int\n var x, y int\n fmt.Scan(&n)\n a, b := 1, 1\n for i := 0; i < n; i++ {\n fmt.Scan(&x, &y)\n mx := ceildiv(a, x)\n my := ceildiv(b, y)\n m := my\n if mx > m {\n m = mx\n }\n a = m * x\n b = m * y\n }\n fmt.Println(a + b)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is seeing a quick report of election results on TV.\nTwo candidates are standing for the election: Takahashi and Aoki.\nThe report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes.\nAtCoDeer has checked the report N times, and when he checked it for the i-th (1≦i≦N) time, the ratio was T_i:A_i.\nIt is known that each candidate had at least one vote when he checked the report for the first time.\n\nFind the minimum possible total number of votes obtained by the two candidates when he checked the report for the N-th time.\nIt can be assumed that the number of votes obtained by each candidate never decreases.\n\nConstraints\n\n1≦N≦1000\n\n1≦T_i,A_i≦1000 (1≦i≦N)\n\nT_i and A_i (1≦i≦N) are coprime.\n\nIt is guaranteed that the correct answer is at most 10^{18}.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 A_1\nT_2 A_2\n:\nT_N A_N\n\nOutput\n\nPrint the minimum possible total number of votes obtained by Takahashi and Aoki when AtCoDeer checked the report for the N-th time.\n\nSample Input 1\n\n3\n2 3\n1 1\n3 2\n\nSample Output 1\n\n10\n\nWhen the numbers of votes obtained by the two candidates change as 2,3 → 3,3 → 6,4, the total number of votes at the end is 10, which is the minimum possible number.\n\nSample Input 2\n\n4\n1 1\n1 1\n1 5\n1 100\n\nSample Output 2\n\n101\n\nIt is possible that neither candidate obtained a vote between the moment when he checked the report, and the moment when he checked it for the next time.\n\nSample Input 3\n\n5\n3 10\n48 17\n31 199\n231 23\n3 2\n\nSample Output 3\n\n6930", "sample_input": "3\n2 3\n1 1\n3 2\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03964", "source_text": "Score : 300 points\n\nProblem Statement\n\nAtCoDeer the deer is seeing a quick report of election results on TV.\nTwo candidates are standing for the election: Takahashi and Aoki.\nThe report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes.\nAtCoDeer has checked the report N times, and when he checked it for the i-th (1≦i≦N) time, the ratio was T_i:A_i.\nIt is known that each candidate had at least one vote when he checked the report for the first time.\n\nFind the minimum possible total number of votes obtained by the two candidates when he checked the report for the N-th time.\nIt can be assumed that the number of votes obtained by each candidate never decreases.\n\nConstraints\n\n1≦N≦1000\n\n1≦T_i,A_i≦1000 (1≦i≦N)\n\nT_i and A_i (1≦i≦N) are coprime.\n\nIt is guaranteed that the correct answer is at most 10^{18}.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nT_1 A_1\nT_2 A_2\n:\nT_N A_N\n\nOutput\n\nPrint the minimum possible total number of votes obtained by Takahashi and Aoki when AtCoDeer checked the report for the N-th time.\n\nSample Input 1\n\n3\n2 3\n1 1\n3 2\n\nSample Output 1\n\n10\n\nWhen the numbers of votes obtained by the two candidates change as 2,3 → 3,3 → 6,4, the total number of votes at the end is 10, which is the minimum possible number.\n\nSample Input 2\n\n4\n1 1\n1 1\n1 5\n1 100\n\nSample Output 2\n\n101\n\nIt is possible that neither candidate obtained a vote between the moment when he checked the report, and the moment when he checked it for the next time.\n\nSample Input 3\n\n5\n3 10\n48 17\n31 199\n231 23\n3 2\n\nSample Output 3\n\n6930", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 393, "cpu_time_ms": 8, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s281487336", "group_id": "codeNet:p03986", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x string\n\tfmt.Scan(&x)\n\n\tans := 0\n\tsta := 0\n\tfor _, xx := range x {\n\t\tif xx == 'S' {\n\t\t\tsta++\n\t\t} else {\n\t\t\tif sta > 0 {\n\t\t\t\tsta--\n\t\t\t} else {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans + sta)\n}\n", "language": "Go", "metadata": {"date": 1559165461, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03986.html", "problem_id": "p03986", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03986/input.txt", "sample_output_relpath": "derived/input_output/data/p03986/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03986/Go/s281487336.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s281487336", "user_id": "u554269352"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x string\n\tfmt.Scan(&x)\n\n\tans := 0\n\tsta := 0\n\tfor _, xx := range x {\n\t\tif xx == 'S' {\n\t\t\tsta++\n\t\t} else {\n\t\t\tif sta > 0 {\n\t\t\t\tsta--\n\t\t\t} else {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans + sta)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "sample_input": "TSTTSS\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03986", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 239, "cpu_time_ms": 106, "memory_kb": 1920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s132096770", "group_id": "codeNet:p03986", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 4096)\n X := readLine(reader)\n arr := []byte(X)\n length := len(arr)\n var flag int = 0\n var cnt int = 0\n\n for i := length - 1; i >= 0; i-- {\n if flag == 0 {\n if string(arr[i]) == \"T\" {\n flag = 1\n }\n } else {\n if string(arr[i]) == \"S\" {\n cnt++\n }\n }\n }\n\n fmt.Println(length - cnt*2)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n buf := make([]byte, 0, 1024)\n\n for {\n l, p, _ := reader.ReadLine()\n\n buf = append(buf, l...)\n\n if !p {\n break\n }\n }\n\n return string(buf)\n}", "language": "Go", "metadata": {"date": 1558542679, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03986.html", "problem_id": "p03986", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03986/input.txt", "sample_output_relpath": "derived/input_output/data/p03986/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03986/Go/s132096770.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s132096770", "user_id": "u528868894"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 4096)\n X := readLine(reader)\n arr := []byte(X)\n length := len(arr)\n var flag int = 0\n var cnt int = 0\n\n for i := length - 1; i >= 0; i-- {\n if flag == 0 {\n if string(arr[i]) == \"T\" {\n flag = 1\n }\n } else {\n if string(arr[i]) == \"S\" {\n cnt++\n }\n }\n }\n\n fmt.Println(length - cnt*2)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n buf := make([]byte, 0, 1024)\n\n for {\n l, p, _ := reader.ReadLine()\n\n buf = append(buf, l...)\n\n if !p {\n break\n }\n }\n\n return string(buf)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "sample_input": "TSTTSS\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03986", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a string X, which has an even number of characters. Half the characters are S, and the other half are T.\n\nTakahashi, who hates the string ST, will perform the following operation 10^{10000} times:\n\nAmong the occurrences of ST in X as (contiguous) substrings, remove the leftmost one. If there is no occurrence, do nothing.\n\nFind the eventual length of X.\n\nConstraints\n\n2 ≦ |X| ≦ 200,000\n\nThe length of X is even.\n\nHalf the characters in X are S, and the other half are T.\n\nPartial Scores\n\nIn test cases worth 200 points, |X| ≦ 200.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the eventual length of X.\n\nSample Input 1\n\nTSTTSS\n\nSample Output 1\n\n4\n\nIn the 1-st operation, the 2-nd and 3-rd characters of TSTTSS are removed.\nX becomes TTSS, and since it does not contain ST anymore, nothing is done in the remaining 10^{10000}-1 operations.\nThus, the answer is 4.\n\nSample Input 2\n\nSSTTST\n\nSample Output 2\n\n0\n\nX will eventually become an empty string: SSTTST ⇒ STST ⇒ ST ⇒ ``.\n\nSample Input 3\n\nTSSTTTSS\n\nSample Output 3\n\n4\n\nX will become: TSSTTTSS ⇒ TSTTSS ⇒ TTSS.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 784, "cpu_time_ms": 7, "memory_kb": 2176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s062605018", "group_id": "codeNet:p03987", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tseg := Segment{}\n\tseg.init(n)\n\taa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[getNextInt(scanner)-1] = i\n\t}\n\tvar ans int64\n\tfor i := 0; i < n; i++ {\n\t\tseg.add(aa[i], 1)\n\t\tl := seg.nextLeft(aa[i])\n\t\tr := seg.nextRight(aa[i])\n\t\tans += int64(aa[i]-l) * int64(r-aa[i]) * int64(i+1)\n\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\n// Segment ...\ntype Segment struct {\n\tn, h, i int\n\tunit []int\n\tbucket [][]int\n}\n\nfunc (seg *Segment) init(n int) {\n\tseg.n = n\n\tseg.unit = make([]int, 1)\n\tseg.unit[0] = 1\n\tseg.bucket = make([][]int, 1)\n\tseg.bucket[0] = make([]int, n)\n\n\tchunk := 32\n\ti := 0\n\tfor n > chunk+1 {\n\t\tn = (n-1)/chunk + 1\n\t\tseg.bucket = append(seg.bucket, make([]int, n))\n\t\tseg.unit = append(seg.unit, seg.unit[i]*chunk)\n\t\ti++\n\t}\n\tseg.h = len(seg.unit)\n}\n\nfunc (seg *Segment) add(index, value int) {\n\tfor i := 0; i < seg.h; i++ {\n\t\tseg.bucket[i][index/seg.unit[i]] += value\n\t}\n}\n\nfunc (seg *Segment) nextLeft(index int) int {\n\traw := seg.bucket[0]\n\tfor index = index - 1; index >= 0; index-- {\n\t\tif raw[index] > 0 {\n\t\t\treturn index\n\t\t}\n\t\tfor seg.i = 0; seg.i < seg.h; seg.i++ {\n\t\t\tif (index+1)%seg.unit[seg.i] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seg.bucket[seg.i][index/seg.unit[seg.i]] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tseg.i--\n\t\tindex -= seg.unit[seg.i] - 1\n\t}\n\n\treturn -1\n}\n\nfunc (seg *Segment) nextRight(index int) int {\n\traw := seg.bucket[0]\n\tfor index = index + 1; index < seg.n; index++ {\n\t\tif raw[index] > 0 {\n\t\t\treturn index\n\t\t}\n\t\tfor seg.i = 0; seg.i < seg.h; seg.i++ {\n\t\t\tif index%seg.unit[seg.i] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seg.bucket[seg.i][index/seg.unit[seg.i]] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tseg.i--\n\n\t\tindex += seg.unit[seg.i] - 1\n\t}\n\n\treturn seg.n\n}\n\nfunc (seg *Segment) get(index int) int {\n\tfor i := 0; i < seg.n; i++ {\n\t\tfor seg.i = 0; seg.i < seg.h; seg.i++ {\n\t\t\tif index%seg.unit[seg.i] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seg.bucket[seg.i][index/seg.unit[seg.i]] >= index {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tseg.i--\n\n\t\tindex -= seg.bucket[seg.i][index/seg.unit[seg.i]]\n\t\ti += seg.unit[seg.i] - 1\n\n\t\tif index == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\n\treturn -1\n}\n", "language": "Go", "metadata": {"date": 1568498136, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03987.html", "problem_id": "p03987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03987/input.txt", "sample_output_relpath": "derived/input_output/data/p03987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03987/Go/s062605018.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s062605018", "user_id": "u150542210"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tseg := Segment{}\n\tseg.init(n)\n\taa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[getNextInt(scanner)-1] = i\n\t}\n\tvar ans int64\n\tfor i := 0; i < n; i++ {\n\t\tseg.add(aa[i], 1)\n\t\tl := seg.nextLeft(aa[i])\n\t\tr := seg.nextRight(aa[i])\n\t\tans += int64(aa[i]-l) * int64(r-aa[i]) * int64(i+1)\n\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\n// Segment ...\ntype Segment struct {\n\tn, h, i int\n\tunit []int\n\tbucket [][]int\n}\n\nfunc (seg *Segment) init(n int) {\n\tseg.n = n\n\tseg.unit = make([]int, 1)\n\tseg.unit[0] = 1\n\tseg.bucket = make([][]int, 1)\n\tseg.bucket[0] = make([]int, n)\n\n\tchunk := 32\n\ti := 0\n\tfor n > chunk+1 {\n\t\tn = (n-1)/chunk + 1\n\t\tseg.bucket = append(seg.bucket, make([]int, n))\n\t\tseg.unit = append(seg.unit, seg.unit[i]*chunk)\n\t\ti++\n\t}\n\tseg.h = len(seg.unit)\n}\n\nfunc (seg *Segment) add(index, value int) {\n\tfor i := 0; i < seg.h; i++ {\n\t\tseg.bucket[i][index/seg.unit[i]] += value\n\t}\n}\n\nfunc (seg *Segment) nextLeft(index int) int {\n\traw := seg.bucket[0]\n\tfor index = index - 1; index >= 0; index-- {\n\t\tif raw[index] > 0 {\n\t\t\treturn index\n\t\t}\n\t\tfor seg.i = 0; seg.i < seg.h; seg.i++ {\n\t\t\tif (index+1)%seg.unit[seg.i] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seg.bucket[seg.i][index/seg.unit[seg.i]] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tseg.i--\n\t\tindex -= seg.unit[seg.i] - 1\n\t}\n\n\treturn -1\n}\n\nfunc (seg *Segment) nextRight(index int) int {\n\traw := seg.bucket[0]\n\tfor index = index + 1; index < seg.n; index++ {\n\t\tif raw[index] > 0 {\n\t\t\treturn index\n\t\t}\n\t\tfor seg.i = 0; seg.i < seg.h; seg.i++ {\n\t\t\tif index%seg.unit[seg.i] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seg.bucket[seg.i][index/seg.unit[seg.i]] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tseg.i--\n\n\t\tindex += seg.unit[seg.i] - 1\n\t}\n\n\treturn seg.n\n}\n\nfunc (seg *Segment) get(index int) int {\n\tfor i := 0; i < seg.n; i++ {\n\t\tfor seg.i = 0; seg.i < seg.h; seg.i++ {\n\t\t\tif index%seg.unit[seg.i] != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seg.bucket[seg.i][index/seg.unit[seg.i]] >= index {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tseg.i--\n\n\t\tindex -= seg.bucket[seg.i][index/seg.unit[seg.i]]\n\t\ti += seg.unit[seg.i] - 1\n\n\t\tif index == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\n\treturn -1\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOne day, Snuke was given a permutation of length N, a_1, a_2, ..., a_N, from his friend.\n\nFind the following:\n\nConstraints\n\n1 ≦ N ≦ 200,000\n\n(a_1, a_2, ..., a_N) is a permutation of (1, 2, ..., N).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nNote that the answer may not fit into a 32-bit integer.\n\nSample Input 1\n\n3\n2 1 3\n\nSample Output 1\n\n9\n\nSample Input 2\n\n4\n1 3 2 4\n\nSample Output 2\n\n19\n\nSample Input 3\n\n8\n5 4 8 1 2 6 7 3\n\nSample Output 3\n\n85", "sample_input": "3\n2 1 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03987", "source_text": "Score : 400 points\n\nProblem Statement\n\nOne day, Snuke was given a permutation of length N, a_1, a_2, ..., a_N, from his friend.\n\nFind the following:\n\nConstraints\n\n1 ≦ N ≦ 200,000\n\n(a_1, a_2, ..., a_N) is a permutation of (1, 2, ..., N).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nNote that the answer may not fit into a 32-bit integer.\n\nSample Input 1\n\n3\n2 1 3\n\nSample Output 1\n\n9\n\nSample Input 2\n\n4\n1 3 2 4\n\nSample Output 2\n\n19\n\nSample Input 3\n\n8\n5 4 8 1 2 6 7 3\n\nSample Output 3\n\n85", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3027, "cpu_time_ms": 1326, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s049344424", "group_id": "codeNet:p03992", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r:rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tS := sc.NextLine()\n\tN := sc.NextInt()\n\n\ts := make([]int, len(S))\n\tfor i := 0; i < len(S); i++ {\n\t\ts[i] = int(S[i] - 'a')\n\t}\n\tfor i := 0; i < len(s) - 1; i++ {\n\t\tif s[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif 26 - s[i] <= N {\n\t\t\tN -= 26 - s[i]\n\t\t\ts[i] = 0\n\t\t}\n\t}\n\tp := len(s) - 1\n\n\tN %= 26\n\ts[p] += N\n\ts[p] %= 26\n\tfor i := 0; i < len(s); i++ {\n\t\tfmt.Print(string(s[i] + 'a'))\n\t}\n\tfmt.Println()\n\n}", "language": "Go", "metadata": {"date": 1474771102, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03992.html", "problem_id": "p03992", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03992/input.txt", "sample_output_relpath": "derived/input_output/data/p03992/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03992/Go/s049344424.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s049344424", "user_id": "u504669764"}, "prompt_components": {"gold_output": "CODE FESTIVAL\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r:rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tS := sc.NextLine()\n\tN := sc.NextInt()\n\n\ts := make([]int, len(S))\n\tfor i := 0; i < len(S); i++ {\n\t\ts[i] = int(S[i] - 'a')\n\t}\n\tfor i := 0; i < len(s) - 1; i++ {\n\t\tif s[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif 26 - s[i] <= N {\n\t\t\tN -= 26 - s[i]\n\t\t\ts[i] = 0\n\t\t}\n\t}\n\tp := len(s) - 1\n\n\tN %= 26\n\ts[p] += N\n\ts[p] %= 26\n\tfor i := 0; i < len(s); i++ {\n\t\tfmt.Print(string(s[i] + 'a'))\n\t}\n\tfmt.Println()\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODE FESTIVAL.\nHowever, Mr. Takahashi always writes it CODEFESTIVAL, omitting the single space between CODE and FESTIVAL.\n\nSo he has decided to make a program that puts the single space he omitted.\n\nYou are given a string s with 12 letters.\nOutput the string putting a single space between the first 4 letters and last 8 letters in the string s.\n\nConstraints\n\ns contains exactly 12 letters.\n\nAll letters in s are uppercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string putting a single space between the first 4 letters and last 8 letters in the string s.\nPut a line break at the end.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nCODE FESTIVAL\n\nPutting a single space between the first 4 letters and last 8 letters in CODEFESTIVAL makes it CODE FESTIVAL.\n\nSample Input 2\n\nPOSTGRADUATE\n\nSample Output 2\n\nPOST GRADUATE\n\nSample Input 3\n\nABCDEFGHIJKL\n\nSample Output 3\n\nABCD EFGHIJKL", "sample_input": "CODEFESTIVAL\n"}, "reference_outputs": ["CODE FESTIVAL\n"], "source_document_id": "p03992", "source_text": "Score : 100 points\n\nProblem Statement\n\nThis contest is CODE FESTIVAL.\nHowever, Mr. Takahashi always writes it CODEFESTIVAL, omitting the single space between CODE and FESTIVAL.\n\nSo he has decided to make a program that puts the single space he omitted.\n\nYou are given a string s with 12 letters.\nOutput the string putting a single space between the first 4 letters and last 8 letters in the string s.\n\nConstraints\n\ns contains exactly 12 letters.\n\nAll letters in s are uppercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string putting a single space between the first 4 letters and last 8 letters in the string s.\nPut a line break at the end.\n\nSample Input 1\n\nCODEFESTIVAL\n\nSample Output 1\n\nCODE FESTIVAL\n\nPutting a single space between the first 4 letters and last 8 letters in CODEFESTIVAL makes it CODE FESTIVAL.\n\nSample Input 2\n\nPOSTGRADUATE\n\nSample Output 2\n\nPOST GRADUATE\n\nSample Input 3\n\nABCDEFGHIJKL\n\nSample Output 3\n\nABCD EFGHIJKL", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1942, "cpu_time_ms": 5, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s543012938", "group_id": "codeNet:p03993", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tAn := make([]int, N)\n\tans := 0\n\tfor i := range An {\n\t\tAn[i] = nextInt()\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif An[An[i]-1]-1 == i {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1587865313, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03993.html", "problem_id": "p03993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03993/input.txt", "sample_output_relpath": "derived/input_output/data/p03993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03993/Go/s543012938.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s543012938", "user_id": "u605443479"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tAn := make([]int, N)\n\tans := 0\n\tfor i := range An {\n\t\tAn[i] = nextInt()\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif An[An[i]-1]-1 == i {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N rabbits, numbered 1 through N.\n\nThe i-th (1≤i≤N) rabbit likes rabbit a_i.\nNote that no rabbit can like itself, that is, a_i≠i.\n\nFor a pair of rabbits i and j (i<j), we call the pair (i,j) a friendly pair if the following condition is met.\n\nRabbit i likes rabbit j and rabbit j likes rabbit i.\n\nCalculate the number of the friendly pairs.\n\nConstraints\n\n2≤N≤10^5\n\n1≤a_i≤N\n\na_i≠i\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of the friendly pairs.\n\nSample Input 1\n\n4\n2 1 4 3\n\nSample Output 1\n\n2\n\nThere are two friendly pairs: (1,2) and (3,4).\n\nSample Input 2\n\n3\n2 3 1\n\nSample Output 2\n\n0\n\nThere are no friendly pairs.\n\nSample Input 3\n\n5\n5 5 5 5 1\n\nSample Output 3\n\n1\n\nThere is one friendly pair: (1,5).", "sample_input": "4\n2 1 4 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03993", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N rabbits, numbered 1 through N.\n\nThe i-th (1≤i≤N) rabbit likes rabbit a_i.\nNote that no rabbit can like itself, that is, a_i≠i.\n\nFor a pair of rabbits i and j (i<j), we call the pair (i,j) a friendly pair if the following condition is met.\n\nRabbit i likes rabbit j and rabbit j likes rabbit i.\n\nCalculate the number of the friendly pairs.\n\nConstraints\n\n2≤N≤10^5\n\n1≤a_i≤N\n\na_i≠i\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of the friendly pairs.\n\nSample Input 1\n\n4\n2 1 4 3\n\nSample Output 1\n\n2\n\nThere are two friendly pairs: (1,2) and (3,4).\n\nSample Input 2\n\n3\n2 3 1\n\nSample Output 2\n\n0\n\nThere are no friendly pairs.\n\nSample Input 3\n\n5\n5 5 5 5 1\n\nSample Output 3\n\n1\n\nThere is one friendly pair: (1,5).", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 574, "cpu_time_ms": 19, "memory_kb": 2560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s178157063", "group_id": "codeNet:p03994", "input_text": "// ProblemURL : https://atcoder.jp/contests/code-festival-2016-quala/tasks/codefestival_2016_qualA_c\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc calcMod(n int) int { return n % mod }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc powMod(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, maxBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tmaxBufSize = 1e6\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n\n\talphabetUpper = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetLower = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\ts := rs()\n\tk := ri()\n\tn := len(s)\n\n\tcosts := make([]int, n)\n\tfor i := range s {\n\t\tcosts[i] = (26 - int(s[i]-'a')) % 26\n\t}\n\n\tans := make([]byte, 0, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tif costs[i] <= k {\n\t\t\tans = append(ans, 'a')\n\t\t\tk -= costs[i]\n\t\t} else {\n\t\t\tans = append(ans, s[i])\n\t\t}\n\t}\n\tans = append(ans, byte((int(s[n-1]-'a')+k)%26+'a'))\n\tpln(string(ans))\n}\n", "language": "Go", "metadata": {"date": 1568318334, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03994.html", "problem_id": "p03994", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03994/input.txt", "sample_output_relpath": "derived/input_output/data/p03994/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03994/Go/s178157063.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s178157063", "user_id": "u554269352"}, "prompt_components": {"gold_output": "aya\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/code-festival-2016-quala/tasks/codefestival_2016_qualA_c\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc calcMod(n int) int { return n % mod }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc powMod(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, maxBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tmaxBufSize = 1e6\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n\n\talphabetUpper = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetLower = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\ts := rs()\n\tk := ri()\n\tn := len(s)\n\n\tcosts := make([]int, n)\n\tfor i := range s {\n\t\tcosts[i] = (26 - int(s[i]-'a')) % 26\n\t}\n\n\tans := make([]byte, 0, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tif costs[i] <= k {\n\t\t\tans = append(ans, 'a')\n\t\t\tk -= costs[i]\n\t\t} else {\n\t\t\tans = append(ans, s[i])\n\t\t}\n\t}\n\tans = append(ans, byte((int(s[n-1]-'a')+k)%26+'a'))\n\tpln(string(ans))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nMr. Takahashi has a string s consisting of lowercase English letters.\nHe repeats the following operation on s exactly K times.\n\nChoose an arbitrary letter on s and change that letter to the next alphabet. Note that the next letter of z is a.\n\nFor example, if you perform an operation for the second letter on aaz, aaz becomes abz.\nIf you then perform an operation for the third letter on abz, abz becomes aba.\n\nMr. Takahashi wants to have the lexicographically smallest string after performing exactly K operations on s.\nFind the such string.\n\nConstraints\n\n1≤|s|≤10^5\n\nAll letters in s are lowercase English letters.\n\n1≤K≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the lexicographically smallest string after performing exactly K operations on s.\n\nSample Input 1\n\nxyz\n4\n\nSample Output 1\n\naya\n\nFor example, you can perform the following operations: xyz, yyz, zyz, ayz, aya.\n\nSample Input 2\n\na\n25\n\nSample Output 2\n\nz\n\nYou have to perform exactly K operations.\n\nSample Input 3\n\ncodefestival\n100\n\nSample Output 3\n\naaaafeaaivap", "sample_input": "xyz\n4\n"}, "reference_outputs": ["aya\n"], "source_document_id": "p03994", "source_text": "Score : 400 points\n\nProblem Statement\n\nMr. Takahashi has a string s consisting of lowercase English letters.\nHe repeats the following operation on s exactly K times.\n\nChoose an arbitrary letter on s and change that letter to the next alphabet. Note that the next letter of z is a.\n\nFor example, if you perform an operation for the second letter on aaz, aaz becomes abz.\nIf you then perform an operation for the third letter on abz, abz becomes aba.\n\nMr. Takahashi wants to have the lexicographically smallest string after performing exactly K operations on s.\nFind the such string.\n\nConstraints\n\n1≤|s|≤10^5\n\nAll letters in s are lowercase English letters.\n\n1≤K≤10^9\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\nK\n\nOutput\n\nPrint the lexicographically smallest string after performing exactly K operations on s.\n\nSample Input 1\n\nxyz\n4\n\nSample Output 1\n\naya\n\nFor example, you can perform the following operations: xyz, yyz, zyz, ayz, aya.\n\nSample Input 2\n\na\n25\n\nSample Output 2\n\nz\n\nYou have to perform exactly K operations.\n\nSample Input 3\n\ncodefestival\n100\n\nSample Output 3\n\naaaafeaaivap", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6528, "cpu_time_ms": 18, "memory_kb": 2560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s638152402", "group_id": "codeNet:p03997", "input_text": "package main\n\nimport(\n\t\"fmt\"\n \t\"bufio\"\n \t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() int{\n sc.Scan()\n i, _:= strconv.Atoi(sc.Text())\n return i\n}\n\nfunc main(){\n a,b,h := nextLine(),nextLine(),nextLine()\n var total = 0\n if a==b && b == h && a == h{\n \ttotal = b*h\n }else{ \n total = (a + b)*h/2\n }\n fmt.Println(total)\n}\n", "language": "Go", "metadata": {"date": 1564742427, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03997.html", "problem_id": "p03997", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03997/input.txt", "sample_output_relpath": "derived/input_output/data/p03997/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03997/Go/s638152402.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s638152402", "user_id": "u875416576"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport(\n\t\"fmt\"\n \t\"bufio\"\n \t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() int{\n sc.Scan()\n i, _:= strconv.Atoi(sc.Text())\n return i\n}\n\nfunc main(){\n a,b,h := nextLine(),nextLine(),nextLine()\n var total = 0\n if a==b && b == h && a == h{\n \ttotal = b*h\n }else{ \n total = (a + b)*h/2\n }\n fmt.Println(total)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.\n\nAn example of a trapezoid\n\nFind the area of this trapezoid.\n\nConstraints\n\n1≦a≦100\n\n1≦b≦100\n\n1≦h≦100\n\nAll input values are integers.\n\nh is even.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na\nb\nh\n\nOutput\n\nPrint the area of the given trapezoid. It is guaranteed that the area is an integer.\n\nSample Input 1\n\n3\n4\n2\n\nSample Output 1\n\n7\n\nWhen the lengths of the upper base, lower base, and height are 3, 4, and 2, respectively, the area of the trapezoid is (3+4)×2/2 = 7.\n\nSample Input 2\n\n4\n4\n4\n\nSample Output 2\n\n16\n\nIn this case, a parallelogram is given, which is also a trapezoid.", "sample_input": "3\n4\n2\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03997", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.\n\nAn example of a trapezoid\n\nFind the area of this trapezoid.\n\nConstraints\n\n1≦a≦100\n\n1≦b≦100\n\n1≦h≦100\n\nAll input values are integers.\n\nh is even.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na\nb\nh\n\nOutput\n\nPrint the area of the given trapezoid. It is guaranteed that the area is an integer.\n\nSample Input 1\n\n3\n4\n2\n\nSample Output 1\n\n7\n\nWhen the lengths of the upper base, lower base, and height are 3, 4, and 2, respectively, the area of the trapezoid is (3+4)×2/2 = 7.\n\nSample Input 2\n\n4\n4\n4\n\nSample Output 2\n\n16\n\nIn this case, a parallelogram is given, which is also a trapezoid.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 362, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s961696819", "group_id": "codeNet:p03998", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tSa, Sb, Sc := nextLine(), nextLine(), nextLine()\n\tcur := Sa[0]\n\tSa = Sa[1:]\n\tfor {\n\t\tswitch cur {\n\t\tcase 'a':\n\t\t\tif len(Sa) == 1 {\n\t\t\t\tfmt.Println(\"A\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tSa = Sa[1:]\n\t\t\t}\n\t\t\tcur = Sa[0]\n\t\tcase 'b':\n\t\t\tif len(Sb) == 1 {\n\t\t\t\tfmt.Println(\"B\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tSb = Sb[1:]\n\t\t\t}\n\t\t\tcur = Sb[0]\n\t\tcase 'c':\n\t\t\tif len(Sc) == 1 {\n\t\t\t\tfmt.Println(\"C\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tSc = Sc[1:]\n\t\t\t}\n\t\t\tcur = Sc[0]\n\t\t}\n\t}\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// ここから拝借\n// https://shoman.hatenablog.com/entry/2020/02/25/185456\n// Stackは[]intのエイリアス\ntype Stack []int\n\n// Push adds an element\nfunc (s *Stack) Push(v int) {\n\t*s = append(*s, v)\n}\n\n// Pop removes the top element and return it\nfunc (s *Stack) Pop() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\tv := (*s)[len(*s)-1]\n\t*s = (*s)[:len(*s)-1]\n\treturn v, nil\n}\n\n// Peek returns the top value\nfunc (s *Stack) Peek() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\treturn (*s)[len(*s)-1], nil\n}\n\n// Size returns the length of stack\nfunc (s *Stack) Size() int {\n\treturn len(*s)\n}\n\n// Empty returns true when stack is empty\nfunc (s *Stack) Empty() bool {\n\treturn s.Size() == 0\n}\n\n// NewStack generates stack\nfunc NewStack() *Stack {\n\ts := new(Stack)\n\treturn s\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// この例では IntHeap にいくつかの整数を挿入しています。そして,最小値をチェックしてから,\n// 優先度順に取り除いています。\nfunc Example_intHeap() {\n\th := &IntHeap{2, 1, 5}\n\theap.Init(h)\n\theap.Push(h, 3)\n\tfmt.Printf(\"minimum: %d\\n\", (*h)[0])\n\tfor h.Len() > 0 {\n\t\tfmt.Printf(\"%d \", heap.Pop(h))\n\t}\n\t// Output:\n\t// minimum: 1\n\t// 1 2 3 5\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "language": "Go", "metadata": {"date": 1594022696, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03998.html", "problem_id": "p03998", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03998/input.txt", "sample_output_relpath": "derived/input_output/data/p03998/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03998/Go/s961696819.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s961696819", "user_id": "u605443479"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tSa, Sb, Sc := nextLine(), nextLine(), nextLine()\n\tcur := Sa[0]\n\tSa = Sa[1:]\n\tfor {\n\t\tswitch cur {\n\t\tcase 'a':\n\t\t\tif len(Sa) == 1 {\n\t\t\t\tfmt.Println(\"A\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tSa = Sa[1:]\n\t\t\t}\n\t\t\tcur = Sa[0]\n\t\tcase 'b':\n\t\t\tif len(Sb) == 1 {\n\t\t\t\tfmt.Println(\"B\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tSb = Sb[1:]\n\t\t\t}\n\t\t\tcur = Sb[0]\n\t\tcase 'c':\n\t\t\tif len(Sc) == 1 {\n\t\t\t\tfmt.Println(\"C\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tSc = Sc[1:]\n\t\t\t}\n\t\t\tcur = Sc[0]\n\t\t}\n\t}\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// ここから拝借\n// https://shoman.hatenablog.com/entry/2020/02/25/185456\n// Stackは[]intのエイリアス\ntype Stack []int\n\n// Push adds an element\nfunc (s *Stack) Push(v int) {\n\t*s = append(*s, v)\n}\n\n// Pop removes the top element and return it\nfunc (s *Stack) Pop() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\tv := (*s)[len(*s)-1]\n\t*s = (*s)[:len(*s)-1]\n\treturn v, nil\n}\n\n// Peek returns the top value\nfunc (s *Stack) Peek() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\treturn (*s)[len(*s)-1], nil\n}\n\n// Size returns the length of stack\nfunc (s *Stack) Size() int {\n\treturn len(*s)\n}\n\n// Empty returns true when stack is empty\nfunc (s *Stack) Empty() bool {\n\treturn s.Size() == 0\n}\n\n// NewStack generates stack\nfunc NewStack() *Stack {\n\ts := new(Stack)\n\treturn s\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// この例では IntHeap にいくつかの整数を挿入しています。そして,最小値をチェックしてから,\n// 優先度順に取り除いています。\nfunc Example_intHeap() {\n\th := &IntHeap{2, 1, 5}\n\theap.Init(h)\n\theap.Push(h, 3)\n\tfmt.Printf(\"minimum: %d\\n\", (*h)[0])\n\tfor h.Len() > 0 {\n\t\tfmt.Printf(\"%d \", heap.Pop(h))\n\t}\n\t// Output:\n\t// minimum: 1\n\t// 1 2 3 5\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAlice, Bob and Charlie are playing Card Game for Three, as below:\n\nAt first, each of the three players has a deck consisting of some number of cards. Each card has a letter a, b or c written on it. The orders of the cards in the decks cannot be rearranged.\n\nThe players take turns. Alice goes first.\n\nIf the current player's deck contains at least one card, discard the top card in the deck. Then, the player whose name begins with the letter on the discarded card, takes the next turn. (For example, if the card says a, Alice takes the next turn.)\n\nIf the current player's deck is empty, the game ends and the current player wins the game.\n\nYou are given the initial decks of the players.\nMore specifically, you are given three strings S_A, S_B and S_C. The i-th (1≦i≦|S_A|) letter in S_A is the letter on the i-th card in Alice's initial deck. S_B and S_C describes Bob's and Charlie's initial decks in the same way.\n\nDetermine the winner of the game.\n\nConstraints\n\n1≦|S_A|≦100\n\n1≦|S_B|≦100\n\n1≦|S_C|≦100\n\nEach letter in S_A, S_B, S_C is a, b or c.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS_A\nS_B\nS_C\n\nOutput\n\nIf Alice will win, print A. If Bob will win, print B. If Charlie will win, print C.\n\nSample Input 1\n\naca\naccc\nca\n\nSample Output 1\n\nA\n\nThe game will progress as below:\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice's deck is empty. The game ends and Alice wins the game.\n\nSample Input 2\n\nabcb\naacb\nbccc\n\nSample Output 2\n\nC", "sample_input": "aca\naccc\nca\n"}, "reference_outputs": ["A\n"], "source_document_id": "p03998", "source_text": "Score : 200 points\n\nProblem Statement\n\nAlice, Bob and Charlie are playing Card Game for Three, as below:\n\nAt first, each of the three players has a deck consisting of some number of cards. Each card has a letter a, b or c written on it. The orders of the cards in the decks cannot be rearranged.\n\nThe players take turns. Alice goes first.\n\nIf the current player's deck contains at least one card, discard the top card in the deck. Then, the player whose name begins with the letter on the discarded card, takes the next turn. (For example, if the card says a, Alice takes the next turn.)\n\nIf the current player's deck is empty, the game ends and the current player wins the game.\n\nYou are given the initial decks of the players.\nMore specifically, you are given three strings S_A, S_B and S_C. The i-th (1≦i≦|S_A|) letter in S_A is the letter on the i-th card in Alice's initial deck. S_B and S_C describes Bob's and Charlie's initial decks in the same way.\n\nDetermine the winner of the game.\n\nConstraints\n\n1≦|S_A|≦100\n\n1≦|S_B|≦100\n\n1≦|S_C|≦100\n\nEach letter in S_A, S_B, S_C is a, b or c.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS_A\nS_B\nS_C\n\nOutput\n\nIf Alice will win, print A. If Bob will win, print B. If Charlie will win, print C.\n\nSample Input 1\n\naca\naccc\nca\n\nSample Output 1\n\nA\n\nThe game will progress as below:\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, c. Charlie takes the next turn.\n\nCharlie discards the top card in his deck, a. Alice takes the next turn.\n\nAlice discards the top card in her deck, a. Alice takes the next turn.\n\nAlice's deck is empty. The game ends and Alice wins the game.\n\nSample Input 2\n\nabcb\naacb\nbccc\n\nSample Output 2\n\nC", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5607, "cpu_time_ms": 8, "memory_kb": 1876}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s671348332", "group_id": "codeNet:p04000", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/abc045/tasks/arc061_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\th, w, n int\n\tA, B []int\n\n\tmemo map[Coord]int\n\tanswers [15]int\n)\n\ntype Coord struct {\n\tx, y int\n}\n\nfunc main() {\n\th, w, n = ReadInt3()\n\tfor i := 0; i < n; i++ {\n\t\ta, b := ReadInt2()\n\t\tA = append(A, a)\n\t\tB = append(B, b)\n\t}\n\n\tmemo = make(map[Coord]int)\n\tfor i := 0; i < n; i++ {\n\t\ta, b := A[i], B[i]\n\n\t\tfor dy := -1; dy <= 1; dy++ {\n\t\t\tfor dx := -1; dx <= 1; dx++ {\n\t\t\t\tnx, ny := b+dx, a+dy\n\t\t\t\tnc := Coord{y: ny, x: nx}\n\t\t\t\tmemo[nc]++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor k, v := range memo {\n\t\tcx, cy := k.x, k.y\n\t\tif 2 <= cx && cx <= w-1 && 2 <= cy && cy <= h-1 {\n\t\t\tanswers[v]++\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := 1; i < 10; i++ {\n\t\tsum += answers[i]\n\t}\n\tanswers[0] = (h-2)*(w-2) - sum\n\n\tfor i := 0; i < 10; i++ {\n\t\tfmt.Println(answers[i])\n\t}\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1588611714, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04000.html", "problem_id": "p04000", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04000/input.txt", "sample_output_relpath": "derived/input_output/data/p04000/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04000/Go/s671348332.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s671348332", "user_id": "u103600314"}, "prompt_components": {"gold_output": "0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc045/tasks/arc061_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\th, w, n int\n\tA, B []int\n\n\tmemo map[Coord]int\n\tanswers [15]int\n)\n\ntype Coord struct {\n\tx, y int\n}\n\nfunc main() {\n\th, w, n = ReadInt3()\n\tfor i := 0; i < n; i++ {\n\t\ta, b := ReadInt2()\n\t\tA = append(A, a)\n\t\tB = append(B, b)\n\t}\n\n\tmemo = make(map[Coord]int)\n\tfor i := 0; i < n; i++ {\n\t\ta, b := A[i], B[i]\n\n\t\tfor dy := -1; dy <= 1; dy++ {\n\t\t\tfor dx := -1; dx <= 1; dx++ {\n\t\t\t\tnx, ny := b+dx, a+dy\n\t\t\t\tnc := Coord{y: ny, x: nx}\n\t\t\t\tmemo[nc]++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor k, v := range memo {\n\t\tcx, cy := k.x, k.y\n\t\tif 2 <= cx && cx <= w-1 && 2 <= cy && cy <= h-1 {\n\t\t\tanswers[v]++\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := 1; i < 10; i++ {\n\t\tsum += answers[i]\n\t}\n\tanswers[0] = (h-2)*(w-2) - sum\n\n\tfor i := 0; i < 10; i++ {\n\t\tfmt.Println(answers[i])\n\t}\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. At first, all cells were painted white.\n\nSnuke painted N of these cells. The i-th ( 1 \\leq i \\leq N ) cell he painted is the cell at the a_i-th row and b_i-th column.\n\nCompute the following:\n\nFor each integer j ( 0 \\leq j \\leq 9 ), how many subrectangles of size 3×3 of the grid contains exactly j black cells, after Snuke painted N cells?\n\nConstraints\n\n3 \\leq H \\leq 10^9\n\n3 \\leq W \\leq 10^9\n\n0 \\leq N \\leq min(10^5,H×W)\n\n1 \\leq a_i \\leq H (1 \\leq i \\leq N)\n\n1 \\leq b_i \\leq W (1 \\leq i \\leq N)\n\n(a_i, b_i) \\neq (a_j, b_j) (i \\neq j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W N\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint 10 lines.\nThe (j+1)-th ( 0 \\leq j \\leq 9 ) line should contain the number of the subrectangles of size 3×3 of the grid that contains exactly j black cells.\n\nSample Input 1\n\n4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n\nSample Output 1\n\n0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n\nThere are six subrectangles of size 3×3. Two of them contain three black cells each, and the remaining four contain four black cells each.\n\nSample Input 2\n\n10 10 20\n1 1\n1 4\n1 9\n2 5\n3 10\n4 2\n4 7\n5 9\n6 4\n6 6\n6 7\n7 1\n7 3\n7 7\n8 1\n8 5\n8 10\n9 2\n10 4\n10 9\n\nSample Output 2\n\n4\n26\n22\n10\n2\n0\n0\n0\n0\n0\n\nSample Input 3\n\n1000000000 1000000000 0\n\nSample Output 3\n\n999999996000000004\n0\n0\n0\n0\n0\n0\n0\n0\n0", "sample_input": "4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n"}, "reference_outputs": ["0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n"], "source_document_id": "p04000", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. At first, all cells were painted white.\n\nSnuke painted N of these cells. The i-th ( 1 \\leq i \\leq N ) cell he painted is the cell at the a_i-th row and b_i-th column.\n\nCompute the following:\n\nFor each integer j ( 0 \\leq j \\leq 9 ), how many subrectangles of size 3×3 of the grid contains exactly j black cells, after Snuke painted N cells?\n\nConstraints\n\n3 \\leq H \\leq 10^9\n\n3 \\leq W \\leq 10^9\n\n0 \\leq N \\leq min(10^5,H×W)\n\n1 \\leq a_i \\leq H (1 \\leq i \\leq N)\n\n1 \\leq b_i \\leq W (1 \\leq i \\leq N)\n\n(a_i, b_i) \\neq (a_j, b_j) (i \\neq j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W N\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint 10 lines.\nThe (j+1)-th ( 0 \\leq j \\leq 9 ) line should contain the number of the subrectangles of size 3×3 of the grid that contains exactly j black cells.\n\nSample Input 1\n\n4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n\nSample Output 1\n\n0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n\nThere are six subrectangles of size 3×3. Two of them contain three black cells each, and the remaining four contain four black cells each.\n\nSample Input 2\n\n10 10 20\n1 1\n1 4\n1 9\n2 5\n3 10\n4 2\n4 7\n5 9\n6 4\n6 6\n6 7\n7 1\n7 3\n7 7\n8 1\n8 5\n8 10\n9 2\n10 4\n10 9\n\nSample Output 2\n\n4\n26\n22\n10\n2\n0\n0\n0\n0\n0\n\nSample Input 3\n\n1000000000 1000000000 0\n\nSample Output 3\n\n999999996000000004\n0\n0\n0\n0\n0\n0\n0\n0\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5700, "cpu_time_ms": 370, "memory_kb": 115968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s414949426", "group_id": "codeNet:p04000", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\t//in := bufio.NewReader(os.Stdin)\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tin := bytes.NewBuffer(b)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\ntype p struct{ r, c int }\n\nfunc (con *contest) main() error {\n\tvar H, W, N int\n\tcon.scan(&H, &W, &N)\n\tM := map[p]int{}\n\tfor i := 0; i < N; i++ {\n\t\tvar a, b int\n\t\tcon.scan(&a, &b)\n\t\tfor r := a - 3; r < a; r++ {\n\t\t\tif r < 0 || r > H-3 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor c := b - 3; c < b; c++ {\n\t\t\t\tif c < 0 || c > W-3 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tM[p{r, c}]++\n\t\t\t}\n\t\t}\n\t}\n\tA := make([]int, 10)\n\tfor _, v := range M {\n\t\tA[v]++\n\t}\n\tA[0] = (H-2)*(W-2) - len(M)\n\tfor _, a := range A {\n\t\tcon.println(a)\n\t}\n\treturn nil\n}\n", "language": "Go", "metadata": {"date": 1576973072, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04000.html", "problem_id": "p04000", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04000/input.txt", "sample_output_relpath": "derived/input_output/data/p04000/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04000/Go/s414949426.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s414949426", "user_id": "u718747410"}, "prompt_components": {"gold_output": "0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\t//in := bufio.NewReader(os.Stdin)\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tin := bytes.NewBuffer(b)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\ntype p struct{ r, c int }\n\nfunc (con *contest) main() error {\n\tvar H, W, N int\n\tcon.scan(&H, &W, &N)\n\tM := map[p]int{}\n\tfor i := 0; i < N; i++ {\n\t\tvar a, b int\n\t\tcon.scan(&a, &b)\n\t\tfor r := a - 3; r < a; r++ {\n\t\t\tif r < 0 || r > H-3 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor c := b - 3; c < b; c++ {\n\t\t\t\tif c < 0 || c > W-3 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tM[p{r, c}]++\n\t\t\t}\n\t\t}\n\t}\n\tA := make([]int, 10)\n\tfor _, v := range M {\n\t\tA[v]++\n\t}\n\tA[0] = (H-2)*(W-2) - len(M)\n\tfor _, a := range A {\n\t\tcon.println(a)\n\t}\n\treturn nil\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. At first, all cells were painted white.\n\nSnuke painted N of these cells. The i-th ( 1 \\leq i \\leq N ) cell he painted is the cell at the a_i-th row and b_i-th column.\n\nCompute the following:\n\nFor each integer j ( 0 \\leq j \\leq 9 ), how many subrectangles of size 3×3 of the grid contains exactly j black cells, after Snuke painted N cells?\n\nConstraints\n\n3 \\leq H \\leq 10^9\n\n3 \\leq W \\leq 10^9\n\n0 \\leq N \\leq min(10^5,H×W)\n\n1 \\leq a_i \\leq H (1 \\leq i \\leq N)\n\n1 \\leq b_i \\leq W (1 \\leq i \\leq N)\n\n(a_i, b_i) \\neq (a_j, b_j) (i \\neq j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W N\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint 10 lines.\nThe (j+1)-th ( 0 \\leq j \\leq 9 ) line should contain the number of the subrectangles of size 3×3 of the grid that contains exactly j black cells.\n\nSample Input 1\n\n4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n\nSample Output 1\n\n0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n\nThere are six subrectangles of size 3×3. Two of them contain three black cells each, and the remaining four contain four black cells each.\n\nSample Input 2\n\n10 10 20\n1 1\n1 4\n1 9\n2 5\n3 10\n4 2\n4 7\n5 9\n6 4\n6 6\n6 7\n7 1\n7 3\n7 7\n8 1\n8 5\n8 10\n9 2\n10 4\n10 9\n\nSample Output 2\n\n4\n26\n22\n10\n2\n0\n0\n0\n0\n0\n\nSample Input 3\n\n1000000000 1000000000 0\n\nSample Output 3\n\n999999996000000004\n0\n0\n0\n0\n0\n0\n0\n0\n0", "sample_input": "4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n"}, "reference_outputs": ["0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n"], "source_document_id": "p04000", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns. At first, all cells were painted white.\n\nSnuke painted N of these cells. The i-th ( 1 \\leq i \\leq N ) cell he painted is the cell at the a_i-th row and b_i-th column.\n\nCompute the following:\n\nFor each integer j ( 0 \\leq j \\leq 9 ), how many subrectangles of size 3×3 of the grid contains exactly j black cells, after Snuke painted N cells?\n\nConstraints\n\n3 \\leq H \\leq 10^9\n\n3 \\leq W \\leq 10^9\n\n0 \\leq N \\leq min(10^5,H×W)\n\n1 \\leq a_i \\leq H (1 \\leq i \\leq N)\n\n1 \\leq b_i \\leq W (1 \\leq i \\leq N)\n\n(a_i, b_i) \\neq (a_j, b_j) (i \\neq j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W N\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint 10 lines.\nThe (j+1)-th ( 0 \\leq j \\leq 9 ) line should contain the number of the subrectangles of size 3×3 of the grid that contains exactly j black cells.\n\nSample Input 1\n\n4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n\nSample Output 1\n\n0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n\nThere are six subrectangles of size 3×3. Two of them contain three black cells each, and the remaining four contain four black cells each.\n\nSample Input 2\n\n10 10 20\n1 1\n1 4\n1 9\n2 5\n3 10\n4 2\n4 7\n5 9\n6 4\n6 6\n6 7\n7 1\n7 3\n7 7\n8 1\n8 5\n8 10\n9 2\n10 4\n10 9\n\nSample Output 2\n\n4\n26\n22\n10\n2\n0\n0\n0\n0\n0\n\nSample Input 3\n\n1000000000 1000000000 0\n\nSample Output 3\n\n999999996000000004\n0\n0\n0\n0\n0\n0\n0\n0\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1446, "cpu_time_ms": 611, "memory_kb": 113664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s010287682", "group_id": "codeNet:p04001", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sum int\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\ta := toSlice(s)\n\tp := make([]int, len(a)-1)\n\n\tsolve(a, 0, 1, &p)\n\tsolve(a, 0, -1, &p)\n\tfmt.Println(sum)\n}\n\nfunc toSlice(s string) []int {\n\tvar a []int\n\tfor i := 0; i < len(s); i++ {\n\t\ta = append(a, toInt(string(s[i])))\n\t}\n\treturn a\n}\n\nfunc solve(a []int, i int, b int, p *[]int) {\n\tif i == len(a)-1 {\n\t\treturn\n\t}\n\t(*p)[i] = b\n\tif i == (len(a) - 2) {\n\t\tsum += getSum(genNum(a, p))\n\t}\n\tsolve(a, i+1, 1, p)\n\tsolve(a, i+1, -1, p)\n}\n\nfunc genNum(a []int, p *[]int) string {\n\tvar s string\n\tfor j := 0; j < len(a)-1; j++ {\n\t\ts += fmt.Sprintf(\"%d\", a[j])\n\t\tif (*p)[j] == 1 {\n\t\t\ts += \"+\"\n\t\t}\n\t}\n\ts += fmt.Sprintf(\"%d\", a[len(a)-1])\n\treturn s\n}\n\nfunc getSum(s string) int {\n\tsum := 0\n\tfor _, v := range strings.Split(s, \"+\") {\n\t\tsum += toInt(v)\n\t}\n\treturn sum\n}\n\nfunc toInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1589539355, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04001.html", "problem_id": "p04001", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04001/input.txt", "sample_output_relpath": "derived/input_output/data/p04001/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04001/Go/s010287682.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s010287682", "user_id": "u259752752"}, "prompt_components": {"gold_output": "176\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sum int\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\ta := toSlice(s)\n\tp := make([]int, len(a)-1)\n\n\tsolve(a, 0, 1, &p)\n\tsolve(a, 0, -1, &p)\n\tfmt.Println(sum)\n}\n\nfunc toSlice(s string) []int {\n\tvar a []int\n\tfor i := 0; i < len(s); i++ {\n\t\ta = append(a, toInt(string(s[i])))\n\t}\n\treturn a\n}\n\nfunc solve(a []int, i int, b int, p *[]int) {\n\tif i == len(a)-1 {\n\t\treturn\n\t}\n\t(*p)[i] = b\n\tif i == (len(a) - 2) {\n\t\tsum += getSum(genNum(a, p))\n\t}\n\tsolve(a, i+1, 1, p)\n\tsolve(a, i+1, -1, p)\n}\n\nfunc genNum(a []int, p *[]int) string {\n\tvar s string\n\tfor j := 0; j < len(a)-1; j++ {\n\t\ts += fmt.Sprintf(\"%d\", a[j])\n\t\tif (*p)[j] == 1 {\n\t\t\ts += \"+\"\n\t\t}\n\t}\n\ts += fmt.Sprintf(\"%d\", a[len(a)-1])\n\treturn s\n}\n\nfunc getSum(s string) int {\n\tsum := 0\n\tfor _, v := range strings.Split(s, \"+\") {\n\t\tsum += toInt(v)\n\t}\n\treturn sum\n}\n\nfunc toInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\n\nAll strings that can be obtained in this way can be evaluated as formulas.\n\nEvaluate all possible formulas, and print the sum of the results.\n\nConstraints\n\n1 \\leq |S| \\leq 10\n\nAll letters in S are digits between 1 and 9, inclusive.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the evaluated value over all possible formulas.\n\nSample Input 1\n\n125\n\nSample Output 1\n\n176\n\nThere are 4 formulas that can be obtained: 125, 1+25, 12+5 and 1+2+5. When each formula is evaluated,\n\n125\n\n1+25=26\n\n12+5=17\n\n1+2+5=8\n\nThus, the sum is 125+26+17+8=176.\n\nSample Input 2\n\n9999999999\n\nSample Output 2\n\n12656242944", "sample_input": "125\n"}, "reference_outputs": ["176\n"], "source_document_id": "p04001", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\n\nAll strings that can be obtained in this way can be evaluated as formulas.\n\nEvaluate all possible formulas, and print the sum of the results.\n\nConstraints\n\n1 \\leq |S| \\leq 10\n\nAll letters in S are digits between 1 and 9, inclusive.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the evaluated value over all possible formulas.\n\nSample Input 1\n\n125\n\nSample Output 1\n\n176\n\nThere are 4 formulas that can be obtained: 125, 1+25, 12+5 and 1+2+5. When each formula is evaluated,\n\n125\n\n1+25=26\n\n12+5=17\n\n1+2+5=8\n\nThus, the sum is 125+26+17+8=176.\n\nSample Input 2\n\n9999999999\n\nSample Output 2\n\n12656242944", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 963, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s844341443", "group_id": "codeNet:p04001", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// var end int\n// var slice []string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\t// slice = strings.Split(nextLine(), \"\")\n\t// end = len(slice)\n\n\ts := nextLine()\n\n\t// sum := 0\n\t// for i := 1; i < len(s); i++ {\n\t// \ts1 := s[0:i]\n\t// \tfmt.Printf(\"s1=%s \", s1)\n\t// \ta, _ := strconv.Atoi(s1)\n\t// \tsum += a\n\t// \tfor j := i + 1; j < len(s); j++ {\n\t// \t\ts2 := s[i:j]\n\t// \t\tfmt.Printf(\"s2=%s \", s2)\n\t// \t\tb, _ := strconv.Atoi(s2)\n\t// \t\tsum += b\n\t// \t}\n\t// \tfmt.Println()\n\t// }\n\n\t// fmt.Println(sum)\n\n\t// fmt.Println(s)\n\t// fmt.Println(s[0])\n\t// fmt.Println(s[0:1])\n\t// fmt.Println(s[0:2])\n\t// fmt.Println(s[1:len(s)])\n\tans := dfs(0, s)\n\tfmt.Println(ans)\n}\n\nfunc dfs(sum int, s string) int {\n\tresult := sum\n\tfor i := 1; i < len(s); i++ {\n\t\ta, _ := strconv.Atoi(s[0:i])\n\t\tresult += dfs(sum+a, s[i:len(s)])\n\t}\n\ta, _ := strconv.Atoi(s)\n\treturn result + a\n}\n\n// func dfs(sum int, s string) int {\n\n// \tif len(s) == 0 {\n// \t\treturn sum\n// \t}\n\n// if i == len(s)+1 {\n// \treturn sum\n// }\n\n// i番目の後ろに+を挿入する場合\n// var sum1 int\n// s1, _ := strconv.Atoi(s[0:1])\n\n// fmt.Printf(\"sum+s1=%d sum=%d s1=%d, s[i:len(s)]=%s\\n\", sum+s1, sum, s1, s[1:len(s)])\n// sum1 += dfs(sum+s1, s[1:len(s)])\n\n// i番目の後ろに+を挿入しない場合\n// var sum2 int\n// // s2, _ := strconv.Atoi(s[0:len(s)])\n// fmt.Printf(\"sum+s2=%d sum=%d s2=%d, s[0:len(s)]=%s\\n\", sum+0, sum, 0, s[0:len(s)])\n// sum2 += dfs(sum, s[0:len(s)])\n\n// return sum2\n// }\n", "language": "Go", "metadata": {"date": 1560959681, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04001.html", "problem_id": "p04001", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04001/input.txt", "sample_output_relpath": "derived/input_output/data/p04001/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04001/Go/s844341443.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s844341443", "user_id": "u710190793"}, "prompt_components": {"gold_output": "176\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// var end int\n// var slice []string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\t// slice = strings.Split(nextLine(), \"\")\n\t// end = len(slice)\n\n\ts := nextLine()\n\n\t// sum := 0\n\t// for i := 1; i < len(s); i++ {\n\t// \ts1 := s[0:i]\n\t// \tfmt.Printf(\"s1=%s \", s1)\n\t// \ta, _ := strconv.Atoi(s1)\n\t// \tsum += a\n\t// \tfor j := i + 1; j < len(s); j++ {\n\t// \t\ts2 := s[i:j]\n\t// \t\tfmt.Printf(\"s2=%s \", s2)\n\t// \t\tb, _ := strconv.Atoi(s2)\n\t// \t\tsum += b\n\t// \t}\n\t// \tfmt.Println()\n\t// }\n\n\t// fmt.Println(sum)\n\n\t// fmt.Println(s)\n\t// fmt.Println(s[0])\n\t// fmt.Println(s[0:1])\n\t// fmt.Println(s[0:2])\n\t// fmt.Println(s[1:len(s)])\n\tans := dfs(0, s)\n\tfmt.Println(ans)\n}\n\nfunc dfs(sum int, s string) int {\n\tresult := sum\n\tfor i := 1; i < len(s); i++ {\n\t\ta, _ := strconv.Atoi(s[0:i])\n\t\tresult += dfs(sum+a, s[i:len(s)])\n\t}\n\ta, _ := strconv.Atoi(s)\n\treturn result + a\n}\n\n// func dfs(sum int, s string) int {\n\n// \tif len(s) == 0 {\n// \t\treturn sum\n// \t}\n\n// if i == len(s)+1 {\n// \treturn sum\n// }\n\n// i番目の後ろに+を挿入する場合\n// var sum1 int\n// s1, _ := strconv.Atoi(s[0:1])\n\n// fmt.Printf(\"sum+s1=%d sum=%d s1=%d, s[i:len(s)]=%s\\n\", sum+s1, sum, s1, s[1:len(s)])\n// sum1 += dfs(sum+s1, s[1:len(s)])\n\n// i番目の後ろに+を挿入しない場合\n// var sum2 int\n// // s2, _ := strconv.Atoi(s[0:len(s)])\n// fmt.Printf(\"sum+s2=%d sum=%d s2=%d, s[0:len(s)]=%s\\n\", sum+0, sum, 0, s[0:len(s)])\n// sum2 += dfs(sum, s[0:len(s)])\n\n// return sum2\n// }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\n\nAll strings that can be obtained in this way can be evaluated as formulas.\n\nEvaluate all possible formulas, and print the sum of the results.\n\nConstraints\n\n1 \\leq |S| \\leq 10\n\nAll letters in S are digits between 1 and 9, inclusive.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the evaluated value over all possible formulas.\n\nSample Input 1\n\n125\n\nSample Output 1\n\n176\n\nThere are 4 formulas that can be obtained: 125, 1+25, 12+5 and 1+2+5. When each formula is evaluated,\n\n125\n\n1+25=26\n\n12+5=17\n\n1+2+5=8\n\nThus, the sum is 125+26+17+8=176.\n\nSample Input 2\n\n9999999999\n\nSample Output 2\n\n12656242944", "sample_input": "125\n"}, "reference_outputs": ["176\n"], "source_document_id": "p04001", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\n\nAll strings that can be obtained in this way can be evaluated as formulas.\n\nEvaluate all possible formulas, and print the sum of the results.\n\nConstraints\n\n1 \\leq |S| \\leq 10\n\nAll letters in S are digits between 1 and 9, inclusive.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the sum of the evaluated value over all possible formulas.\n\nSample Input 1\n\n125\n\nSample Output 1\n\n176\n\nThere are 4 formulas that can be obtained: 125, 1+25, 12+5 and 1+2+5. When each formula is evaluated,\n\n125\n\n1+25=26\n\n12+5=17\n\n1+2+5=8\n\nThus, the sum is 125+26+17+8=176.\n\nSample Input 2\n\n9999999999\n\nSample Output 2\n\n12656242944", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1696, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s644546481", "group_id": "codeNet:p04011", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, x, y int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n\", &n, &k, &x, &y)\n\n\tif n-k > 0 {\n\t\tfmt.Println(k*x + (n-k)*y)\n\t} else {\n\t\tfmt.Println(n * x)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1517105529, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04011.html", "problem_id": "p04011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04011/input.txt", "sample_output_relpath": "derived/input_output/data/p04011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04011/Go/s644546481.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s644546481", "user_id": "u863370423"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, x, y int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n\", &n, &k, &x, &y)\n\n\tif n-k > 0 {\n\t\tfmt.Println(k*x + (n-k)*y)\n\t} else {\n\t\tfmt.Println(n * x)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "sample_input": "5\n3\n10000\n9000\n"}, "reference_outputs": ["48000\n"], "source_document_id": "p04011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 189, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s389859783", "group_id": "codeNet:p04011", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, x, y int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n\", &n, &k, &x, &y)\n\n\tif n-k > 0 {\n\t\tfmt.Println(k*x + (n-k)*y)\n\t} else {\n\t\tfmt.Println(n * x)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1517105528, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04011.html", "problem_id": "p04011", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04011/input.txt", "sample_output_relpath": "derived/input_output/data/p04011/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04011/Go/s389859783.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s389859783", "user_id": "u018679195"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, x, y int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n\", &n, &k, &x, &y)\n\n\tif n-k > 0 {\n\t\tfmt.Println(k*x + (n-k)*y)\n\t} else {\n\t\tfmt.Println(n * x)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "sample_input": "5\n3\n10000\n9000\n"}, "reference_outputs": ["48000\n"], "source_document_id": "p04011", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a hotel with the following accommodation fee:\n\nX yen (the currency of Japan) per night, for the first K nights\n\nY yen per night, for the (K+1)-th and subsequent nights\n\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\nConstraints\n\n1 \\leq N, K \\leq 10000\n\n1 \\leq Y < X \\leq 10000\n\nN,\\,K,\\,X,\\,Y are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nK\nX\nY\n\nOutput\n\nPrint Tak's total accommodation fee.\n\nSample Input 1\n\n5\n3\n10000\n9000\n\nSample Output 1\n\n48000\n\nThe accommodation fee is as follows:\n\n10000 yen for the 1-st night\n\n10000 yen for the 2-nd night\n\n10000 yen for the 3-rd night\n\n9000 yen for the 4-th night\n\n9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\nSample Input 2\n\n2\n3\n10000\n9000\n\nSample Output 2\n\n20000", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 189, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s510538329", "group_id": "codeNet:p04012", "input_text": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\nfunc main() {\n\tvar w string\n\tfmt.Scan(&w)\n\n\tws := strings.Split(w, \"\")\n\tcns := make(map[string]int)\n\tfor _, ww := range ws {\n\t\tcns[ww] += 1\n\t}\n\n\tfor _, v := range cns {\n\t\tif v%2 != 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}", "language": "Go", "metadata": {"date": 1591702709, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04012.html", "problem_id": "p04012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04012/input.txt", "sample_output_relpath": "derived/input_output/data/p04012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04012/Go/s510538329.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s510538329", "user_id": "u760948618"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\nfunc main() {\n\tvar w string\n\tfmt.Scan(&w)\n\n\tws := strings.Split(w, \"\")\n\tcns := make(map[string]int)\n\tfor _, ww := range ws {\n\t\tcns[ww] += 1\n\t}\n\n\tfor _, v := range cns {\n\t\tif v%2 != 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "sample_input": "abaccaba\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p04012", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 290, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s292287342", "group_id": "codeNet:p04012", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tm := make(map[rune]int)\n\tfor _, v := range s {\n\t\tm[v]++\n\t}\n\tok := true\n\tfor _, v := range m {\n\t\tif v%2 != 0 {\n\t\t\tok = false\n\t\t}\n\t}\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1554345477, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04012.html", "problem_id": "p04012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04012/input.txt", "sample_output_relpath": "derived/input_output/data/p04012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04012/Go/s292287342.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s292287342", "user_id": "u196030116"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tm := make(map[rune]int)\n\tfor _, v := range s {\n\t\tm[v]++\n\t}\n\tok := true\n\tfor _, v := range m {\n\t\tif v%2 != 0 {\n\t\t\tok = false\n\t\t}\n\t}\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "sample_input": "abaccaba\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p04012", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s180983275", "group_id": "codeNet:p04012", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tw := []byte(nextLine())\n\tvar w2 []int\n\tfor i := 0; i < len(w); i++ {\n\t\tw2 = append(w2, int(w[i]))\n\t}\n\tif len(w)%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tsort.Sort(sort.IntSlice(w2))\n\t\tfor i := 0; i < len(w)/2; i++ {\n\t\t\tif w2[2*i] != w2[2*i+1] {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(\"Yes\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1522602897, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04012.html", "problem_id": "p04012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04012/input.txt", "sample_output_relpath": "derived/input_output/data/p04012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04012/Go/s180983275.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s180983275", "user_id": "u556160473"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tw := []byte(nextLine())\n\tvar w2 []int\n\tfor i := 0; i < len(w); i++ {\n\t\tw2 = append(w2, int(w[i]))\n\t}\n\tif len(w)%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tsort.Sort(sort.IntSlice(w2))\n\t\tfor i := 0; i < len(w)/2; i++ {\n\t\t\tif w2[2*i] != w2[2*i+1] {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(\"Yes\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "sample_input": "abaccaba\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p04012", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet w be a string consisting of lowercase letters.\nWe will call w beautiful if the following condition is satisfied:\n\nEach lowercase letter of the English alphabet occurs even number of times in w.\n\nYou are given the string w. Determine if w is beautiful.\n\nConstraints\n\n1 \\leq |w| \\leq 100\n\nw consists of lowercase letters (a-z).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nw\n\nOutput\n\nPrint Yes if w is beautiful. Print No otherwise.\n\nSample Input 1\n\nabaccaba\n\nSample Output 1\n\nYes\n\na occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.\n\nSample Input 2\n\nhthth\n\nSample Output 2\n\nNo", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 478, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s792108704", "group_id": "codeNet:p04017", "input_text": "package main\n\nimport (\n \"bufio\"\n \"container/heap\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nconst INF int = 100000000\n\nfunc main() {\n input := Input{bufio.NewReaderSize(os.Stdin,1000000)}\n n := input.NextInt()\n x := append(append([]int{0},input.NextIntArray()...),2100000000)\n l := input.NextInt()\n q := input.NextInt()\n u := make([]int,n+1)\n g := NewGraph(n+1)\n for i:=1;i b { a,b = b,a }\n fmt.Println(c[u[a]][b]-c[u[a]][a])\n }\n}\n\ntype Item struct { pos,cost,idx int }\ntype PriorityQueue []*Item\nfunc(pq PriorityQueue) Len() int { return len(pq) }\nfunc(pq PriorityQueue) Less(i,j int) bool { return pq[i].cost < pq[j].cost }\nfunc(pq PriorityQueue) Swap(i,j int) {\n pq[i],pq[j] = pq[j],pq[i]\n pq[i].idx,pq[j].idx = i,j\n}\nfunc(pq *PriorityQueue) Push(x interface{}) {\n n := len(*pq)\n item := x.(*Item)\n item.idx = n\n *pq = append(*pq,item)\n}\nfunc(pq *PriorityQueue) Pop() interface{} {\n old := *pq\n n := len(old)\n item := old[n-1]\n item.idx = -1\n *pq = old[0:n-1]\n return item\n}\n \ntype Edge struct { to,cost int }\ntype Graph [][]Edge\nfunc NewGraph(n int) Graph { return make([][]Edge,n) }\nfunc(g Graph) AddEdge(from int,e Edge) { g[from] = append(g[from],e) }\nfunc(g Graph) Add(from,to,cost int) { g.AddEdge(from,Edge{to,cost}) }\nfunc(g Graph) Dijkstra(start int) []int {\n n := len(g)\n c := make([]int,n)\n for i:=0;i 0 {\n s := heap.Pop(&pq).(*Item)\n if s.cost > c[s.pos] { continue }\n for _, e := range g[s.pos] {\n if c[e.to] > s.cost+e.cost {\n c[e.to] = s.cost+e.cost\n heap.Push(&pq,&Item{pos:e.to,cost:c[e.to]})\n }\n }\n }\n for i:=n-2;i>-1;i-- {\n if c[i] == INF { c[i] = c[i+1] }\n }\n return c\n}\n\ntype Input struct { reader *bufio.Reader }\nfunc(i *Input) NextLine() string {\n var buffer []byte\n for {\n line,isPrefix,err := i.reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer,line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc(i *Input) NextInt() int {\n n,_ := strconv.Atoi(i.NextLine())\n return n\n}\nfunc(i *Input) NextInts() (int,int) {\n s := strings.Split(i.NextLine(),\" \")\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n return x,y\n}\nfunc(i *Input) NextIntArray() []int {\n s := strings.Split(i.NextLine(),\" \")\n a := make([]int,len(s))\n for i:=0;i b { a,b = b,a }\n fmt.Println(c[u[a]][b]-c[u[a]][a])\n }\n}\n\ntype Item struct { pos,cost,idx int }\ntype PriorityQueue []*Item\nfunc(pq PriorityQueue) Len() int { return len(pq) }\nfunc(pq PriorityQueue) Less(i,j int) bool { return pq[i].cost < pq[j].cost }\nfunc(pq PriorityQueue) Swap(i,j int) {\n pq[i],pq[j] = pq[j],pq[i]\n pq[i].idx,pq[j].idx = i,j\n}\nfunc(pq *PriorityQueue) Push(x interface{}) {\n n := len(*pq)\n item := x.(*Item)\n item.idx = n\n *pq = append(*pq,item)\n}\nfunc(pq *PriorityQueue) Pop() interface{} {\n old := *pq\n n := len(old)\n item := old[n-1]\n item.idx = -1\n *pq = old[0:n-1]\n return item\n}\n \ntype Edge struct { to,cost int }\ntype Graph [][]Edge\nfunc NewGraph(n int) Graph { return make([][]Edge,n) }\nfunc(g Graph) AddEdge(from int,e Edge) { g[from] = append(g[from],e) }\nfunc(g Graph) Add(from,to,cost int) { g.AddEdge(from,Edge{to,cost}) }\nfunc(g Graph) Dijkstra(start int) []int {\n n := len(g)\n c := make([]int,n)\n for i:=0;i 0 {\n s := heap.Pop(&pq).(*Item)\n if s.cost > c[s.pos] { continue }\n for _, e := range g[s.pos] {\n if c[e.to] > s.cost+e.cost {\n c[e.to] = s.cost+e.cost\n heap.Push(&pq,&Item{pos:e.to,cost:c[e.to]})\n }\n }\n }\n for i:=n-2;i>-1;i-- {\n if c[i] == INF { c[i] = c[i+1] }\n }\n return c\n}\n\ntype Input struct { reader *bufio.Reader }\nfunc(i *Input) NextLine() string {\n var buffer []byte\n for {\n line,isPrefix,err := i.reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer,line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc(i *Input) NextInt() int {\n n,_ := strconv.Atoi(i.NextLine())\n return n\n}\nfunc(i *Input) NextInts() (int,int) {\n s := strings.Split(i.NextLine(),\" \")\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n return x,y\n}\nfunc(i *Input) NextIntArray() []int {\n s := strings.Split(i.NextLine(),\" \")\n a := make([]int,len(s))\n for i:=0;i a[i] { res = a[i] }\n\t}\n\treturn res\n}\n \nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}", "language": "Go", "metadata": {"date": 1578821441, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04020.html", "problem_id": "p04020", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04020/input.txt", "sample_output_relpath": "derived/input_output/data/p04020/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04020/Go/s996459470.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s996459470", "user_id": "u548992197"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n \nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n \n//=====I/O=====\n \nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n \nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n \nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n \nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n \nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n \n//=====main=====\n \nfunc main() {\n\tsc.Split(bufio.ScanWords)\n \n\tn := scanInt()\n\tas := scanInts(n)\n\tas = append(as,0)\n \n\tans := 0\n \n\tfor i := 0; i < n; i++ {\n\t\tif as[i]!=as[i+1] {\n\t\t\tans+=as[i]/2\n\t\t} else {\n\t\t\tans+=as[i]\n\t\t\tas[i+1]=0\n\t\t}\n\t}\n \n\tfmt.Println(ans)\n \n}\n \nfunc abs(a int) int {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n \nfunc min(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res > a[i] { res = a[i] }\n\t}\n\treturn res\n}\n \nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has a large collection of cards. Each card has an integer between 1 and N, inclusive, written on it.\nHe has A_i cards with an integer i.\n\nTwo cards can form a pair if the absolute value of the difference of the integers written on them is at most 1.\n\nSnuke wants to create the maximum number of pairs from his cards, on the condition that no card should be used in multiple pairs. Find the maximum number of pairs that he can create.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum number of pairs that Snuke can create.\n\nSample Input 1\n\n4\n4\n0\n3\n2\n\nSample Output 1\n\n4\n\nFor example, Snuke can create the following four pairs: (1,1),(1,1),(3,4),(3,4).\n\nSample Input 2\n\n8\n2\n0\n1\n6\n0\n8\n2\n1\n\nSample Output 2\n\n9", "sample_input": "4\n4\n0\n3\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p04020", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has a large collection of cards. Each card has an integer between 1 and N, inclusive, written on it.\nHe has A_i cards with an integer i.\n\nTwo cards can form a pair if the absolute value of the difference of the integers written on them is at most 1.\n\nSnuke wants to create the maximum number of pairs from his cards, on the condition that no card should be used in multiple pairs. Find the maximum number of pairs that he can create.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum number of pairs that Snuke can create.\n\nSample Input 1\n\n4\n4\n0\n3\n2\n\nSample Output 1\n\n4\n\nFor example, Snuke can create the following four pairs: (1,1),(1,1),(3,4),(3,4).\n\nSample Input 2\n\n8\n2\n0\n1\n6\n0\n8\n2\n1\n\nSample Output 2\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1209, "cpu_time_ms": 29, "memory_kb": 4096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s774049720", "group_id": "codeNet:p04020", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tas := scanInts(n)\n\tas = append(as,0)\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tif as[i]%2<=abs(as[i]-as[i+1]) {\n\t\t\tans+=as[i]/2\n\t\t} else {\n\t\t\tans+=min(as[i],as[i+1])\n\t\t\tas[i+1]=0\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n\nfunc abs(a int) int {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res > a[i] { res = a[i] }\n\t}\n\treturn res\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1578820569, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04020.html", "problem_id": "p04020", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04020/input.txt", "sample_output_relpath": "derived/input_output/data/p04020/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04020/Go/s774049720.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s774049720", "user_id": "u548992197"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tas := scanInts(n)\n\tas = append(as,0)\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tif as[i]%2<=abs(as[i]-as[i+1]) {\n\t\t\tans+=as[i]/2\n\t\t} else {\n\t\t\tans+=min(as[i],as[i+1])\n\t\t\tas[i+1]=0\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n\nfunc abs(a int) int {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res > a[i] { res = a[i] }\n\t}\n\treturn res\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has a large collection of cards. Each card has an integer between 1 and N, inclusive, written on it.\nHe has A_i cards with an integer i.\n\nTwo cards can form a pair if the absolute value of the difference of the integers written on them is at most 1.\n\nSnuke wants to create the maximum number of pairs from his cards, on the condition that no card should be used in multiple pairs. Find the maximum number of pairs that he can create.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum number of pairs that Snuke can create.\n\nSample Input 1\n\n4\n4\n0\n3\n2\n\nSample Output 1\n\n4\n\nFor example, Snuke can create the following four pairs: (1,1),(1,1),(3,4),(3,4).\n\nSample Input 2\n\n8\n2\n0\n1\n6\n0\n8\n2\n1\n\nSample Output 2\n\n9", "sample_input": "4\n4\n0\n3\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p04020", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has a large collection of cards. Each card has an integer between 1 and N, inclusive, written on it.\nHe has A_i cards with an integer i.\n\nTwo cards can form a pair if the absolute value of the difference of the integers written on them is at most 1.\n\nSnuke wants to create the maximum number of pairs from his cards, on the condition that no card should be used in multiple pairs. Find the maximum number of pairs that he can create.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum number of pairs that Snuke can create.\n\nSample Input 1\n\n4\n4\n0\n3\n2\n\nSample Output 1\n\n4\n\nFor example, Snuke can create the following four pairs: (1,1),(1,1),(3,4),(3,4).\n\nSample Input 2\n\n8\n2\n0\n1\n6\n0\n8\n2\n1\n\nSample Output 2\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1218, "cpu_time_ms": 29, "memory_kb": 4096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s051712477", "group_id": "codeNet:p04020", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Min(a, b int) int {\n if a < b { return a }\n return b\n}\n\nfunc main() {\n N := NextInt()\n cnt := 0\n A := make([]int, N)\n for i := range A {\n A[i] = NextInt()\n }\n for i, _ := range A {\n if i < N - 1 && 0 < A[i] % 2 {\n cnt += 1\n A[i]--\n A[i + 1]--\n }\n cnt += A[i] / 2\n }\n Write(cnt)\n Output()\n}", "language": "Go", "metadata": {"date": 1572115110, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04020.html", "problem_id": "p04020", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04020/input.txt", "sample_output_relpath": "derived/input_output/data/p04020/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04020/Go/s051712477.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s051712477", "user_id": "u415905784"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n \nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n var line, buffer []byte\n var isPrefix bool = true\n var err error\n for isPrefix {\n line, isPrefix, err = reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n }\n return string(buffer)\n}\nfunc NextInt() int {\n var n int\n n, _ = strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Min(a, b int) int {\n if a < b { return a }\n return b\n}\n\nfunc main() {\n N := NextInt()\n cnt := 0\n A := make([]int, N)\n for i := range A {\n A[i] = NextInt()\n }\n for i, _ := range A {\n if i < N - 1 && 0 < A[i] % 2 {\n cnt += 1\n A[i]--\n A[i + 1]--\n }\n cnt += A[i] / 2\n }\n Write(cnt)\n Output()\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has a large collection of cards. Each card has an integer between 1 and N, inclusive, written on it.\nHe has A_i cards with an integer i.\n\nTwo cards can form a pair if the absolute value of the difference of the integers written on them is at most 1.\n\nSnuke wants to create the maximum number of pairs from his cards, on the condition that no card should be used in multiple pairs. Find the maximum number of pairs that he can create.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum number of pairs that Snuke can create.\n\nSample Input 1\n\n4\n4\n0\n3\n2\n\nSample Output 1\n\n4\n\nFor example, Snuke can create the following four pairs: (1,1),(1,1),(3,4),(3,4).\n\nSample Input 2\n\n8\n2\n0\n1\n6\n0\n8\n2\n1\n\nSample Output 2\n\n9", "sample_input": "4\n4\n0\n3\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p04020", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has a large collection of cards. Each card has an integer between 1 and N, inclusive, written on it.\nHe has A_i cards with an integer i.\n\nTwo cards can form a pair if the absolute value of the difference of the integers written on them is at most 1.\n\nSnuke wants to create the maximum number of pairs from his cards, on the condition that no card should be used in multiple pairs. Find the maximum number of pairs that he can create.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the maximum number of pairs that Snuke can create.\n\nSample Input 1\n\n4\n4\n0\n3\n2\n\nSample Output 1\n\n4\n\nFor example, Snuke can create the following four pairs: (1,1),(1,1),(3,4),(3,4).\n\nSample Input 2\n\n8\n2\n0\n1\n6\n0\n8\n2\n1\n\nSample Output 2\n\n9", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1093, "cpu_time_ms": 30, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s967632517", "group_id": "codeNet:p04021", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"math\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nfunc readQuestion() []int {\n\n bufio := bufio.NewReader(os.Stdin)\n l, _ := bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n cards := make([]int, n)\n for i := 0; i < n; i++ {\n l, _ = bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n cards[i] = n\n }\n return cards\n}\n\nfunc solve(vals []int) int {\n\n sorted := make([]int, len(vals))\n copy(sorted, vals)\n sort.Ints(sorted)\n\n pos := make(map[int]int)\n for i, val := range sorted {\n pos[val] = i\n }\n odds := 0\n for i, val := range vals {\n pos1 := i\n pos2 := pos[val]\n if int(math.Abs(float64(pos1)-float64(pos2)))%2 == 1 {\n odds++\n }\n }\n\n return odds / 2\n}\n\nfunc main() {\n vals := readQuestion()\n ans := solve(vals)\n fmt.Printf(\"%v\\n\", ans)\n}\n", "language": "Go", "metadata": {"date": 1563916547, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04021.html", "problem_id": "p04021", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04021/input.txt", "sample_output_relpath": "derived/input_output/data/p04021/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04021/Go/s967632517.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s967632517", "user_id": "u004477916"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"math\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nfunc readQuestion() []int {\n\n bufio := bufio.NewReader(os.Stdin)\n l, _ := bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n cards := make([]int, n)\n for i := 0; i < n; i++ {\n l, _ = bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n cards[i] = n\n }\n return cards\n}\n\nfunc solve(vals []int) int {\n\n sorted := make([]int, len(vals))\n copy(sorted, vals)\n sort.Ints(sorted)\n\n pos := make(map[int]int)\n for i, val := range sorted {\n pos[val] = i\n }\n odds := 0\n for i, val := range vals {\n pos1 := i\n pos2 := pos[val]\n if int(math.Abs(float64(pos1)-float64(pos2)))%2 == 1 {\n odds++\n }\n }\n\n return odds / 2\n}\n\nfunc main() {\n vals := readQuestion()\n ans := solve(vals)\n fmt.Printf(\"%v\\n\", ans)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke got an integer sequence of length N from his mother, as a birthday present. The i-th (1 ≦ i ≦ N) element of the sequence is a_i. The elements are pairwise distinct.\nHe is sorting this sequence in increasing order.\nWith supernatural power, he can perform the following two operations on the sequence in any order:\n\nOperation 1: choose 2 consecutive elements, then reverse the order of those elements.\n\nOperation 2: choose 3 consecutive elements, then reverse the order of those elements.\n\nSnuke likes Operation 2, but not Operation 1. Find the minimum number of Operation 1 that he has to perform in order to sort the sequence in increasing order.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9\n\nIf i ≠ j, then A_i ≠ A_j.\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of times Operation 1 that Snuke has to perform.\n\nSample Input 1\n\n4\n2\n4\n3\n1\n\nSample Output 1\n\n1\n\nThe given sequence can be sorted as follows:\n\nFirst, reverse the order of the last three elements. The sequence is now: 2,1,3,4.\n\nThen, reverse the order of the first two elements. The sequence is now: 1,2,3,4.\n\nIn this sequence of operations, Operation 1 is performed once. It is not possible to sort the sequence with less number of Operation 1, thus the answer is 1.\n\nSample Input 2\n\n5\n10\n8\n5\n3\n2\n\nSample Output 2\n\n0", "sample_input": "4\n2\n4\n3\n1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p04021", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke got an integer sequence of length N from his mother, as a birthday present. The i-th (1 ≦ i ≦ N) element of the sequence is a_i. The elements are pairwise distinct.\nHe is sorting this sequence in increasing order.\nWith supernatural power, he can perform the following two operations on the sequence in any order:\n\nOperation 1: choose 2 consecutive elements, then reverse the order of those elements.\n\nOperation 2: choose 3 consecutive elements, then reverse the order of those elements.\n\nSnuke likes Operation 2, but not Operation 1. Find the minimum number of Operation 1 that he has to perform in order to sort the sequence in increasing order.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9\n\nIf i ≠ j, then A_i ≠ A_j.\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of times Operation 1 that Snuke has to perform.\n\nSample Input 1\n\n4\n2\n4\n3\n1\n\nSample Output 1\n\n1\n\nThe given sequence can be sorted as follows:\n\nFirst, reverse the order of the last three elements. The sequence is now: 2,1,3,4.\n\nThen, reverse the order of the first two elements. The sequence is now: 1,2,3,4.\n\nIn this sequence of operations, Operation 1 is performed once. It is not possible to sort the sequence with less number of Operation 1, thus the answer is 1.\n\nSample Input 2\n\n5\n10\n8\n5\n3\n2\n\nSample Output 2\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 958, "cpu_time_ms": 89, "memory_kb": 10112}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s772569003", "group_id": "codeNet:p04021", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nfunc readQuestion() ([]int, []int) {\n\n bufio := bufio.NewReader(os.Stdin)\n l, _ := bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n cards1 := make([]int, (n+1)/2)\n cards2 := make([]int, n/2)\n for i := 0; i < n; i++ {\n l, _ = bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n if i%2 == 0 {\n cards1[i/2] = n\n } else {\n cards2[i/2] = n\n }\n }\n return cards1, cards2\n}\n\nfunc bubbleSort(vals []int, start int, step int) int {\n\n count := 0\n v2End := start + (len(vals)-start-1)/step*step\n for start+step <= v2End {\n //fmt.Printf(\"%v, start=%v, end=%v\\n\", vals, start, v2End)\n nextV2End := start\n for i := start; i+step <= v2End; i += step {\n //fmt.Printf(\" v2End=%v check %v %v\\n\", v2End, i, i+step)\n v1 := vals[i]\n v2 := vals[i+step]\n if v1 > v2 {\n //fmt.Printf(\"swap\\n\")\n vals[i], vals[i+step] = v2, v1\n count++\n nextV2End = i\n }\n }\n v2End = nextV2End\n }\n\n // i\n // 1 2 5 4 6 7\n // 4 5\n return count\n}\n\nfunc solve(vals1, vals2 []int) int {\n\n sort.Ints(vals1)\n sort.Ints(vals2)\n\n // append 1 and 2\n vals := []int{}\n for i := 0; i < len(vals2); i++ {\n vals = append(vals, vals1[i])\n vals = append(vals, vals2[i])\n }\n if len(vals1) > len(vals2) {\n vals = append(vals, vals1[len(vals1)-1])\n }\n //fmt.Printf(\"%v\\n\", vals1)\n //fmt.Printf(\"%v\\n\", vals)\n\n ans := bubbleSort(vals, 0, 1)\n //fmt.Printf(\"%v\\n\", vals)\n return ans\n}\n\nfunc main() {\n vals1, vals2 := readQuestion()\n ans := solve(vals1, vals2)\n fmt.Printf(\"%v\\n\", ans)\n}", "language": "Go", "metadata": {"date": 1562710321, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04021.html", "problem_id": "p04021", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04021/input.txt", "sample_output_relpath": "derived/input_output/data/p04021/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04021/Go/s772569003.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s772569003", "user_id": "u004477916"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nfunc readQuestion() ([]int, []int) {\n\n bufio := bufio.NewReader(os.Stdin)\n l, _ := bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n cards1 := make([]int, (n+1)/2)\n cards2 := make([]int, n/2)\n for i := 0; i < n; i++ {\n l, _ = bufio.ReadString('\\n')\n n, _ := strconv.Atoi(strings.Trim(l, \"\\n\"))\n if i%2 == 0 {\n cards1[i/2] = n\n } else {\n cards2[i/2] = n\n }\n }\n return cards1, cards2\n}\n\nfunc bubbleSort(vals []int, start int, step int) int {\n\n count := 0\n v2End := start + (len(vals)-start-1)/step*step\n for start+step <= v2End {\n //fmt.Printf(\"%v, start=%v, end=%v\\n\", vals, start, v2End)\n nextV2End := start\n for i := start; i+step <= v2End; i += step {\n //fmt.Printf(\" v2End=%v check %v %v\\n\", v2End, i, i+step)\n v1 := vals[i]\n v2 := vals[i+step]\n if v1 > v2 {\n //fmt.Printf(\"swap\\n\")\n vals[i], vals[i+step] = v2, v1\n count++\n nextV2End = i\n }\n }\n v2End = nextV2End\n }\n\n // i\n // 1 2 5 4 6 7\n // 4 5\n return count\n}\n\nfunc solve(vals1, vals2 []int) int {\n\n sort.Ints(vals1)\n sort.Ints(vals2)\n\n // append 1 and 2\n vals := []int{}\n for i := 0; i < len(vals2); i++ {\n vals = append(vals, vals1[i])\n vals = append(vals, vals2[i])\n }\n if len(vals1) > len(vals2) {\n vals = append(vals, vals1[len(vals1)-1])\n }\n //fmt.Printf(\"%v\\n\", vals1)\n //fmt.Printf(\"%v\\n\", vals)\n\n ans := bubbleSort(vals, 0, 1)\n //fmt.Printf(\"%v\\n\", vals)\n return ans\n}\n\nfunc main() {\n vals1, vals2 := readQuestion()\n ans := solve(vals1, vals2)\n fmt.Printf(\"%v\\n\", ans)\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke got an integer sequence of length N from his mother, as a birthday present. The i-th (1 ≦ i ≦ N) element of the sequence is a_i. The elements are pairwise distinct.\nHe is sorting this sequence in increasing order.\nWith supernatural power, he can perform the following two operations on the sequence in any order:\n\nOperation 1: choose 2 consecutive elements, then reverse the order of those elements.\n\nOperation 2: choose 3 consecutive elements, then reverse the order of those elements.\n\nSnuke likes Operation 2, but not Operation 1. Find the minimum number of Operation 1 that he has to perform in order to sort the sequence in increasing order.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9\n\nIf i ≠ j, then A_i ≠ A_j.\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of times Operation 1 that Snuke has to perform.\n\nSample Input 1\n\n4\n2\n4\n3\n1\n\nSample Output 1\n\n1\n\nThe given sequence can be sorted as follows:\n\nFirst, reverse the order of the last three elements. The sequence is now: 2,1,3,4.\n\nThen, reverse the order of the first two elements. The sequence is now: 1,2,3,4.\n\nIn this sequence of operations, Operation 1 is performed once. It is not possible to sort the sequence with less number of Operation 1, thus the answer is 1.\n\nSample Input 2\n\n5\n10\n8\n5\n3\n2\n\nSample Output 2\n\n0", "sample_input": "4\n2\n4\n3\n1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p04021", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke got an integer sequence of length N from his mother, as a birthday present. The i-th (1 ≦ i ≦ N) element of the sequence is a_i. The elements are pairwise distinct.\nHe is sorting this sequence in increasing order.\nWith supernatural power, he can perform the following two operations on the sequence in any order:\n\nOperation 1: choose 2 consecutive elements, then reverse the order of those elements.\n\nOperation 2: choose 3 consecutive elements, then reverse the order of those elements.\n\nSnuke likes Operation 2, but not Operation 1. Find the minimum number of Operation 1 that he has to perform in order to sort the sequence in increasing order.\n\nConstraints\n\n1 ≦ N ≦ 10^5\n\n0 ≦ A_i ≦ 10^9\n\nIf i ≠ j, then A_i ≠ A_j.\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint the minimum number of times Operation 1 that Snuke has to perform.\n\nSample Input 1\n\n4\n2\n4\n3\n1\n\nSample Output 1\n\n1\n\nThe given sequence can be sorted as follows:\n\nFirst, reverse the order of the last three elements. The sequence is now: 2,1,3,4.\n\nThen, reverse the order of the first two elements. The sequence is now: 1,2,3,4.\n\nIn this sequence of operations, Operation 1 is performed once. It is not possible to sort the sequence with less number of Operation 1, thus the answer is 1.\n\nSample Input 2\n\n5\n10\n8\n5\n3\n2\n\nSample Output 2\n\n0", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1882, "cpu_time_ms": 121, "memory_kb": 6912}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s229095969", "group_id": "codeNet:p04029", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tresult := 0\n\tfor i := 1; i <= N; i++ {\n\t\tresult += i\n\t}\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1588790958, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04029.html", "problem_id": "p04029", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04029/input.txt", "sample_output_relpath": "derived/input_output/data/p04029/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04029/Go/s229095969.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s229095969", "user_id": "u964273035"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tresult := 0\n\tfor i := 1; i <= N; i++ {\n\t\tresult += i\n\t}\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p04029", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5502, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s210232670", "group_id": "codeNet:p04029", "input_text": "package main\n \nimport \"fmt\"\n \nfunc main(){\n var N int\n var n int = 1\n var sum int = 0\n fmt.Scan(&N)\n for n <= N {\n sum = sum + n\n n = n + 1\n }\n fmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1570213485, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04029.html", "problem_id": "p04029", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04029/input.txt", "sample_output_relpath": "derived/input_output/data/p04029/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04029/Go/s210232670.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s210232670", "user_id": "u565516813"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n \nimport \"fmt\"\n \nfunc main(){\n var N int\n var n int = 1\n var sum int = 0\n fmt.Scan(&N)\n for n <= N {\n sum = sum + n\n n = n + 1\n }\n fmt.Println(sum)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p04029", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?\n\nConstraints\n\n1≦N≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the necessary number of candies in total.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\nThe answer is 1+2+3=6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n55\n\nThe sum of the integers from 1 to 10 is 55.\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1\n\nOnly one child. The answer is 1 in this case.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 176, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s577462342", "group_id": "codeNet:p04030", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tls := strings.Split(s, \"\")\n\n\tresult := []string{}\n\tfor i, x := range ls {\n\t\tif x != \"B\" {\n\t\t\tresult = append(result, x)\n\t\t} else if i != 0 && x == \"B\" {\n\t\t\tresult = result[:i-1]\n\t\t}\n\t}\n\tr := strings.Join(result, \"\")\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1597863840, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p04030.html", "problem_id": "p04030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04030/input.txt", "sample_output_relpath": "derived/input_output/data/p04030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04030/Go/s577462342.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s577462342", "user_id": "u936817967"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tls := strings.Split(s, \"\")\n\n\tresult := []string{}\n\tfor i, x := range ls {\n\t\tif x != \"B\" {\n\t\t\tresult = append(result, x)\n\t\t} else if i != 0 && x == \"B\" {\n\t\t\tresult = result[:i-1]\n\t\t}\n\t}\n\tr := strings.Join(result, \"\")\n\tfmt.Println(r)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "sample_input": "01B0\n"}, "reference_outputs": ["00\n"], "source_document_id": "p04030", "source_text": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 321, "cpu_time_ms": 6, "memory_kb": 1872}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s184095355", "group_id": "codeNet:p04030", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tss := strings.Split(s, \"\")\n\n\tr := []string{}\n\tfor i, s := range ss {\n\t\tif \"B\" == s {\n\t\t\tr[i-1] = \"\"\n\t\t}\n\t\tr = append(r, s)\n\t}\n\n\tstrings.Join(r, \"\")\n\tfmt.Print(r)\n}\n", "language": "Go", "metadata": {"date": 1579643417, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04030.html", "problem_id": "p04030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04030/input.txt", "sample_output_relpath": "derived/input_output/data/p04030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04030/Go/s184095355.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s184095355", "user_id": "u303616227"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tss := strings.Split(s, \"\")\n\n\tr := []string{}\n\tfor i, s := range ss {\n\t\tif \"B\" == s {\n\t\t\tr[i-1] = \"\"\n\t\t}\n\t\tr = append(r, s)\n\t}\n\n\tstrings.Join(r, \"\")\n\tfmt.Print(r)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "sample_input": "01B0\n"}, "reference_outputs": ["00\n"], "source_document_id": "p04030", "source_text": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s156959030", "group_id": "codeNet:p04030", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar s string\n\t\n\t/*入力を受け取る*/\n\tfmt.Scan(&s)\n\n\t/*入力をstring→文字の配列*/\n\tsRune := []rune(s)\n\tsize := len(s)\n\n\t/*空の文字列*/\n\ts2 := make([]string, size+1)\t\n\tj := 0;\n\n\tfor i:=0; i0{\n\t\t\t\tj--\n\t\t\t}\n\n\t\tdefault:\n\n\t\t}\n\t}\n\n\tfor i:= 0; i < j; i++{\n\t\tfmt.Printf(s2[i])\n\t}\n \n\tfmt.Printf(\"\\n\")\n\n}\n", "language": "Go", "metadata": {"date": 1476738287, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04030.html", "problem_id": "p04030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04030/input.txt", "sample_output_relpath": "derived/input_output/data/p04030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04030/Go/s156959030.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s156959030", "user_id": "u914002690"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar s string\n\t\n\t/*入力を受け取る*/\n\tfmt.Scan(&s)\n\n\t/*入力をstring→文字の配列*/\n\tsRune := []rune(s)\n\tsize := len(s)\n\n\t/*空の文字列*/\n\ts2 := make([]string, size+1)\t\n\tj := 0;\n\n\tfor i:=0; i0{\n\t\t\t\tj--\n\t\t\t}\n\n\t\tdefault:\n\n\t\t}\n\t}\n\n\tfor i:= 0; i < j; i++{\n\t\tfmt.Printf(s2[i])\n\t}\n \n\tfmt.Printf(\"\\n\")\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "sample_input": "01B0\n"}, "reference_outputs": ["00\n"], "source_document_id": "p04030", "source_text": "Score : 200 points\n\nProblem Statement\n\nSig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.\n\nTo begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:\n\nThe 0 key: a letter 0 will be inserted to the right of the string.\n\nThe 1 key: a letter 1 will be inserted to the right of the string.\n\nThe backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.\n\nSig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?\n\nConstraints\n\n1 ≦ |s| ≦ 10 (|s| denotes the length of s)\n\ns consists of the letters 0, 1 and B.\n\nThe correct answer is not an empty string.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the string displayed in the editor in the end.\n\nSample Input 1\n\n01B0\n\nSample Output 1\n\n00\n\nEach time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.\n\nSample Input 2\n\n0BB1\n\nSample Output 2\n\n1\n\nEach time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 521, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s007123454", "group_id": "codeNet:p04031", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]float64, n)\n\tsum := 0.0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tsum += a[i]\n\t}\n\n\tans := 0\n\tm := round(sum / float64(n))\n\tfor i := 0; i < n; i++ {\n\t\tans += int(math.Pow(math.Abs(m-a[i]), 2))\n\t}\n\tfmt.Println(ans)\n}\n\nfunc round(f float64) float64 {\n\treturn math.Floor(f + .5)\n}\n", "language": "Go", "metadata": {"date": 1577416425, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04031.html", "problem_id": "p04031", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04031/input.txt", "sample_output_relpath": "derived/input_output/data/p04031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04031/Go/s007123454.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s007123454", "user_id": "u902409225"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]float64, n)\n\tsum := 0.0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tsum += a[i]\n\t}\n\n\tans := 0\n\tm := round(sum / float64(n))\n\tfor i := 0; i < n; i++ {\n\t\tans += int(math.Pow(math.Abs(m-a[i]), 2))\n\t}\n\tfmt.Println(ans)\n}\n\nfunc round(f float64) float64 {\n\treturn math.Floor(f + .5)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "sample_input": "2\n4 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p04031", "source_text": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 375, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s823040900", "group_id": "codeNet:p04031", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tvar min int\n\tfirst := true\n\n\tfor i := -100; i <= 100; i++ {\n\t\tvar tmp int\n\t\tfor j := 0; j < n; j++ {\n\t\t\ttmp += (i - a[j]) * (i - a[j])\n\t\t}\n\t\tif first || tmp < min {\n\t\t\tmin = tmp\n\t\t\tfirst = false\n\t\t}\n\t}\n\n\tfmt.Println(min)\n\n}\n", "language": "Go", "metadata": {"date": 1476200742, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04031.html", "problem_id": "p04031", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04031/input.txt", "sample_output_relpath": "derived/input_output/data/p04031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04031/Go/s823040900.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s823040900", "user_id": "u584537089"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tvar min int\n\tfirst := true\n\n\tfor i := -100; i <= 100; i++ {\n\t\tvar tmp int\n\t\tfor j := 0; j < n; j++ {\n\t\t\ttmp += (i - a[j]) * (i - a[j])\n\t\t}\n\t\tif first || tmp < min {\n\t\t\tmin = tmp\n\t\t\tfirst = false\n\t\t}\n\t}\n\n\tfmt.Println(min)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "sample_input": "2\n4 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p04031", "source_text": "Score : 200 points\n\nProblem Statement\n\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\n\nHe may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).\n\nFind the minimum total cost to achieve his objective.\n\nConstraints\n\n1≦N≦100\n\n-100≦a_i≦100\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the minimum total cost to achieve Evi's objective.\n\nSample Input 1\n\n2\n4 8\n\nSample Output 1\n\n8\n\nTransforming the both into 6s will cost (4-6)^2+(8-6)^2=8 dollars, which is the minimum.\n\nSample Input 2\n\n3\n1 1 3\n\nSample Output 2\n\n3\n\nTransforming the all into 2s will cost (1-2)^2+(1-2)^2+(3-2)^2=3 dollars. Note that Evi has to pay (1-2)^2 dollar separately for transforming each of the two 1s.\n\nSample Input 3\n\n3\n4 2 5\n\nSample Output 3\n\n5\n\nLeaving the 4 as it is and transforming the 2 and the 5 into 4s will achieve the total cost of (2-4)^2+(5-4)^2=5 dollars, which is the minimum.\n\nSample Input 4\n\n4\n-100 -100 -100 -100\n\nSample Output 4\n\n0\n\nWithout transforming anything, Evi's objective is already achieved. Thus, the necessary cost is 0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 369, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s462006383", "group_id": "codeNet:p04032", "input_text": "package main\n\nimport \"fmt\"\n\ntype Pair struct{\n fst int\n snd int\n}\n\nfunc main() {\n var s string\n ans := Pair{-1, -1}\n\n fmt.Scan(&s)\n for i:=0; i b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar a, b int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b = nextInt(), nextInt()\n\n\tif a <= 0 && b >= 0 {\n\t\tfmt.Println(\"Zero\")\n\t} else if a > 0 {\n\t\tfmt.Println(\"Positive\")\n\t\treturn\n\t} else if b < 0 {\n\t\tif (maxInt(0, b)-a)%2 == 0 {\n\t\t\tfmt.Println(\"Positive\")\n\t\t} else {\n\t\t\tfmt.Println(\"Negative\")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591735375, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04033.html", "problem_id": "p04033", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04033/input.txt", "sample_output_relpath": "derived/input_output/data/p04033/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04033/Go/s526395848.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s526395848", "user_id": "u432333240"}, "prompt_components": {"gold_output": "Positive\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar a, b int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b = nextInt(), nextInt()\n\n\tif a <= 0 && b >= 0 {\n\t\tfmt.Println(\"Zero\")\n\t} else if a > 0 {\n\t\tfmt.Println(\"Positive\")\n\t\treturn\n\t} else if b < 0 {\n\t\tif (maxInt(0, b)-a)%2 == 0 {\n\t\t\tfmt.Println(\"Positive\")\n\t\t} else {\n\t\t\tfmt.Println(\"Negative\")\n\t\t}\n\t}\n}\n", "problem_context": "Problem Statement\n\nYou are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.\n\nConstraints\n\na and b are integers.\n\n-10^9≤a≤b≤10^9\n\nPartial Score\n\nIn test cases worth 100 points, -10≤a≤b≤10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nPositive\n\n1×2×3=6 is positive.\n\nSample Input 2\n\n-3 -1\n\nSample Output 2\n\nNegative\n\n(-3)×(-2)×(-1)=-6 is negative.\n\nSample Input 3\n\n-1 1\n\nSample Output 3\n\nZero\n\n(-1)×0×1=0.", "sample_input": "1 3\n"}, "reference_outputs": ["Positive\n"], "source_document_id": "p04033", "source_text": "Problem Statement\n\nYou are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.\n\nConstraints\n\na and b are integers.\n\n-10^9≤a≤b≤10^9\n\nPartial Score\n\nIn test cases worth 100 points, -10≤a≤b≤10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nPositive\n\n1×2×3=6 is positive.\n\nSample Input 2\n\n-3 -1\n\nSample Output 2\n\nNegative\n\n(-3)×(-2)×(-1)=-6 is negative.\n\nSample Input 3\n\n-1 1\n\nSample Output 3\n\nZero\n\n(-1)×0×1=0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2388, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s846459257", "group_id": "codeNet:p04033", "input_text": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sun Mar 25 19:37:08 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar a, b int\n\nfunc main() {\n\tfmt.Scan(&a, &b)\n\tif 0 < a {\n\t\tfmt.Println(\"Positive\")\n\t} else if b < 0 {\n\t\tif (-a+b+1)%2 == 0 {\n\t\t\tfmt.Println(\"Positive\")\n\t\t} else {\n\t\t\tfmt.Println(\"Negative\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Zero\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1522021486, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04033.html", "problem_id": "p04033", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04033/input.txt", "sample_output_relpath": "derived/input_output/data/p04033/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04033/Go/s846459257.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s846459257", "user_id": "u802614675"}, "prompt_components": {"gold_output": "Positive\n", "input_to_evaluate": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sun Mar 25 19:37:08 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar a, b int\n\nfunc main() {\n\tfmt.Scan(&a, &b)\n\tif 0 < a {\n\t\tfmt.Println(\"Positive\")\n\t} else if b < 0 {\n\t\tif (-a+b+1)%2 == 0 {\n\t\t\tfmt.Println(\"Positive\")\n\t\t} else {\n\t\t\tfmt.Println(\"Negative\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Zero\")\n\t}\n}\n", "problem_context": "Problem Statement\n\nYou are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.\n\nConstraints\n\na and b are integers.\n\n-10^9≤a≤b≤10^9\n\nPartial Score\n\nIn test cases worth 100 points, -10≤a≤b≤10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nPositive\n\n1×2×3=6 is positive.\n\nSample Input 2\n\n-3 -1\n\nSample Output 2\n\nNegative\n\n(-3)×(-2)×(-1)=-6 is negative.\n\nSample Input 3\n\n-1 1\n\nSample Output 3\n\nZero\n\n(-1)×0×1=0.", "sample_input": "1 3\n"}, "reference_outputs": ["Positive\n"], "source_document_id": "p04033", "source_text": "Problem Statement\n\nYou are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.\n\nConstraints\n\na and b are integers.\n\n-10^9≤a≤b≤10^9\n\nPartial Score\n\nIn test cases worth 100 points, -10≤a≤b≤10.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\na b\n\nOutput\n\nIf the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\nPositive\n\n1×2×3=6 is positive.\n\nSample Input 2\n\n-3 -1\n\nSample Output 2\n\nNegative\n\n(-3)×(-2)×(-1)=-6 is negative.\n\nSample Input 3\n\n-1 1\n\nSample Output 3\n\nZero\n\n(-1)×0×1=0.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 350, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s793598878", "group_id": "codeNet:p04035", "input_text": "// 隣り合うのをL以上になるようにくっつけていきたいね 一箇所でもみつければあとは隣接してるのをくっつけていきたいね\n// -> てんでダメでした\n// よくよくみたらおかしいところ 端から切り離す感じにするようにした\n// -> なぜかWA\n// 3つ並んでる総和がL未満なら見込み0ってことか\n// -> そういうことではない\n\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, L int\n\tfmt.Scan(&N, &L)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\n\tidx := -1\n\tfor i := 1; i < N; i++ {\n\t\tif A[i-1]+A[i] >= L {\n\t\t\tidx = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif idx == -1 {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\tP := []int{}\n\tfor i := N - 1; i > idx; i-- {\n\t\tP = append(P, i)\n\t}\n\tfor i := 1; i < idx; i++ {\n\t\tP = append(P, i)\n\t}\n\tP = append(P, idx)\n\tfmt.Println(\"Possible\")\n\tfor _, p := range P {\n\t\tfmt.Println(p)\n\t}\n}\n\n// 10 4\n// 2 1 1 4 2 3 1 2 1 2\n\n// 5 3\n// 1 1 3 1 1\n\n// 5 5\n// 1 1 3 2 1\n", "language": "Go", "metadata": {"date": 1592947967, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p04035.html", "problem_id": "p04035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04035/input.txt", "sample_output_relpath": "derived/input_output/data/p04035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04035/Go/s793598878.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s793598878", "user_id": "u445624660"}, "prompt_components": {"gold_output": "Possible\n2\n1\n", "input_to_evaluate": "// 隣り合うのをL以上になるようにくっつけていきたいね 一箇所でもみつければあとは隣接してるのをくっつけていきたいね\n// -> てんでダメでした\n// よくよくみたらおかしいところ 端から切り離す感じにするようにした\n// -> なぜかWA\n// 3つ並んでる総和がL未満なら見込み0ってことか\n// -> そういうことではない\n\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, L int\n\tfmt.Scan(&N, &L)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\n\tidx := -1\n\tfor i := 1; i < N; i++ {\n\t\tif A[i-1]+A[i] >= L {\n\t\t\tidx = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif idx == -1 {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\tP := []int{}\n\tfor i := N - 1; i > idx; i-- {\n\t\tP = append(P, i)\n\t}\n\tfor i := 1; i < idx; i++ {\n\t\tP = append(P, i)\n\t}\n\tP = append(P, idx)\n\tfmt.Println(\"Possible\")\n\tfor _, p := range P {\n\t\tfmt.Println(p)\n\t}\n}\n\n// 10 4\n// 2 1 1 4 2 3 1 2 1 2\n\n// 5 3\n// 1 1 3 1 1\n\n// 5 5\n// 1 1 3 2 1\n", "problem_context": "Problem Statement\n\nWe have N pieces of ropes, numbered 1 through N. The length of piece i is a_i.\n\nAt first, for each i (1≤i≤N-1), piece i and piece i+1 are tied at the ends, forming one long rope with N-1 knots. Snuke will try to untie all of the knots by performing the following operation repeatedly:\n\nChoose a (connected) rope with a total length of at least L, then untie one of its knots.\n\nIs it possible to untie all of the N-1 knots by properly applying this operation? If the answer is positive, find one possible order to untie the knots.\n\nConstraints\n\n2≤N≤10^5\n\n1≤L≤10^9\n\n1≤a_i≤10^9\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN L\na_1 a_2 ... a_n\n\nOutput\n\nIf it is not possible to untie all of the N-1 knots, print Impossible.\n\nIf it is possible to untie all of the knots, print Possible, then print another N-1 lines that describe a possible order to untie the knots. The j-th of those N-1 lines should contain the index of the knot that is untied in the j-th operation. Here, the index of the knot connecting piece i and piece i+1 is i.\n\nIf there is more than one solution, output any.\n\nSample Input 1\n\n3 50\n30 20 10\n\nSample Output 1\n\nPossible\n2\n1\n\nIf the knot 1 is untied first, the knot 2 will become impossible to untie.\n\nSample Input 2\n\n2 21\n10 10\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n5 50\n10 20 30 40 50\n\nSample Output 3\n\nPossible\n1\n2\n3\n4\n\nAnother example of a possible solution is 3, 4, 1, 2.", "sample_input": "3 50\n30 20 10\n"}, "reference_outputs": ["Possible\n2\n1\n"], "source_document_id": "p04035", "source_text": "Problem Statement\n\nWe have N pieces of ropes, numbered 1 through N. The length of piece i is a_i.\n\nAt first, for each i (1≤i≤N-1), piece i and piece i+1 are tied at the ends, forming one long rope with N-1 knots. Snuke will try to untie all of the knots by performing the following operation repeatedly:\n\nChoose a (connected) rope with a total length of at least L, then untie one of its knots.\n\nIs it possible to untie all of the N-1 knots by properly applying this operation? If the answer is positive, find one possible order to untie the knots.\n\nConstraints\n\n2≤N≤10^5\n\n1≤L≤10^9\n\n1≤a_i≤10^9\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN L\na_1 a_2 ... a_n\n\nOutput\n\nIf it is not possible to untie all of the N-1 knots, print Impossible.\n\nIf it is possible to untie all of the knots, print Possible, then print another N-1 lines that describe a possible order to untie the knots. The j-th of those N-1 lines should contain the index of the knot that is untied in the j-th operation. Here, the index of the knot connecting piece i and piece i+1 is i.\n\nIf there is more than one solution, output any.\n\nSample Input 1\n\n3 50\n30 20 10\n\nSample Output 1\n\nPossible\n2\n1\n\nIf the knot 1 is untied first, the knot 2 will become impossible to untie.\n\nSample Input 2\n\n2 21\n10 10\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n5 50\n10 20 30 40 50\n\nSample Output 3\n\nPossible\n1\n2\n3\n4\n\nAnother example of a possible solution is 3, 4, 1, 2.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 990, "cpu_time_ms": 1047, "memory_kb": 8000}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s969565899", "group_id": "codeNet:p04035", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := NewScanner()\n\tN, L := next.Int(), next.Int()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = next.Int()\n\t}\n\n\ttmp := 0\n\tfor i := 1; i < N; i++ {\n\t\tif a[i - 1] + a[i] >= L {\n\t\t\ttmp = i\n\t\t}\n\t}\n\n\tif tmp == 0 {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Possible\")\n\tfor i := 1; i < tmp; i++ {\n\t\tfmt.Println(i)\n\t}\n\n\tfor i := N - 1; i > tmp; i-- {\n\t\tfmt.Println(i)\n\t}\n\n\tfmt.Println(tmp)\n}\n\n// Scanner\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc NewScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\nfunc (s *scanner) Byte() []byte {\n\treturn []byte(s.String())\n}\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Functions\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(e, ret) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(ret, a) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b > 0 {\n\t\treturn gcd(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\nfunc gcdInt64(a, b int64) int64 {\n\tif b > 0 {\n\t\treturn gcdInt64(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcmInt64(a, b int64) int64 {\n\treturn a / gcdInt64(a, b) * b\n}\n\nfunc ModPow(x, n, mod int) int {\n\tret := 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc ModPowInt64(x, n, mod int64) int64 {\n\tvar ret int64 = 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc IntComp(a, b interface{}) bool {\n\tna := a.(int)\n\tnb := b.(int)\n\n\treturn na < nb\n}\n\nfunc Int64Comp(a, b interface{}) bool {\n\tna := a.(int64)\n\tnb := b.(int64)\n\n\treturn na < nb\n}\n\nfunc FloatComp(a, b interface{}) bool {\n\tna := a.(float32)\n\tnb := b.(float32)\n\n\treturn na < nb\n}\n\nfunc Float64Comp(a, b interface{}) bool {\n\tna := a.(float64)\n\tnb := b.(float64)\n\n\treturn na < nb\n}\n\n// Structs\ntype Merger func(a, b interface{}) interface{}\ntype Comparator func(a, b interface{}) bool\n\n// Pair\ntype Pair struct {\n\tfirst, second int64\n}\n\nfunc Newpair() *Pair {\n\treturn &Pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p Pair) Less(q Pair) bool {\n\tif p.first < q.first {\n\t\treturn true\n\t} else if p.first == q.first {\n\t\treturn p.second < q.second\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc (p Pair) String() string {\n\treturn fmt.Sprint(\"(\", p.first, \", \", p.second, \")\")\n}\n\nfunc PairComp(p, q interface{}) bool {\n\tnp := p.(Pair)\n\tnq := q.(Pair)\n\n\treturn np.Less(nq)\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].Less(p[j])\n}\n\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\n// Priority Queue\n// push : Push the value to the priority queue.\n// top : Return the (Min / Max) value in the priority queue.\n// pop : Delete the (Min / Max) value in the priority queue.\n// size : Return the number of values in the priority queue.\n// empty : Return Is priority queue has the values.\ntype PriorityQueue struct {\n\tdata\t[]interface{}\n\tcomp\tComparator\n}\n\nfunc NewPriorityQueue(comp Comparator) *PriorityQueue {\n\treturn &PriorityQueue{make([]interface{}, 0), comp}\n}\n\nfunc (qu *PriorityQueue) push(x interface{}) {\n\tn := len(qu.data)\n\tqu.data = append(qu.data, x)\n\n\tfor n != 0 {\n\t\tpar := (n - 1) / 2\n\t\t\n\t\tif qu.comp(qu.data[par], qu.data[n]) {\n\t\t\tqu.data[par], qu.data[n] = qu.data[n], qu.data[par]\n\t\t}\n\n\t\tn = par\n\t}\n}\n\nfunc (qu *PriorityQueue) pop() {\n\tn := len(qu.data) - 1\n\tqu.data[0] = qu.data[n]\n\tqu.data = qu.data[:n]\n\n\tfor i, j := 0, 1; j < n; {\n\t\tj = 2 * i + 1\n\n\t\tif (j != n - 1) && qu.comp(qu.data[j], qu.data[j + 1]) {\n\t\t\tj++\n\t\t}\n\n\t\tif qu.comp(qu.data[i], qu.data[j]) {\n\t\t\tqu.data[i], qu.data[j] = qu.data[j], qu.data[i]\n\t\t}\n\n\t\ti = j\n\t}\n}\n\nfunc (qu *PriorityQueue) top() interface{} {\n\treturn qu.data[0]\n}\n\nfunc (qu *PriorityQueue) size() int {\n\treturn len(qu.data)\n}\n\nfunc (qu *PriorityQueue) empty() bool {\n\treturn len(qu.data) == 0\n}\n\n// Segment Tree\n// update : Update k-th value of SegmentTree.data to x\n// get\t : Get the merged value in range [a, b)\ntype SegmentTree struct {\n\tdata\t[]interface{}\n\tid\t\tinterface{}\n\tsize\tint\n\tmerge\tMerger\n}\n\nfunc NewSegmentTree(n int, id interface{}, merge Merger) *SegmentTree {\n\tsz := 1\n\tfor sz < n {\n\t\tsz *= 2\n\t}\n\n\tdata := make([]interface{}, sz * 2 - 1)\n\tfor i := 0; i < sz * 2 - 1; i++ {\n\t\tdata[i] = id\n\t}\n\n\treturn &SegmentTree{data, id, sz, merge}\n}\n\nfunc (seg *SegmentTree) update(k int, x interface{}) {\n\tk += seg.size - 1;\n\tseg.data[k] = x\n\n\tfor k > 0 {\n\t\tk = (k - 1) / 2\n\n\t\tseg.data[k] = seg.merge(seg.data[2 * k + 1], seg.data[2 * k + 2])\n\t}\n}\n\nfunc (seg *SegmentTree) get(a, b int) interface{} {\n\treturn seg._get(a, b, 0, 0, seg.size)\n}\n\nfunc (seg *SegmentTree) _get(a, b, k, l, r int) interface{} {\n\tif b <= l || r <= a {\n\t\treturn seg.id\n\t}\n\n\tif a <= l && r <= b {\n\t\treturn seg.data[k]\n\t}\n\n\tL := seg._get(a, b, 2 * k + 1, l, (l + r) / 2)\n\tR := seg._get(a, b, 2 * k + 2, (l + r) / 2, r)\n\treturn seg.merge(L, R)\n}\n\nfunc (seg *SegmentTree) String() string {\n\treturn fmt.Sprint(seg.data[seg.size - 1:])\n}\n\n// Trie Node\n// Node for Trie Tree\nconst (\n\tchar_size = 26\n\tmargin = 'a'\n)\n\ntype TrieNode struct {\n\tnxt \t[char_size]int\n\taccept\t[]int\n\texist\tint\n}\n\nfunc NewTrieNode() *TrieNode {\n\tvar nxt [char_size]int\n\tfor i := 0; i < char_size; i++ {\n\t\tnxt[i] = -1\n\t}\n\n\treturn &TrieNode{nxt, make([]int, 0), 0}\n}\n\n// Trie Tree\ntype TrieTree struct {\n\tnodes\t[]TrieNode\n\troot\tint\n}\n\nfunc NewTrieTree() *TrieTree {\n\treturn &TrieTree{[]TrieNode{*NewTrieNode()}, 0}\n}\n\nfunc direct_action(node, id int) {\n\t//virtual function\n}\n\nfunc child_action(node, child, id int) {\n\t//virtual function\n}\n\nfunc (tree *TrieTree) update_direct(node, id int) {\n\ttree.nodes[node].accept = append(tree.nodes[node].accept, id)\n\tdirect_action(node, id)\n}\n\nfunc (tree *TrieTree) update_child(node, child, id int) {\n\ttree.nodes[node].exist += 1\n\tchild_action(node, child, id)\n}\n\nfunc (tree *TrieTree) add(str []byte, str_index, node_index, id int) {\n\tif str_index == len(str) {\n\t\ttree.update_direct(node_index, id)\n\t} else {\n\t\tc := int(str[str_index]) - int(margin)\n\n\t\tif tree.nodes[node_index].nxt[c] == -1 {\n\t\t\ttree.nodes[node_index].nxt[c] = len(tree.nodes)\n\t\t\ttree.nodes = append(tree.nodes, *NewTrieNode())\n\t\t}\n\n\t\ttree.add(str, str_index + 1, tree.nodes[node_index].nxt[c], id)\n\t\ttree.update_child(node_index, tree.nodes[node_index].nxt[c], id)\n\t}\n}\n\nfunc (tree *TrieTree) InsertWithId(str []byte, id int) {\n\ttree.add(str, 0, 0, id)\n}\n\nfunc (tree *TrieTree) Insert(str []byte) {\n\ttree.InsertWithId(str, tree.nodes[0].exist)\n}\n\nfunc (tree *TrieTree) size() int {\n\treturn tree.nodes[0].exist\n}\n\nfunc (tree *TrieTree) nodesize() int {\n\treturn len(tree.nodes)\n}", "language": "Go", "metadata": {"date": 1533266398, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04035.html", "problem_id": "p04035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04035/input.txt", "sample_output_relpath": "derived/input_output/data/p04035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04035/Go/s969565899.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s969565899", "user_id": "u424655672"}, "prompt_components": {"gold_output": "Possible\n2\n1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INF int = 1e9\nconst LINF int64 = 1e9\nconst MOD int = INF + 7\n\nfunc main() {\n\tnext := NewScanner()\n\tN, L := next.Int(), next.Int()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = next.Int()\n\t}\n\n\ttmp := 0\n\tfor i := 1; i < N; i++ {\n\t\tif a[i - 1] + a[i] >= L {\n\t\t\ttmp = i\n\t\t}\n\t}\n\n\tif tmp == 0 {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Possible\")\n\tfor i := 1; i < tmp; i++ {\n\t\tfmt.Println(i)\n\t}\n\n\tfor i := N - 1; i > tmp; i-- {\n\t\tfmt.Println(i)\n\t}\n\n\tfmt.Println(tmp)\n}\n\n// Scanner\ntype scanner struct {\n\tr\t*bufio.Reader\n\tbuf []byte\n\tp\tint\n}\n\nfunc NewScanner() *scanner {\n\treturn &scanner{r: bufio.NewReaderSize(os.Stdin, 10000)}\n}\n\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\n\treturn string(s.buf[start:])\n}\n\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\n\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\n\nfunc (s *scanner) Float() float32 {\n\tf, _ := strconv.ParseFloat(s.next(), 32)\n\n\treturn float32(f)\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.next(), 64)\n\n\treturn f\n}\n\nfunc (s *scanner) Bool() bool {\n\tb, _ := strconv.ParseBool(s.next())\n\n\treturn b\n}\n\nfunc (s *scanner) String() string {\n\treturn s.next()\n}\n\nfunc (s *scanner) Byte() []byte {\n\treturn []byte(s.String())\n}\n\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Functions\nfunc Itob(i int) bool {\n\tif i == 0 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc Btoi(f bool) int {\n\tif f {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n\nfunc min(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max(a ...int) int {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxInt64(a ...int64) int64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat(a ...float32) float32 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e < ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxFloat64(a ...float64) float64 {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif e > ret {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc minOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(e, ret) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc maxOther(comp Comparator, a ...interface{}) interface{} {\n\tret := a[0]\n\tfor _, e := range a {\n\t\tif comp(ret, a) {\n\t\t\tret = e\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat(a float32) float32 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b > 0 {\n\t\treturn gcd(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\nfunc gcdInt64(a, b int64) int64 {\n\tif b > 0 {\n\t\treturn gcdInt64(b, a % b)\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc lcmInt64(a, b int64) int64 {\n\treturn a / gcdInt64(a, b) * b\n}\n\nfunc ModPow(x, n, mod int) int {\n\tret := 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc ModPowInt64(x, n, mod int64) int64 {\n\tvar ret int64 = 1\n\n\tfor ; n > 0; n /= 2 {\n\t\tif (n & 1) == 1 {\n\t\t\tret = ret * x % mod\n\t\t}\n\n\t\tx = x * x % mod\n\t}\n\n\treturn ret\n}\n\nfunc IntComp(a, b interface{}) bool {\n\tna := a.(int)\n\tnb := b.(int)\n\n\treturn na < nb\n}\n\nfunc Int64Comp(a, b interface{}) bool {\n\tna := a.(int64)\n\tnb := b.(int64)\n\n\treturn na < nb\n}\n\nfunc FloatComp(a, b interface{}) bool {\n\tna := a.(float32)\n\tnb := b.(float32)\n\n\treturn na < nb\n}\n\nfunc Float64Comp(a, b interface{}) bool {\n\tna := a.(float64)\n\tnb := b.(float64)\n\n\treturn na < nb\n}\n\n// Structs\ntype Merger func(a, b interface{}) interface{}\ntype Comparator func(a, b interface{}) bool\n\n// Pair\ntype Pair struct {\n\tfirst, second int64\n}\n\nfunc Newpair() *Pair {\n\treturn &Pair {\n\t\tfirst : 0,\n\t\tsecond : 0,\n\t}\n}\n\nfunc (p Pair) Less(q Pair) bool {\n\tif p.first < q.first {\n\t\treturn true\n\t} else if p.first == q.first {\n\t\treturn p.second < q.second\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc (p Pair) String() string {\n\treturn fmt.Sprint(\"(\", p.first, \", \", p.second, \")\")\n}\n\nfunc PairComp(p, q interface{}) bool {\n\tnp := p.(Pair)\n\tnq := q.(Pair)\n\n\treturn np.Less(nq)\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].Less(p[j])\n}\n\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\n// Priority Queue\n// push : Push the value to the priority queue.\n// top : Return the (Min / Max) value in the priority queue.\n// pop : Delete the (Min / Max) value in the priority queue.\n// size : Return the number of values in the priority queue.\n// empty : Return Is priority queue has the values.\ntype PriorityQueue struct {\n\tdata\t[]interface{}\n\tcomp\tComparator\n}\n\nfunc NewPriorityQueue(comp Comparator) *PriorityQueue {\n\treturn &PriorityQueue{make([]interface{}, 0), comp}\n}\n\nfunc (qu *PriorityQueue) push(x interface{}) {\n\tn := len(qu.data)\n\tqu.data = append(qu.data, x)\n\n\tfor n != 0 {\n\t\tpar := (n - 1) / 2\n\t\t\n\t\tif qu.comp(qu.data[par], qu.data[n]) {\n\t\t\tqu.data[par], qu.data[n] = qu.data[n], qu.data[par]\n\t\t}\n\n\t\tn = par\n\t}\n}\n\nfunc (qu *PriorityQueue) pop() {\n\tn := len(qu.data) - 1\n\tqu.data[0] = qu.data[n]\n\tqu.data = qu.data[:n]\n\n\tfor i, j := 0, 1; j < n; {\n\t\tj = 2 * i + 1\n\n\t\tif (j != n - 1) && qu.comp(qu.data[j], qu.data[j + 1]) {\n\t\t\tj++\n\t\t}\n\n\t\tif qu.comp(qu.data[i], qu.data[j]) {\n\t\t\tqu.data[i], qu.data[j] = qu.data[j], qu.data[i]\n\t\t}\n\n\t\ti = j\n\t}\n}\n\nfunc (qu *PriorityQueue) top() interface{} {\n\treturn qu.data[0]\n}\n\nfunc (qu *PriorityQueue) size() int {\n\treturn len(qu.data)\n}\n\nfunc (qu *PriorityQueue) empty() bool {\n\treturn len(qu.data) == 0\n}\n\n// Segment Tree\n// update : Update k-th value of SegmentTree.data to x\n// get\t : Get the merged value in range [a, b)\ntype SegmentTree struct {\n\tdata\t[]interface{}\n\tid\t\tinterface{}\n\tsize\tint\n\tmerge\tMerger\n}\n\nfunc NewSegmentTree(n int, id interface{}, merge Merger) *SegmentTree {\n\tsz := 1\n\tfor sz < n {\n\t\tsz *= 2\n\t}\n\n\tdata := make([]interface{}, sz * 2 - 1)\n\tfor i := 0; i < sz * 2 - 1; i++ {\n\t\tdata[i] = id\n\t}\n\n\treturn &SegmentTree{data, id, sz, merge}\n}\n\nfunc (seg *SegmentTree) update(k int, x interface{}) {\n\tk += seg.size - 1;\n\tseg.data[k] = x\n\n\tfor k > 0 {\n\t\tk = (k - 1) / 2\n\n\t\tseg.data[k] = seg.merge(seg.data[2 * k + 1], seg.data[2 * k + 2])\n\t}\n}\n\nfunc (seg *SegmentTree) get(a, b int) interface{} {\n\treturn seg._get(a, b, 0, 0, seg.size)\n}\n\nfunc (seg *SegmentTree) _get(a, b, k, l, r int) interface{} {\n\tif b <= l || r <= a {\n\t\treturn seg.id\n\t}\n\n\tif a <= l && r <= b {\n\t\treturn seg.data[k]\n\t}\n\n\tL := seg._get(a, b, 2 * k + 1, l, (l + r) / 2)\n\tR := seg._get(a, b, 2 * k + 2, (l + r) / 2, r)\n\treturn seg.merge(L, R)\n}\n\nfunc (seg *SegmentTree) String() string {\n\treturn fmt.Sprint(seg.data[seg.size - 1:])\n}\n\n// Trie Node\n// Node for Trie Tree\nconst (\n\tchar_size = 26\n\tmargin = 'a'\n)\n\ntype TrieNode struct {\n\tnxt \t[char_size]int\n\taccept\t[]int\n\texist\tint\n}\n\nfunc NewTrieNode() *TrieNode {\n\tvar nxt [char_size]int\n\tfor i := 0; i < char_size; i++ {\n\t\tnxt[i] = -1\n\t}\n\n\treturn &TrieNode{nxt, make([]int, 0), 0}\n}\n\n// Trie Tree\ntype TrieTree struct {\n\tnodes\t[]TrieNode\n\troot\tint\n}\n\nfunc NewTrieTree() *TrieTree {\n\treturn &TrieTree{[]TrieNode{*NewTrieNode()}, 0}\n}\n\nfunc direct_action(node, id int) {\n\t//virtual function\n}\n\nfunc child_action(node, child, id int) {\n\t//virtual function\n}\n\nfunc (tree *TrieTree) update_direct(node, id int) {\n\ttree.nodes[node].accept = append(tree.nodes[node].accept, id)\n\tdirect_action(node, id)\n}\n\nfunc (tree *TrieTree) update_child(node, child, id int) {\n\ttree.nodes[node].exist += 1\n\tchild_action(node, child, id)\n}\n\nfunc (tree *TrieTree) add(str []byte, str_index, node_index, id int) {\n\tif str_index == len(str) {\n\t\ttree.update_direct(node_index, id)\n\t} else {\n\t\tc := int(str[str_index]) - int(margin)\n\n\t\tif tree.nodes[node_index].nxt[c] == -1 {\n\t\t\ttree.nodes[node_index].nxt[c] = len(tree.nodes)\n\t\t\ttree.nodes = append(tree.nodes, *NewTrieNode())\n\t\t}\n\n\t\ttree.add(str, str_index + 1, tree.nodes[node_index].nxt[c], id)\n\t\ttree.update_child(node_index, tree.nodes[node_index].nxt[c], id)\n\t}\n}\n\nfunc (tree *TrieTree) InsertWithId(str []byte, id int) {\n\ttree.add(str, 0, 0, id)\n}\n\nfunc (tree *TrieTree) Insert(str []byte) {\n\ttree.InsertWithId(str, tree.nodes[0].exist)\n}\n\nfunc (tree *TrieTree) size() int {\n\treturn tree.nodes[0].exist\n}\n\nfunc (tree *TrieTree) nodesize() int {\n\treturn len(tree.nodes)\n}", "problem_context": "Problem Statement\n\nWe have N pieces of ropes, numbered 1 through N. The length of piece i is a_i.\n\nAt first, for each i (1≤i≤N-1), piece i and piece i+1 are tied at the ends, forming one long rope with N-1 knots. Snuke will try to untie all of the knots by performing the following operation repeatedly:\n\nChoose a (connected) rope with a total length of at least L, then untie one of its knots.\n\nIs it possible to untie all of the N-1 knots by properly applying this operation? If the answer is positive, find one possible order to untie the knots.\n\nConstraints\n\n2≤N≤10^5\n\n1≤L≤10^9\n\n1≤a_i≤10^9\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN L\na_1 a_2 ... a_n\n\nOutput\n\nIf it is not possible to untie all of the N-1 knots, print Impossible.\n\nIf it is possible to untie all of the knots, print Possible, then print another N-1 lines that describe a possible order to untie the knots. The j-th of those N-1 lines should contain the index of the knot that is untied in the j-th operation. Here, the index of the knot connecting piece i and piece i+1 is i.\n\nIf there is more than one solution, output any.\n\nSample Input 1\n\n3 50\n30 20 10\n\nSample Output 1\n\nPossible\n2\n1\n\nIf the knot 1 is untied first, the knot 2 will become impossible to untie.\n\nSample Input 2\n\n2 21\n10 10\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n5 50\n10 20 30 40 50\n\nSample Output 3\n\nPossible\n1\n2\n3\n4\n\nAnother example of a possible solution is 3, 4, 1, 2.", "sample_input": "3 50\n30 20 10\n"}, "reference_outputs": ["Possible\n2\n1\n"], "source_document_id": "p04035", "source_text": "Problem Statement\n\nWe have N pieces of ropes, numbered 1 through N. The length of piece i is a_i.\n\nAt first, for each i (1≤i≤N-1), piece i and piece i+1 are tied at the ends, forming one long rope with N-1 knots. Snuke will try to untie all of the knots by performing the following operation repeatedly:\n\nChoose a (connected) rope with a total length of at least L, then untie one of its knots.\n\nIs it possible to untie all of the N-1 knots by properly applying this operation? If the answer is positive, find one possible order to untie the knots.\n\nConstraints\n\n2≤N≤10^5\n\n1≤L≤10^9\n\n1≤a_i≤10^9\n\nAll input values are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN L\na_1 a_2 ... a_n\n\nOutput\n\nIf it is not possible to untie all of the N-1 knots, print Impossible.\n\nIf it is possible to untie all of the knots, print Possible, then print another N-1 lines that describe a possible order to untie the knots. The j-th of those N-1 lines should contain the index of the knot that is untied in the j-th operation. Here, the index of the knot connecting piece i and piece i+1 is i.\n\nIf there is more than one solution, output any.\n\nSample Input 1\n\n3 50\n30 20 10\n\nSample Output 1\n\nPossible\n2\n1\n\nIf the knot 1 is untied first, the knot 2 will become impossible to untie.\n\nSample Input 2\n\n2 21\n10 10\n\nSample Output 2\n\nImpossible\n\nSample Input 3\n\n5 50\n10 20 30 40 50\n\nSample Output 3\n\nPossible\n1\n2\n3\n4\n\nAnother example of a possible solution is 3, 4, 1, 2.", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9372, "cpu_time_ms": 211, "memory_kb": 7168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s854527015", "group_id": "codeNet:p04043", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c int\n\n fmt.Scanf(\"%d %d %d\", &a, &b, &c)\n fmt.Println(a, b, c)\n\t\n if a == 7 {\n\t\tif b == 5 && c == 5 {\n fmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else if a == 5 {\n\t\tif b == 7 && c == 5 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else if b == 5 && c == 7 {\n\t\t\tfmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n } else {\n fmt.Println(\"NO\")\n\t}\n \n}", "language": "Go", "metadata": {"date": 1579730036, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04043.html", "problem_id": "p04043", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04043/input.txt", "sample_output_relpath": "derived/input_output/data/p04043/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04043/Go/s854527015.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s854527015", "user_id": "u624837194"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c int\n\n fmt.Scanf(\"%d %d %d\", &a, &b, &c)\n fmt.Println(a, b, c)\n\t\n if a == 7 {\n\t\tif b == 5 && c == 5 {\n fmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else if a == 5 {\n\t\tif b == 7 && c == 5 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else if b == 5 && c == 7 {\n\t\t\tfmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n } else {\n fmt.Println(\"NO\")\n\t}\n \n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.\n\nTo create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.\n\nConstraints\n\n1≦A,B,C≦10\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf it is possible to construct a Haiku by using each of the phrases once, print YES (case-sensitive). Otherwise, print NO.\n\nSample Input 1\n\n5 5 7\n\nSample Output 1\n\nYES\n\nUsing three phrases of length 5, 5 and 7, it is possible to construct a Haiku.\n\nSample Input 2\n\n7 7 5\n\nSample Output 2\n\nNO", "sample_input": "5 5 7\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p04043", "source_text": "Score : 100 points\n\nProblem Statement\n\nIroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.\n\nTo create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.\n\nConstraints\n\n1≦A,B,C≦10\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf it is possible to construct a Haiku by using each of the phrases once, print YES (case-sensitive). Otherwise, print NO.\n\nSample Input 1\n\n5 5 7\n\nSample Output 1\n\nYES\n\nUsing three phrases of length 5, 5 and 7, it is possible to construct a Haiku.\n\nSample Input 2\n\n7 7 5\n\nSample Output 2\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 423, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s984409255", "group_id": "codeNet:p04043", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c string\n fmt.Scan(&a, &b, &c)\n\n five := make([]string, 0, 3)\n seven := make([]string, 0, 3)\n\n for _, s := range []string{a,b,c} {\n if len(s) == 5 {\n five = append(five, s)\n }\n if len(s) == 7 {\n seven = append(seven, s)\n }\n }\n\n if len(five) == 2 && len(seven) == 1 {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}\n", "language": "Go", "metadata": {"date": 1544493441, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04043.html", "problem_id": "p04043", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04043/input.txt", "sample_output_relpath": "derived/input_output/data/p04043/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04043/Go/s984409255.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s984409255", "user_id": "u283418338"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c string\n fmt.Scan(&a, &b, &c)\n\n five := make([]string, 0, 3)\n seven := make([]string, 0, 3)\n\n for _, s := range []string{a,b,c} {\n if len(s) == 5 {\n five = append(five, s)\n }\n if len(s) == 7 {\n seven = append(seven, s)\n }\n }\n\n if len(five) == 2 && len(seven) == 1 {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.\n\nTo create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.\n\nConstraints\n\n1≦A,B,C≦10\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf it is possible to construct a Haiku by using each of the phrases once, print YES (case-sensitive). Otherwise, print NO.\n\nSample Input 1\n\n5 5 7\n\nSample Output 1\n\nYES\n\nUsing three phrases of length 5, 5 and 7, it is possible to construct a Haiku.\n\nSample Input 2\n\n7 7 5\n\nSample Output 2\n\nNO", "sample_input": "5 5 7\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p04043", "source_text": "Score : 100 points\n\nProblem Statement\n\nIroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.\n\nTo create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.\n\nConstraints\n\n1≦A,B,C≦10\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf it is possible to construct a Haiku by using each of the phrases once, print YES (case-sensitive). Otherwise, print NO.\n\nSample Input 1\n\n5 5 7\n\nSample Output 1\n\nYES\n\nUsing three phrases of length 5, 5 and 7, it is possible to construct a Haiku.\n\nSample Input 2\n\n7 7 5\n\nSample Output 2\n\nNO", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 413, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s124333961", "group_id": "codeNet:p04045", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := getInt()\n\tK := getInt()\n\tD := make([]int, K)\n\tfor i := 0; i < K; i++ {\n\t\tD[i] = getInt()\n\t}\n\n\tout(N, K, D)\n\n\tans := N\n\tfor ans < N*10 {\n\t\tflag := false\n\tL1:\n\t\tfor j := ans; j != 0; j /= 10 {\n\t\t\tv := j % 10\n\t\t\tfor k := 0; k < K; k++ {\n\t\t\t\tif v == D[k] {\n\t\t\t\t\tflag = true\n\t\t\t\t\tbreak L1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif flag == false {\n\t\t\tbreak\n\t\t}\n\t\tans++\n\t}\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1579748482, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04045.html", "problem_id": "p04045", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04045/input.txt", "sample_output_relpath": "derived/input_output/data/p04045/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04045/Go/s124333961.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s124333961", "user_id": "u814575783"}, "prompt_components": {"gold_output": "2000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := getInt()\n\tK := getInt()\n\tD := make([]int, K)\n\tfor i := 0; i < K; i++ {\n\t\tD[i] = getInt()\n\t}\n\n\tout(N, K, D)\n\n\tans := N\n\tfor ans < N*10 {\n\t\tflag := false\n\tL1:\n\t\tfor j := ans; j != 0; j /= 10 {\n\t\t\tv := j % 10\n\t\t\tfor k := 0; k < K; k++ {\n\t\t\t\tif v == D[k] {\n\t\t\t\t\tflag = true\n\t\t\t\t\tbreak L1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif flag == false {\n\t\t\tbreak\n\t\t}\n\t\tans++\n\t}\n\tout(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "sample_input": "1000 8\n1 3 4 5 6 7 8 9\n"}, "reference_outputs": ["2000\n"], "source_document_id": "p04045", "source_text": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 715, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s474272353", "group_id": "codeNet:p04045", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tm := map[string]bool{}\n\tfor i := 0; i <= 9; i++ {\n\t\tm[strconv.Itoa(i)] = false\n\t}\n\n\tN, K := nextInt(), nextInt()\n\tfor i := 0; i < K; i++ {\n\t\tm[strconv.Itoa(nextInt())] = true\n\t}\n\n\tfor i := N; i < 10000; i++ {\n\t\ts := strconv.Itoa(i)\n\t\tflag := true\n\t\tfor _, ss := range s {\n\t\t\tif m[string(ss)] {\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\n\t\tif flag {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc LowerBound(t []int, k int) int {\n\tlb := -1\n\tub := len(t)\n\tfor ub-lb > 1 {\n\t\tmid := (lb + ub) / 2\n\n\t\tif t[mid] >= k {\n\t\t\tub = mid\n\t\t} else {\n\t\t\tlb = mid\n\t\t}\n\t}\n\treturn ub\n}\n", "language": "Go", "metadata": {"date": 1564769651, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04045.html", "problem_id": "p04045", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04045/input.txt", "sample_output_relpath": "derived/input_output/data/p04045/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04045/Go/s474272353.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s474272353", "user_id": "u710190793"}, "prompt_components": {"gold_output": "2000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tm := map[string]bool{}\n\tfor i := 0; i <= 9; i++ {\n\t\tm[strconv.Itoa(i)] = false\n\t}\n\n\tN, K := nextInt(), nextInt()\n\tfor i := 0; i < K; i++ {\n\t\tm[strconv.Itoa(nextInt())] = true\n\t}\n\n\tfor i := N; i < 10000; i++ {\n\t\ts := strconv.Itoa(i)\n\t\tflag := true\n\t\tfor _, ss := range s {\n\t\t\tif m[string(ss)] {\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\n\t\tif flag {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc LowerBound(t []int, k int) int {\n\tlb := -1\n\tub := len(t)\n\tfor ub-lb > 1 {\n\t\tmid := (lb + ub) / 2\n\n\t\tif t[mid] >= k {\n\t\t\tub = mid\n\t\t} else {\n\t\t\tlb = mid\n\t\t}\n\t}\n\treturn ub\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "sample_input": "1000 8\n1 3 4 5 6 7 8 9\n"}, "reference_outputs": ["2000\n"], "source_document_id": "p04045", "source_text": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 795, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s095786200", "group_id": "codeNet:p04045", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// CeilInt returns the minimum integer larger than or equal to float(a/b).\nfunc CeilInt(a, b int) int {\n\tres := a / b\n\tif a%b > 0 {\n\t\tres++\n\t}\n\treturn res\n}\n\n// FloorInt returns the maximum integer smaller than or equal to float(a/b)\nfunc FloorInt(a, b int) int {\n\tres := a / b\n\treturn res\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Permutation ***********/\n\n// memo: 10! == 3628800 > 3M\nfunc CalcFactorialPatterns(elements []rune) [][]rune {\n\tcopiedResidual := make([]rune, len(elements))\n\tcopy(copiedResidual, elements)\n\treturn factorialRecursion([]rune{}, copiedResidual)\n}\nfunc factorialRecursion(interim, residual []rune) [][]rune {\n\tif len(residual) == 0 {\n\t\treturn [][]rune{interim}\n\t}\n\n\tres := [][]rune{}\n\tfor idx, elem := range residual {\n\t\tcopiedInterim := make([]rune, len(interim))\n\t\tcopy(copiedInterim, interim)\n\t\tcopiedInterim = append(copiedInterim, elem)\n\t\tcopiedResidual := genDeletedSlice(idx, residual)\n\t\tres = append(res, factorialRecursion(copiedInterim, copiedResidual)...)\n\t}\n\n\treturn res\n}\nfunc genDeletedSlice(delId int, S []rune) []rune {\n\tres := []rune{}\n\tres = append(res, S[:delId]...)\n\tres = append(res, S[delId+1:]...)\n\treturn res\n}\n\n// memo: 3**10 == 59049\nfunc CalcDuplicatePatterns(elements []rune, digit int) [][]rune {\n\treturn duplicateRecursion([]rune{}, elements, digit)\n}\nfunc duplicateRecursion(interim, elements []rune, digit int) [][]rune {\n\tif len(interim) == digit {\n\t\treturn [][]rune{interim}\n\t}\n\n\tres := [][]rune{}\n\tfor i := 0; i < len(elements); i++ {\n\t\tcopiedInterim := make([]rune, len(interim))\n\t\tcopy(copiedInterim, interim)\n\t\tcopiedInterim = append(copiedInterim, elements[i])\n\t\tres = append(res, duplicateRecursion(copiedInterim, elements, digit)...)\n\t}\n\n\treturn res\n}\n\n// usage\n//tmp := CalcFactorialPatterns([]rune{'a', 'b', 'c'})\n//expected := []string{\"abc\", \"acb\", \"bac\", \"bca\", \"cab\", \"cba\"}\n//tmp := CalcDuplicatePatterns([]rune{'a', 'b', 'c'}, 3)\n//expected := []string{\"aaa\", \"aab\", \"aac\", \"aba\", \"abb\", \"abc\", ...}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value(s[idx]) is EQUAL TO AND LARGER THAN A KEY.\n// The idx is the most left one when there are many keys.\n// In other words, the idx is the point where the argument key should be inserted.\nfunc LowerBound(s []int, key int) int {\n\tisLargerAndEqual := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLargerAndEqual(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value(s[idx]) is LARGER THAN A KEY.\n// The idx is the most right one when there are many keys.\n// In other words, the idx is the point where the argument key should be inserted.\nfunc UpperBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] > key {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// usage\n//test := []int{1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 10, 10, 10, 20, 20, 20, 30, 30, 30}\n//assert.Equal(t, 5, UpperBound(test, 5)-LowerBound(test, 5))\n//assert.Equal(t, 0, UpperBound(test, 15)-LowerBound(test, 15))\n\n/*********** Union Find ***********/\n\nfunc InitParents(parents []int, maxNodeId int) {\n\tfor i := 0; i <= maxNodeId; i++ {\n\t\tparents[i] = i\n\t}\n}\n\nfunc unite(x, y int, parents []int) {\n\txp, yp := root(x, parents), root(y, parents)\n\tif xp == yp {\n\t\treturn\n\t}\n\n\tparents[xp] = yp\n}\n\nfunc same(x, y int, parents []int) bool {\n\treturn root(x, parents) == root(y, parents)\n}\n\nfunc root(x int, parents []int) int {\n\tif parents[x] == x {\n\t\treturn x\n\t}\n\n\tparents[x] = root(parents[x], parents)\n\treturn parents[x]\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\n// Complicity: O(n)\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\n\tp := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/*********** Inverse Element ***********/\n\n// CalcNegativeMod can calculate a right residual whether value is positive or negative.\nfunc CalcNegativeMod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\nfunc modpow(a, e, m int) int {\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := modpow(a, halfE, m)\n\t\treturn half * half % m\n\t}\n\n\treturn a * modpow(a, e-1, m) % m\n}\n\n// CalcModInv returns $a^{-1} mod m$ by Fermat's little theorem.\nfunc CalcModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// struct sort\ntype Mono struct {\n\tkey, value int\n}\ntype MonoList []*Mono\n\nfunc (ml MonoList) Len() int {\n\treturn len(ml)\n}\nfunc (ml MonoList) Swap(i, j int) {\n\tml[i], ml[j] = ml[j], ml[i]\n}\nfunc (ml MonoList) Less(i, j int) bool {\n\treturn ml[i].value < ml[j].value\n}\n\n// Example(ABC111::C)\n//oddCountList, evenCountList := make(MonoList, 1e5+1), make(MonoList, 1e5+1)\n//for i := 0; i <= 1e5; i++ {\n//\toddCountList[i] = &Mono{key: i, value: oddMemo[i]}\n//\tevenCountList[i] = &Mono{key: i, value: evenMemo[i]}\n//}\n//sort.Sort(sort.Reverse(oddCountList))\t\t// DESC sort\n//sort.Sort(sort.Reverse(evenCountList))\t// DESC sort\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/********** String Split **********/\n\n//strs := strings.Split(string(runeSlice), \"+\")\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar n, k int\nvar D []int\nvar memo map[int]bool\n\nfunc main() {\n\tn, k = ReadInt(), ReadInt()\n\tD = ReadIntSlice(k)\n\n\tmemo = make(map[int]bool)\n\tfor _, digit := range D {\n\t\tmemo[digit] = true\n\t}\n\n\tfor i := n; i <= 1000000; i++ {\n\t\tif sub(i) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc sub(num int) bool {\n\tfor num > 0 {\n\t\tdigit := num % 10\n\t\tif memo[digit] {\n\t\t\treturn false\n\t\t}\n\t\tnum /= 10\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1549211239, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04045.html", "problem_id": "p04045", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04045/input.txt", "sample_output_relpath": "derived/input_output/data/p04045/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04045/Go/s095786200.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s095786200", "user_id": "u103600314"}, "prompt_components": {"gold_output": "2000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// CeilInt returns the minimum integer larger than or equal to float(a/b).\nfunc CeilInt(a, b int) int {\n\tres := a / b\n\tif a%b > 0 {\n\t\tres++\n\t}\n\treturn res\n}\n\n// FloorInt returns the maximum integer smaller than or equal to float(a/b)\nfunc FloorInt(a, b int) int {\n\tres := a / b\n\treturn res\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Permutation ***********/\n\n// memo: 10! == 3628800 > 3M\nfunc CalcFactorialPatterns(elements []rune) [][]rune {\n\tcopiedResidual := make([]rune, len(elements))\n\tcopy(copiedResidual, elements)\n\treturn factorialRecursion([]rune{}, copiedResidual)\n}\nfunc factorialRecursion(interim, residual []rune) [][]rune {\n\tif len(residual) == 0 {\n\t\treturn [][]rune{interim}\n\t}\n\n\tres := [][]rune{}\n\tfor idx, elem := range residual {\n\t\tcopiedInterim := make([]rune, len(interim))\n\t\tcopy(copiedInterim, interim)\n\t\tcopiedInterim = append(copiedInterim, elem)\n\t\tcopiedResidual := genDeletedSlice(idx, residual)\n\t\tres = append(res, factorialRecursion(copiedInterim, copiedResidual)...)\n\t}\n\n\treturn res\n}\nfunc genDeletedSlice(delId int, S []rune) []rune {\n\tres := []rune{}\n\tres = append(res, S[:delId]...)\n\tres = append(res, S[delId+1:]...)\n\treturn res\n}\n\n// memo: 3**10 == 59049\nfunc CalcDuplicatePatterns(elements []rune, digit int) [][]rune {\n\treturn duplicateRecursion([]rune{}, elements, digit)\n}\nfunc duplicateRecursion(interim, elements []rune, digit int) [][]rune {\n\tif len(interim) == digit {\n\t\treturn [][]rune{interim}\n\t}\n\n\tres := [][]rune{}\n\tfor i := 0; i < len(elements); i++ {\n\t\tcopiedInterim := make([]rune, len(interim))\n\t\tcopy(copiedInterim, interim)\n\t\tcopiedInterim = append(copiedInterim, elements[i])\n\t\tres = append(res, duplicateRecursion(copiedInterim, elements, digit)...)\n\t}\n\n\treturn res\n}\n\n// usage\n//tmp := CalcFactorialPatterns([]rune{'a', 'b', 'c'})\n//expected := []string{\"abc\", \"acb\", \"bac\", \"bca\", \"cab\", \"cba\"}\n//tmp := CalcDuplicatePatterns([]rune{'a', 'b', 'c'}, 3)\n//expected := []string{\"aaa\", \"aab\", \"aac\", \"aba\", \"abb\", \"abc\", ...}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value(s[idx]) is EQUAL TO AND LARGER THAN A KEY.\n// The idx is the most left one when there are many keys.\n// In other words, the idx is the point where the argument key should be inserted.\nfunc LowerBound(s []int, key int) int {\n\tisLargerAndEqual := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLargerAndEqual(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value(s[idx]) is LARGER THAN A KEY.\n// The idx is the most right one when there are many keys.\n// In other words, the idx is the point where the argument key should be inserted.\nfunc UpperBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] > key {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// usage\n//test := []int{1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 10, 10, 10, 20, 20, 20, 30, 30, 30}\n//assert.Equal(t, 5, UpperBound(test, 5)-LowerBound(test, 5))\n//assert.Equal(t, 0, UpperBound(test, 15)-LowerBound(test, 15))\n\n/*********** Union Find ***********/\n\nfunc InitParents(parents []int, maxNodeId int) {\n\tfor i := 0; i <= maxNodeId; i++ {\n\t\tparents[i] = i\n\t}\n}\n\nfunc unite(x, y int, parents []int) {\n\txp, yp := root(x, parents), root(y, parents)\n\tif xp == yp {\n\t\treturn\n\t}\n\n\tparents[xp] = yp\n}\n\nfunc same(x, y int, parents []int) bool {\n\treturn root(x, parents) == root(y, parents)\n}\n\nfunc root(x int, parents []int) int {\n\tif parents[x] == x {\n\t\treturn x\n\t}\n\n\tparents[x] = root(parents[x], parents)\n\treturn parents[x]\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\n// Complicity: O(n)\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\n\tp := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/*********** Inverse Element ***********/\n\n// CalcNegativeMod can calculate a right residual whether value is positive or negative.\nfunc CalcNegativeMod(val, m int) int {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\nfunc modpow(a, e, m int) int {\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := modpow(a, halfE, m)\n\t\treturn half * half % m\n\t}\n\n\treturn a * modpow(a, e-1, m) % m\n}\n\n// CalcModInv returns $a^{-1} mod m$ by Fermat's little theorem.\nfunc CalcModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// struct sort\ntype Mono struct {\n\tkey, value int\n}\ntype MonoList []*Mono\n\nfunc (ml MonoList) Len() int {\n\treturn len(ml)\n}\nfunc (ml MonoList) Swap(i, j int) {\n\tml[i], ml[j] = ml[j], ml[i]\n}\nfunc (ml MonoList) Less(i, j int) bool {\n\treturn ml[i].value < ml[j].value\n}\n\n// Example(ABC111::C)\n//oddCountList, evenCountList := make(MonoList, 1e5+1), make(MonoList, 1e5+1)\n//for i := 0; i <= 1e5; i++ {\n//\toddCountList[i] = &Mono{key: i, value: oddMemo[i]}\n//\tevenCountList[i] = &Mono{key: i, value: evenMemo[i]}\n//}\n//sort.Sort(sort.Reverse(oddCountList))\t\t// DESC sort\n//sort.Sort(sort.Reverse(evenCountList))\t// DESC sort\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/********** String Split **********/\n\n//strs := strings.Split(string(runeSlice), \"+\")\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar n, k int\nvar D []int\nvar memo map[int]bool\n\nfunc main() {\n\tn, k = ReadInt(), ReadInt()\n\tD = ReadIntSlice(k)\n\n\tmemo = make(map[int]bool)\n\tfor _, digit := range D {\n\t\tmemo[digit] = true\n\t}\n\n\tfor i := n; i <= 1000000; i++ {\n\t\tif sub(i) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc sub(num int) bool {\n\tfor num > 0 {\n\t\tdigit := num % 10\n\t\tif memo[digit] {\n\t\t\treturn false\n\t\t}\n\t\tnum /= 10\n\t}\n\treturn true\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "sample_input": "1000 8\n1 3 4 5 6 7 8 9\n"}, "reference_outputs": ["2000\n"], "source_document_id": "p04045", "source_text": "Score : 300 points\n\nProblem Statement\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier.\nHer total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).\n\nHowever, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.\n\nFind the amount of money that she will hand to the cashier.\n\nConstraints\n\n1 ≦ N < 10000\n\n1 ≦ K < 10\n\n0 ≦ D_1 < D_2 < … < D_K≦9\n\n\\{D_1,D_2,...,D_K\\} ≠ \\{1,2,3,4,5,6,7,8,9\\}\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nD_1 D_2 … D_K\n\nOutput\n\nPrint the amount of money that Iroha will hand to the cashier.\n\nSample Input 1\n\n1000 8\n1 3 4 5 6 7 8 9\n\nSample Output 1\n\n2000\n\nShe dislikes all digits except 0 and 2.\n\nThe smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.\n\nSample Input 2\n\n9999 1\n0\n\nSample Output 2\n\n9999", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 12565, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s631119774", "group_id": "codeNet:p04047", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\tn2 := n << 1\n\tll := make([]int, n2)\n\tfor i := 0; i < n2; i++ {\n\t\tll[i] = getNextInt(scanner)\n\t}\n\tsort.Ints(ll)\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tans += ll[i<<1]\n\t}\n\n\tfmt.Println(ans)\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1577546688, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04047.html", "problem_id": "p04047", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04047/input.txt", "sample_output_relpath": "derived/input_output/data/p04047/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04047/Go/s631119774.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s631119774", "user_id": "u150542210"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\tn2 := n << 1\n\tll := make([]int, n2)\n\tfor i := 0; i < n2; i++ {\n\t\tll[i] = getNextInt(scanner)\n\t}\n\tsort.Ints(ll)\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tans += ll[i<<1]\n\t}\n\n\tfmt.Println(ans)\n\twriter.Flush()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "sample_input": "2\n1 3 1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p04047", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1361, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s057657348", "group_id": "codeNet:p04047", "input_text": "package main\nimport \"fmt\"\nimport \"sort\"\nvar (\n index int\n)\nfunc main() {\nfmt.Scanf(\"%d\", &index)\nindex *= 2\n p := make([]int, index)\nfor i := 0; i < index; i++ {\n fmt.Scanf(\"%d\", &p[i])\n}\nsort.Sort(sort.Reverse(sort.IntSlice(p)))\nsum := 0\nfor i := 1; i < index; i+=2 {\nsum += p[i]\n}\nfmt.Println(sum)\n}", "language": "Go", "metadata": {"date": 1475299090, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04047.html", "problem_id": "p04047", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04047/input.txt", "sample_output_relpath": "derived/input_output/data/p04047/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04047/Go/s057657348.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s057657348", "user_id": "u494539131"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\nimport \"fmt\"\nimport \"sort\"\nvar (\n index int\n)\nfunc main() {\nfmt.Scanf(\"%d\", &index)\nindex *= 2\n p := make([]int, index)\nfor i := 0; i < index; i++ {\n fmt.Scanf(\"%d\", &p[i])\n}\nsort.Sort(sort.Reverse(sort.IntSlice(p)))\nsum := 0\nfor i := 1; i < index; i+=2 {\nsum += p[i]\n}\nfmt.Println(sum)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "sample_input": "2\n1 3 1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p04047", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke is having a barbeque party.\n\nAt the party, he will make N servings of Skewer Meal.\n\nExample of a serving of Skewer Meal\n\nHe has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i.\nAlso, he has an infinite supply of ingredients.\n\nTo make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.\nLet the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.\n\nWhat is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?\n\nConstraints\n\n1≦N≦100\n\n1≦L_i≦100\n\nFor each i, L_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_{2N}\n\nOutput\n\nPrint the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.\n\nSample Input 1\n\n2\n1 3 1 2\n\nSample Output 1\n\n3\n\nIf he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.\n\nSample Input 2\n\n5\n100 1 2 3 14 15 58 58 58 29\n\nSample Output 2\n\n135", "split": "test_in_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 318, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"}